The overload resolution code generated by CodeGeneratorJS.pm currently looks like this: EncodedJSValue JSC_HOST_CALL jsWebGLRenderingContextPrototypeFunctionBufferSubData(ExecState* exec) { if ((exec->argumentCount() == 3 && (exec->argument(2).isNull() || (exec->argument(2).isObject() && asObject(exec->argument(2))->inherits(&JSArrayBuffer::s_info))))) return jsWebGLRenderingContextPrototypeFunctionBufferSubData1(exec); if ((exec->argumentCount() == 3 && (exec->argument(2).isNull() || (exec->argument(2).isObject() && asObject(exec->argument(2))->inherits(&JSArrayBufferView::s_info))))) return jsWebGLRenderingContextPrototypeFunctionBufferSubData2(exec); return throwVMTypeError(exec); } This could be a lot more efficient (no need for all those calls to argumentCount() and argument().)
Created attachment 95006 [details] Proposed patch
For reference, same function after this patch: EncodedJSValue JSC_HOST_CALL jsWebGLRenderingContextPrototypeFunctionBufferSubData(ExecState* exec) { size_t argsCount = exec->argumentCount(); JSValue arg2(exec->argument(2)); if ((argsCount == 3 && (arg2.isNull() || (arg2.isObject() && asObject(arg2)->inherits(&JSArrayBuffer::s_info))))) return jsWebGLRenderingContextPrototypeFunctionBufferSubData1(exec); if ((argsCount == 3 && (arg2.isNull() || (arg2.isObject() && asObject(arg2)->inherits(&JSArrayBufferView::s_info))))) return jsWebGLRenderingContextPrototypeFunctionBufferSubData2(exec); return throwVMTypeError(exec); }
Comment on attachment 95006 [details] Proposed patch r=me
Comment on attachment 95006 [details] Proposed patch Clearing flags on attachment: 95006 Committed r87412: <http://trac.webkit.org/changeset/87412>
All reviewed patches have been landed. Closing bug.