| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/wasm-compiler.h" | 5 #include "src/compiler/wasm-compiler.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
| 10 | 10 |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 jsgraph()->IntPtrConstant(0), *effect, *control); | 481 jsgraph()->IntPtrConstant(0), *effect, *control); |
| 482 Node* pointer = graph()->NewNode(jsgraph()->machine()->LoadStackPointer()); | 482 Node* pointer = graph()->NewNode(jsgraph()->machine()->LoadStackPointer()); |
| 483 | 483 |
| 484 Node* check = | 484 Node* check = |
| 485 graph()->NewNode(jsgraph()->machine()->UintLessThan(), limit, pointer); | 485 graph()->NewNode(jsgraph()->machine()->UintLessThan(), limit, pointer); |
| 486 | 486 |
| 487 Diamond stack_check(graph(), jsgraph()->common(), check, BranchHint::kTrue); | 487 Diamond stack_check(graph(), jsgraph()->common(), check, BranchHint::kTrue); |
| 488 stack_check.Chain(*control); | 488 stack_check.Chain(*control); |
| 489 Node* effect_true = *effect; | 489 Node* effect_true = *effect; |
| 490 | 490 |
| 491 Node* effect_false; | |
| 492 // Generate a call to the runtime if there is a stack check failure. | 491 // Generate a call to the runtime if there is a stack check failure. |
| 493 { | 492 Node* call = BuildCallToRuntime(Runtime::kStackGuard, jsgraph(), |
| 494 Node* node = BuildCallToRuntime(Runtime::kStackGuard, jsgraph(), | 493 module_->instance->context, nullptr, 0, |
| 495 module_->instance->context, nullptr, 0, | 494 effect, stack_check.if_false); |
| 496 effect, stack_check.if_false); | 495 SetSourcePosition(call, position); |
| 497 effect_false = node; | |
| 498 } | |
| 499 | 496 |
| 500 Node* ephi = graph()->NewNode(jsgraph()->common()->EffectPhi(2), | 497 Node* ephi = graph()->NewNode(jsgraph()->common()->EffectPhi(2), |
| 501 effect_true, effect_false, stack_check.merge); | 498 effect_true, call, stack_check.merge); |
| 502 | 499 |
| 503 *control = stack_check.merge; | 500 *control = stack_check.merge; |
| 504 *effect = ephi; | 501 *effect = ephi; |
| 505 } | 502 } |
| 506 } | 503 } |
| 507 | 504 |
| 508 Node* WasmGraphBuilder::Binop(wasm::WasmOpcode opcode, Node* left, Node* right, | 505 Node* WasmGraphBuilder::Binop(wasm::WasmOpcode opcode, Node* left, Node* right, |
| 509 wasm::WasmCodePosition position) { | 506 wasm::WasmCodePosition position) { |
| 510 const Operator* op; | 507 const Operator* op; |
| 511 MachineOperatorBuilder* m = jsgraph()->machine(); | 508 MachineOperatorBuilder* m = jsgraph()->machine(); |
| (...skipping 3177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3689 Smi::FromInt(instruction.instr_offset)); | 3686 Smi::FromInt(instruction.instr_offset)); |
| 3690 fn_protected->set(Code::kTrapDataSize * i + Code::kTrapLandingOffset, | 3687 fn_protected->set(Code::kTrapDataSize * i + Code::kTrapLandingOffset, |
| 3691 Smi::FromInt(instruction.landing_offset)); | 3688 Smi::FromInt(instruction.landing_offset)); |
| 3692 } | 3689 } |
| 3693 return fn_protected; | 3690 return fn_protected; |
| 3694 } | 3691 } |
| 3695 | 3692 |
| 3696 } // namespace compiler | 3693 } // namespace compiler |
| 3697 } // namespace internal | 3694 } // namespace internal |
| 3698 } // namespace v8 | 3695 } // namespace v8 |
| OLD | NEW |