Implement indirect calls in WebAssembly
Created attachment 261073 [details] Patch
Created attachment 261077 [details] Patch
Comment on attachment 261077 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=261077&action=review r=me > Source/JavaScriptCore/wasm/WASMFunctionCompiler.h:610 > + > + const Vector<JSFunction*>& functions = m_module->functionPointerTables()[functionPointerTableIndex].functions; > + move(TrustedImmPtr(functions.data()), GPRInfo::regT0); > + load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::regT1); > + m_tempStackTop--; Can you guarantee that the vector will never resize (and thus never change its data pointer)?
Thanks for the review. (In reply to comment #3) > Comment on attachment 261077 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=261077&action=review > > r=me > > > Source/JavaScriptCore/wasm/WASMFunctionCompiler.h:610 > > + > > + const Vector<JSFunction*>& functions = m_module->functionPointerTables()[functionPointerTableIndex].functions; > > + move(TrustedImmPtr(functions.data()), GPRInfo::regT0); > > + load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::regT1); > > + m_tempStackTop--; > > Can you guarantee that the vector will never resize (and thus never change > its data pointer)? WASM source is parsed in two passes. The first pass is for syntax checking and initializing some data. The second pass is for code generation. The vector only resizes in the first pass. It will never resize after that. The vector only resizes when we load the WASM module and parse the function pointer tables. It will never resize after that.
Oops, please ignore the second paragraph. I rephrased it and forgot to remove it.
Created attachment 261337 [details] Update to ToT and use Math.imul for multiplication
Comment on attachment 261337 [details] Update to ToT and use Math.imul for multiplication r=me
Comment on attachment 261337 [details] Update to ToT and use Math.imul for multiplication Clearing flags on attachment: 261337 Committed r189892: <http://trac.webkit.org/changeset/189892>
All reviewed patches have been landed. Closing bug.