Chromium Code Reviews| Index: src/compiler/wasm-compiler.cc |
| diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc |
| index f9620ac34939f6de8b4464b4b72920a2def7bdef..95a3ac84ab769ac7c9bc8b9f5e93f532a7aa9efb 100644 |
| --- a/src/compiler/wasm-compiler.cc |
| +++ b/src/compiler/wasm-compiler.cc |
| @@ -1703,6 +1703,24 @@ Node* WasmGraphBuilder::GrowMemory(Node* input) { |
| return result; |
| } |
| +Node* WasmGraphBuilder::Throw(Node* input) { |
| + MachineOperatorBuilder* machine = jsgraph()->machine(); |
| + |
| + // Pass the thrown value as two SMIs: |
|
titzer
2016/09/15 12:53:28
Please leave a TODO here, since I think we all agr
John
2016/09/15 14:03:08
Done.
|
| + // |
| + // upper = static_cast<uint32_t>(input) >> 16; |
| + // lower = input & 0xFFFF; |
| + Node* upper = BuildChangeInt32ToSmi( |
| + graph()->NewNode(machine->Word32Shr(), input, Int32Constant(16))); |
| + Node* lower = BuildChangeInt32ToSmi( |
| + graph()->NewNode(machine->Word32And(), input, Int32Constant(0xFFFFu))); |
| + |
| + Node* parameters[] = {lower, upper}; // thrown value |
| + return BuildCallToRuntime(Runtime::kWasmThrow, jsgraph(), |
| + module_->instance->context, parameters, |
| + arraysize(parameters), effect_, *control_); |
| +} |
| + |
| Node* WasmGraphBuilder::BuildI32DivS(Node* left, Node* right, |
| wasm::WasmCodePosition position) { |
| MachineOperatorBuilder* m = jsgraph()->machine(); |