Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Unified Diff: src/compiler/interpreter-assembler.cc

Issue 1665853002: [Interpreter] Add explicit StackCheck bytecodes on function entry and back branches. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix unittests. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/interpreter-assembler.h ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/interpreter-assembler.cc
diff --git a/src/compiler/interpreter-assembler.cc b/src/compiler/interpreter-assembler.cc
index 4fd222c6aaa53eb47f3e1bb07c8a781aac7a74f6..e9c46895e7af041d9b9676435b6b760639d4c0ce 100644
--- a/src/compiler/interpreter-assembler.cc
+++ b/src/compiler/interpreter-assembler.cc
@@ -584,6 +584,11 @@ Node* InterpreterAssembler::CallRuntime(Node* function_id, Node* first_arg,
return CallN(descriptor, code_target, args);
}
+Node* InterpreterAssembler::CallRuntime(Runtime::FunctionId function_id) {
+ CallPrologue();
+ Node* return_val = raw_assembler_->CallRuntime0(function_id, GetContext());
+ return return_val;
+}
Node* InterpreterAssembler::CallRuntime(Runtime::FunctionId function_id,
Node* arg1) {
@@ -702,6 +707,20 @@ void InterpreterAssembler::DispatchTo(Node* new_bytecode_offset) {
raw_assembler_->TailCallN(call_descriptor(), target_code_object, args);
}
+void InterpreterAssembler::StackCheck() {
+ RawMachineLabel ok, stack_guard;
+ Node* sp = raw_assembler_->LoadStackPointer();
+ Node* stack_limit = raw_assembler_->Load(
+ MachineType::Pointer(),
+ raw_assembler_->ExternalConstant(
+ ExternalReference::address_of_stack_limit(isolate())));
+ Node* condition = raw_assembler_->UintPtrGreaterThanOrEqual(sp, stack_limit);
+ raw_assembler_->Branch(condition, &ok, &stack_guard);
+ raw_assembler_->Bind(&stack_guard);
+ CallRuntime(Runtime::kStackGuard);
+ raw_assembler_->Goto(&ok);
+ raw_assembler_->Bind(&ok);
+}
void InterpreterAssembler::Abort(BailoutReason bailout_reason) {
Node* abort_id = SmiTag(Int32Constant(bailout_reason));
« no previous file with comments | « src/compiler/interpreter-assembler.h ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698