v8/src/wasm
ahaas f435d6222f [wasm] TrapIf and TrapUnless TurboFan operators implemented on ia32.
Original commit message:
[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/2571813002
Cr-Commit-Position: refs/heads/master@{#41735}
2016-12-15 17:41:03 +00:00
..
ast-decoder.cc [wasm] Enforce limits for maximums for many WebAssembly binary entities. 2016-12-14 17:46:47 +00:00
ast-decoder.h [wasm] Implement official wasm text format 2016-11-22 11:59:56 +00:00
decoder.h [wasm] Fix decoder for null data 2016-10-12 09:11:52 +00:00
leb-helper.h [wasm] Refactor encoder.h to use a proper buffer and remove OldFunctions section. 2016-05-25 16:13:50 +00:00
managed.h [wasm] Use a Managed<WasmModule> to hold metadata about modules. 2016-10-19 13:07:22 +00:00
module-decoder.cc [wasm] Enforce limits for maximums for many WebAssembly binary entities. 2016-12-14 17:46:47 +00:00
module-decoder.h [wasm] Fix location for error in asm.js ToNumber conversion 2016-12-09 10:30:19 +00:00
OWNERS Adding a few more owners to the wasm directory. 2016-06-29 17:38:30 +00:00
signature-map.cc [wasm] Canonicalize function signature indices for matching in indirect calls. 2016-10-11 12:40:33 +00:00
signature-map.h [wasm] Indirect calls without function table cause validation errors. 2016-11-09 08:37:44 +00:00
wasm-debug.cc [wasm] Move asm.js offset table to compiled module 2016-11-28 13:05:30 +00:00
wasm-external-refs.cc [wasm] Introduce the TrapIf and TrapUnless operators to generate trap code. 2016-12-15 13:31:29 +00:00
wasm-external-refs.h [wasm] Introduce the TrapIf and TrapUnless operators to generate trap code. 2016-12-15 13:31:29 +00:00
wasm-interpreter.cc [wasm] Move all V8-specific limitations to wasm-limits.h 2016-12-05 10:02:47 +00:00
wasm-interpreter.h [wasm] Remove raw byte pointers from WasmModule 2016-11-30 15:03:06 +00:00
wasm-js.cc [wasm] Move all V8-specific limitations to wasm-limits.h 2016-12-05 10:02:47 +00:00
wasm-js.h [wasm] Move all heap-allocated WASM structures into wasm-objects.h. 2016-11-11 11:13:17 +00:00
wasm-limits.h [wasm] Enforce limits for maximums for many WebAssembly binary entities. 2016-12-14 17:46:47 +00:00
wasm-macro-gen.h [wasm] Implement I32x4ReplaceLane, I32x4Add, I32x4Sub. 2016-12-06 01:12:55 +00:00
wasm-module-builder.cc [wasm] Fix location for error in asm.js ToNumber conversion 2016-12-09 10:30:19 +00:00
wasm-module-builder.h [wasm] Fix location for error in asm.js ToNumber conversion 2016-12-09 10:30:19 +00:00
wasm-module.cc [wasm][asm.js] Ignore duplicate exports in asm.js. 2016-12-12 14:47:38 +00:00
wasm-module.h [wasm] Enforce limits for maximums for many WebAssembly binary entities. 2016-12-14 17:46:47 +00:00
wasm-objects.cc [wasm] Fix location for error in asm.js ToNumber conversion 2016-12-09 10:30:19 +00:00
wasm-objects.h [wasm] Remove declared but undefined methods 2016-12-09 14:01:29 +00:00
wasm-opcodes.cc [wasm] TrapIf and TrapUnless TurboFan operators implemented on ia32. 2016-12-15 17:41:03 +00:00
wasm-opcodes.h [wasm] TrapIf and TrapUnless TurboFan operators implemented on ia32. 2016-12-15 17:41:03 +00:00
wasm-result.cc [wasm] Implement {Compile,Runtime}Error; fix traps from start function 2016-10-13 16:18:10 +00:00
wasm-result.h Make unittests work in component build 2016-10-17 10:02:06 +00:00
wasm-text.cc [inspector] Split off interface-types.h 2016-12-05 13:32:24 +00:00
wasm-text.h [inspector] Split off interface-types.h 2016-12-05 13:32:24 +00:00