Index: src/compiler/wasm-compiler.cc |
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc |
index b457efec4ec3e0e34ddd7305b16f1539a29fc631..93f7a78eed3183af122a040c18688a4d27e0fcb0 100644 |
--- a/src/compiler/wasm-compiler.cc |
+++ b/src/compiler/wasm-compiler.cc |
@@ -374,6 +374,19 @@ Node* WasmGraphBuilder::Int64Constant(int64_t value) { |
return jsgraph()->Int64Constant(value); |
} |
+void WasmGraphBuilder::InitStackCheck(wasm::WasmCodePosition position) { |
+ Node* limit = graph()->NewNode( |
+ jsgraph()->machine()->Load(MachineType::Pointer()), |
+ jsgraph()->ExternalConstant( |
+ ExternalReference::address_of_stack_limit(jsgraph()->isolate())), |
+ jsgraph()->IntPtrConstant(0), *effect_, *control_); |
+ Node* pointer = graph()->NewNode(jsgraph()->machine()->LoadStackPointer()); |
+ |
+ Node* check = |
+ graph()->NewNode(jsgraph()->machine()->UintLessThan(), limit, pointer); |
+ trap_->AddTrapIfFalse(wasm::kTrapStackOverflow, check, position); |
titzer
2016/08/17 08:23:28
We'll need to use the regular JS machinery here an
ahaas
2016/08/17 09:18:43
Done.
|
+} |
+ |
Node* WasmGraphBuilder::Binop(wasm::WasmOpcode opcode, Node* left, Node* right, |
wasm::WasmCodePosition position) { |
const Operator* op; |