v8/test/mjsunit/wasm
ahaas 7bd61b601c [wasm] Introduce the TrapIf and TrapUnless operators to generate trap code.
Some instructions in WebAssembly trap for some inputs, which means that the
execution is terminated and (at least at the moment) a JavaScript exception is
thrown. Examples for traps are out-of-bounds memory accesses, or integer
divisions by zero.

Without the TrapIf and TrapUnless operators trap check in WebAssembly introduces 5
TurboFan nodes (branch, if_true, if_false, trap-reason constant, trap-position
constant), in addition to the trap condition itself. Additionally, each
WebAssembly function has four TurboFan nodes (merge, effect_phi, 2 phis) whose
number of inputs is linear to the number of trap checks in the function.
Especially for functions with high numbers of trap checks we observe a
significant slowdown in compilation time, down to 0.22 MiB/s in the sqlite
benchmark instead of the average of 3 MiB/s in other benchmarks. By introducing
a TrapIf common operator only a single node is necessary per trap check, in
addition to the trap condition. Also the nodes which are shared between trap
checks (merge, effect_phi, 2 phis) would disappear. First measurements suggest a
speedup of 30-50% on average.

This CL only implements TrapIf and TrapUnless on x64. The implementation is also
hidden behind the --wasm-trap-if flag.

Please take a special look at how the source position is transfered from the
instruction selector to the code generator, and at the context that is used for
the runtime call.

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2562393002
Cr-Commit-Position: refs/heads/master@{#41720}
2016-12-15 13:31:29 +00:00
..
embenchen [wasm] asm.js - Remove Wasm.instantiateModuleFromAsm, use asm.js directly. 2016-08-23 04:07:23 +00:00
adapter-frame.js Refactor module builder 2016-06-21 19:48:16 +00:00
add-getters.js [runtime] Add instance size check for CheckEquivalent(). 2016-12-14 11:59:56 +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 - Remove Wasm.instantiateModuleFromAsm, use asm.js directly. 2016-08-23 04:07:23 +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] Fix binary search for asm.js offsets 2016-10-25 09:00:57 +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] Remove obsolete %IsNotAsmWasmCode predicate. 2016-12-09 11:56:05 +00:00
calls.js [wasm] Master CL for Binary 0xC changes. 2016-09-27 20:46:30 +00:00
compiled-module-management.js [wasm] Fix compiled-module-management lifetime issues. 2016-11-03 15:53:56 +00:00
compiled-module-serialization.js [wasm] make WebAssembly.Instance require a WebAssembly.Memory 2016-10-28 18:13:28 +00:00
data-segments.js [wasm] Only immutable imported globals are valid initializer expressions 2016-11-09 15:52:36 +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] Implement {Compile,Runtime}Error; fix traps from start function 2016-10-13 16:18:10 +00:00
exceptions.js [wasm] Reduce usage of old Wasm.* API in JS tests. 2016-10-13 16:55:57 +00:00
export-table.js [wasm] Names of exported functions should be the stringified function index. 2016-12-06 15:33:42 +00:00
ffi-error.js [wasm] Fix ToNumber conversion 2016-12-07 13:54:27 +00:00
ffi.js [wasm] Fix ToNumber conversion 2016-12-07 13:54:27 +00:00
function-names.js [wasm] Master CL for Binary 0xC changes. 2016-09-27 20:46:30 +00:00
function-prototype.js [wasm] Names of exported functions should be the stringified function index. 2016-12-06 15:33:42 +00:00
gc-buffer.js [wasm] Use a Managed<WasmModule> to hold metadata about modules. 2016-10-19 13:07:22 +00:00
gc-frame.js [wasm] Master CL for Binary 0xC changes. 2016-09-27 20:46:30 +00:00
gc-stress.js [wasm] Refactor import handling for 0xC. 2016-10-06 15:43:22 +00:00
globals.js Imported and defined globals share an index space, but previously the decoder clobbered the imported global indices with the defined globals. 2016-10-12 15:19:41 +00:00
grow-memory.js [wasm] Linear/Exported memory maximum property should be set when maximum is defined. 2016-11-08 09:55:27 +00:00
import-memory.js [wasm] Update WasmMemoryObject correctly when module memory is exported. 2016-12-08 20:30:54 +00:00
import-table.js [wasm] Refactor import handling for 0xC. 2016-10-06 15:43:22 +00:00
incrementer.wasm [wasm] Binary 0xD: update encoding of opcodes, types, and add immediates. 2016-10-26 16:56:49 +00:00
indirect-calls.js [wasm] Binary 0xD: update encoding of opcodes, types, and add immediates. 2016-10-26 16:56:49 +00:00
indirect-tables.js [wasm] Names of exported functions should be the stringified function index. 2016-12-06 15:33:42 +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] Fix WasmInstanceWrapper allocation. 2016-12-03 01:29:49 +00:00
instantiate-module-basic.js [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. 2016-11-23 20:44:29 +00:00
instantiate-run-basic.js [wasm] Binary 11: Bump module version to 0xB. 2016-04-29 09:40:24 +00:00
memory-instance-validation.js [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. 2016-11-23 20:44:29 +00:00
memory-size.js [wasm] Binary 0xD: update encoding of opcodes, types, and add immediates. 2016-10-26 16:56:49 +00:00
memory.js [wasm] Do a proper HasProperty() check in the memory and table setup. 2016-09-26 13:08:01 +00:00
module-memory.js [wasm] make WebAssembly.Instance require a WebAssembly.Memory 2016-10-28 18:13:28 +00:00
no-wasm-by-default.js [wasm] Dont ship by default. 2016-07-01 11:37:47 +00:00
OWNERS Adding a few more owners to the wasm directory. 2016-06-29 17:38:30 +00:00
parallel_compilation.js [wasm] Master CL for Binary 0xC changes. 2016-09-27 20:46:30 +00:00
params.js Refactor module builder 2016-06-21 19:48:16 +00:00
receiver.js [wasm] Master CL for Binary 0xC changes. 2016-09-27 20:46:30 +00:00
stack.js [wasm] Binary 0xD: update encoding of opcodes, types, and add immediates. 2016-10-26 16:56:49 +00:00
stackwalk.js [wasm] Master CL for Binary 0xC changes. 2016-09-27 20:46:30 +00:00
start-function.js [wasm] Wrap start function in a JS->WASM wrapper before calling it during initialization. 2016-11-08 12:37:09 +00:00
table.js Test that table object indexing does not interfere with backing table 2016-11-17 12:55:45 +00:00
test-import-export-wrapper.js [wasm] Imported WebAssembly function are never wrapped. 2016-11-10 15:05:52 +00:00
test-wasm-module-builder.js [wasm] Remove the "Wasm" object. 2016-10-26 16:58:53 +00:00
trap-location-with-trap-if.js [wasm] Introduce the TrapIf and TrapUnless operators to generate trap code. 2016-12-15 13:31:29 +00:00
trap-location.js [wasm] Indirect calls without function table cause validation errors. 2016-11-09 08:37:44 +00:00
unicode-validation.js [wasm] Master CL for Binary 0xC changes. 2016-09-27 20:46:30 +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] Store the function_index directly in the js-to-wasm wrapper. 2016-11-03 14:28:37 +00:00
wasm-module-builder.js [wasm] Be more lenient on the names section. 2016-11-15 20:55:55 +00:00
wasm-object-api.js [wasm] Remove the "Wasm" object. 2016-10-26 16:58:53 +00:00