v8/test/mjsunit/wasm
Clemens Hammacher b8f8860161 [wasm] [interpreter] Implement indirect function calls
This CL adds support for indirect function calls to the interpreter. It
can indirectly call other wasm function in the same instance, which are
then executed in the interpreter, or call imported functions.

Implementing this required some refactoring:
- The wasm interpreter now unwraps import wrappers on demand, instead
  of unwrapping all of them on instantiation and storing a vector of
  handles. This also avoids the DeferredHandleScope completely, instead
  we just store two global handles in the code map.
- The interpreter gets the code table, function tables and signature
  tables directly from the attached wasm instance object. This ensures
  that the interpreter sees all updates to tables that might have been
  performed by external code.
- There is now common functionality for calling a code object. This is
  used for direct calls to imported functions and for all indirect
  calls. As these code objects can also be wasm functions which should
  be executed in the interpreter itself, I introduce a struct to hold
  the outcome of calling the code object, or a pointer to
  InterpreterCode to be called in the interpreter.

R=ahaas@chromium.org
BUG=v8:5822

Change-Id: I20fb2ea007e79e5fcff9afb4b1ca31739ebcb83f
Reviewed-on: https://chromium-review.googlesource.com/458417
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44059}
2017-03-23 10:54:58 +00:00
..
embenchen [wasm] asm.js - Remove Wasm.instantiateModuleFromAsm, use asm.js directly. 2016-08-23 04:07:23 +00:00
adapter-frame.js [wasm] Rename wasm::LocalType to wasm::ValueType and kAst* to kWasm* 2016-12-21 13:43:00 +00:00
add-getters.js [wasm] Freeze exports object 2016-12-19 18:45:07 +00:00
asm-wasm-copy.js [wasm] asm.js - Remove Wasm.instantiateModuleFromAsm, use asm.js directly. 2016-08-23 04:07:23 +00:00
asm-wasm-deopt.js [wasm] asm.js - Remove Wasm.instantiateModuleFromAsm, use asm.js directly. 2016-08-23 04:07:23 +00:00
asm-wasm-exception-in-tonumber.js [wasm] Provide correct eval origin for asm.js code 2016-12-12 13:31:37 +00:00
asm-wasm-expr.js [wasm] Master CL for Binary 0xC changes. 2016-09-27 20:46:30 +00:00
asm-wasm-f32.js [wasm] Avoid using const that triggers ignition and flakes on ARM. 2016-12-02 13:54:43 +00:00
asm-wasm-f64.js [wasm] [asm.js] Fix various asm.js issues. 2016-09-28 16:37:04 +00:00
asm-wasm-heap.js [wasm] asm.js - Remove Wasm.instantiateModuleFromAsm, use asm.js directly. 2016-08-23 04:07:23 +00:00
asm-wasm-i32.js [wasm] [asm.js] Fix various asm.js issues. 2016-09-28 16:37:04 +00:00
asm-wasm-literals.js [wasm][asm.js] Fix asm.js in tests to be more strictly valid. 2017-03-14 20:17:04 +00:00
asm-wasm-names.js [wasm] Honor the names section for modules coming from asm.js. 2016-12-06 14:31:51 +00:00
asm-wasm-stack.js [wasm] Patch the native context embedded in compiled code 2017-01-12 18:30:17 +00:00
asm-wasm-stdlib.js [wasm] Remove obsolete %IsNotAsmWasmCode predicate. 2016-12-09 11:56:05 +00:00
asm-wasm-switch.js [wasm] asm.js - Remove Wasm.instantiateModuleFromAsm, use asm.js directly. 2016-08-23 04:07:23 +00:00
asm-wasm-u32.js [wasm] [asm.js] Fix various asm.js issues. 2016-09-28 16:37:04 +00:00
asm-wasm.js [wasm][asm.js] Fix asm.js in tests to be more strictly valid. 2017-03-14 20:17:04 +00:00
asm-with-wasm-off.js Fix test to not teach ClusterFuzz ugly tricks. 2017-02-28 10:25:50 +00:00
calls.js [wasm] Master CL for Binary 0xC changes. 2016-09-27 20:46:30 +00:00
compiled-module-management.js [wasm] Implement correct 2-level namespace for imports. 2016-12-20 15:32:56 +00:00
compiled-module-serialization.js [wasm] Enforce memory and table limits during instantiation. 2017-01-17 19:15:59 +00:00
data-segments.js [wasm] Rename wasm::LocalType to wasm::ValueType and kAst* to kWasm* 2016-12-21 13:43:00 +00:00
divrem-trap.js [mjsunit] Change assertThrows such that it can check the exception message. 2016-11-28 10:26:44 +00:00
ensure-wasm-binaries-up-to-date.js [wasm] Master CL for Binary 0xC changes. 2016-09-27 20:46:30 +00:00
errors.js [wasm] JS-API: enable WebAssembly.instantiate tests; fix LinkError 2017-01-13 20:47:44 +00:00
exceptions.js [wasm] Rename wasm::LocalType to wasm::ValueType and kAst* to kWasm* 2016-12-21 13:43:00 +00:00
export-table.js [wasm] Remove non-standard kExprI8Const bytecode 2017-01-09 13:57:26 +00:00
ffi-error.js [wasm] Fix wasm to js wrapper on ia32 for i64 return 2017-03-15 16:14:19 +00:00
ffi.js [wasm] Remove non-standard kExprI8Const bytecode 2017-01-09 13:57:26 +00:00
float-constant-folding.js [wasm] Do not fold f32-to-f64 and f64-to-f32 conversions. 2017-02-03 12:05:29 +00:00
function-names.js [wasm] Inspect right control frames for unreachable flag 2017-02-16 14:12:01 +00:00
function-prototype.js [wasm] Remove non-standard kExprI8Const bytecode 2017-01-09 13:57:26 +00:00
gc-buffer.js [wasm] Implement correct 2-level namespace for imports. 2016-12-20 15:32:56 +00:00
gc-frame.js [wasm] Rename wasm::LocalType to wasm::ValueType and kAst* to kWasm* 2016-12-21 13:43:00 +00:00
gc-stress.js [wasm] Implement correct 2-level namespace for imports. 2016-12-20 15:32:56 +00:00
globals.js [wasm] Inspect right control frames for unreachable flag 2017-02-16 14:12:01 +00:00
grow-memory.js [wasm] Fix and tighten memory validation 2017-01-18 12:07:57 +00:00
import-memory.js [wasm] Memory buffer should be detached after Memory.Grow 2017-01-26 22:15:59 +00:00
import-table.js [wasm] Remove non-standard kExprI8Const bytecode 2017-01-09 13:57:26 +00:00
incrementer.wasm [wasm] Accept version 0x1 binaries. 2017-02-09 02:09:47 +00:00
indirect-calls.js [wasm] Fix test utils and tests 2017-03-22 14:04:10 +00:00
indirect-tables.js [wasm] Update table bounds when module is instantiated with a table import 2017-01-30 18:10:32 +00:00
instance-gc.js [wasm] Refactor import handling for 0xC. 2016-10-06 15:43:22 +00:00
instance-memory-gc-stress.js [wasm] Implement correct 2-level namespace for imports. 2016-12-20 15:32:56 +00:00
instantiate-module-basic.js [wasm] Instance exports object should be iterable 2017-01-20 19:35:16 +00:00
instantiate-run-basic.js [wasm] Remove non-standard kExprI8Const bytecode 2017-01-09 13:57:26 +00:00
interpreter.js [wasm] [interpreter] Implement indirect function calls 2017-03-23 10:54:58 +00:00
js-api.js [wasm] Memory buffer should be detached after Memory.Grow 2017-01-26 22:15:59 +00:00
jsapi-harness.js [wasm] Update JS API tests to version 1 2017-02-27 21:27:09 +00:00
memory-instance-validation.js [wasm] Implement correct 2-level namespace for imports. 2016-12-20 15:32:56 +00:00
memory-size.js [wasm] Fix and tighten memory validation 2017-01-18 12:07:57 +00:00
memory.js [wasm] WebAssembly.Memory.grow() should handle the no instance case 2017-01-18 04:45:07 +00:00
module-memory.js [wasm] Enforce memory and table limits during instantiation. 2017-01-17 19:15:59 +00:00
names.js [wasm] Errors in names section do not fail the whole module. 2017-01-24 13:13:26 +00:00
OWNERS Make clemensh owner (wasm, asmjs and general) 2017-01-13 10:20:44 +00:00
parallel_compilation.js [wasm] Master CL for Binary 0xC changes. 2016-09-27 20:46:30 +00:00
params.js [wasm] Rename wasm::LocalType to wasm::ValueType and kAst* to kWasm* 2016-12-21 13:43:00 +00:00
receiver.js [wasm] Implement correct 2-level namespace for imports. 2016-12-20 15:32:56 +00:00
stack.js [wasm] Fix and tighten memory validation 2017-01-18 12:07:57 +00:00
stackwalk.js [wasm] Implement correct 2-level namespace for imports. 2016-12-20 15:32:56 +00:00
start-function.js [wasm] Remove non-standard kExprI8Const bytecode 2017-01-09 13:57:26 +00:00
table.js [wasm] Enforce memory and table limits during instantiation. 2017-01-17 19:15:59 +00:00
test-import-export-wrapper.js [wasm] Implement correct 2-level namespace for imports. 2016-12-20 15:32:56 +00:00
test-wasm-compilation-control.js [wasm] Embedder can control what buffers wasm compilation works on. 2017-02-21 03:43:14 +00:00
test-wasm-module-builder.js [wasm] Remove non-standard kExprI8Const bytecode 2017-01-09 13:57:26 +00:00
trap-location.js [wasm] Fix and tighten memory validation 2017-01-18 12:07:57 +00:00
unicode-validation.js [wasm] Implement correct 2-level namespace for imports. 2016-12-20 15:32:56 +00:00
unreachable-validation.js [wasm] Inspect right control frames for unreachable flag 2017-02-16 14:12:01 +00:00
unreachable.js [wasm] Binary 11: Bump module version to 0xB. 2016-04-29 09:40:24 +00:00
verify-module-basic-errors.js [wasm] Reduce usage of old Wasm.* API in JS tests. 2016-10-13 16:55:57 +00:00
wasm-constants.js [wasm] Fix test utils and tests 2017-03-22 14:04:10 +00:00
wasm-default.js [wasm] Enable WASM by default (--expose-wasm=true). 2017-01-12 12:04:35 +00:00
wasm-module-builder.js [wasm] Fix test utils and tests 2017-03-22 14:04:10 +00:00
wasm-object-api.js [wasm] Remove the "Wasm" object. 2016-10-26 16:58:53 +00:00