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

Unified Diff: src/compiler/bytecode-graph-builder.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/bytecode-graph-builder.h ('k') | src/compiler/interpreter-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index cb3bc2fadaeb9a17a3a36afa9fd1b1358b9553d7..83ff7b7b27099358aa37c6977e95388c439c7eff 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -533,8 +533,7 @@ VectorSlotPair BytecodeGraphBuilder::CreateVectorSlotPair(int slot_id) {
return VectorSlotPair(feedback_vector, slot);
}
-
-bool BytecodeGraphBuilder::CreateGraph(bool stack_check) {
+bool BytecodeGraphBuilder::CreateGraph() {
// Set up the basic structure of the graph. Outputs for {Start} are
// the formal parameters (including the receiver) plus context and
// closure.
@@ -550,7 +549,7 @@ bool BytecodeGraphBuilder::CreateGraph(bool stack_check) {
GetFunctionContext());
set_environment(&env);
- CreateGraphBody(stack_check);
+ VisitBytecodes();
// Finish the basic structure of the graph.
DCHECK_NE(0u, exit_controls_.size());
@@ -562,20 +561,6 @@ bool BytecodeGraphBuilder::CreateGraph(bool stack_check) {
return true;
}
-
-void BytecodeGraphBuilder::CreateGraphBody(bool stack_check) {
- // TODO(oth): Review ast-graph-builder equivalent, i.e. arguments
- // object setup, this function variable if used, tracing hooks.
-
- if (stack_check) {
- Node* node = NewNode(javascript()->StackCheck());
- PrepareEntryFrameState(node);
- }
-
- VisitBytecodes();
-}
-
-
void BytecodeGraphBuilder::VisitBytecodes() {
BytecodeBranchAnalysis analysis(bytecode_array(), local_zone());
analysis.Analyze();
@@ -1521,6 +1506,12 @@ void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide() {
BuildJumpIfEqual(jsgraph()->UndefinedConstant());
}
+void BytecodeGraphBuilder::VisitStackCheck() {
+ FrameStateBeforeAndAfter states(this);
+ Node* node = NewNode(javascript()->StackCheck());
+ environment()->RecordAfterState(node, &states);
+}
+
void BytecodeGraphBuilder::VisitReturn() {
Node* control =
NewNode(common()->Return(), environment()->LookupAccumulator());
@@ -1677,16 +1668,6 @@ void BytecodeGraphBuilder::EnterAndExitExceptionHandlers(int current_offset) {
}
}
-void BytecodeGraphBuilder::PrepareEntryFrameState(Node* node) {
- DCHECK_EQ(1, OperatorProperties::GetFrameStateInputCount(node->op()));
- DCHECK_EQ(IrOpcode::kDead,
- NodeProperties::GetFrameStateInput(node, 0)->opcode());
- NodeProperties::ReplaceFrameStateInput(
- node, 0, environment()->Checkpoint(BailoutId(0),
- OutputFrameStateCombine::Ignore()));
-}
-
-
Node* BytecodeGraphBuilder::MakeNode(const Operator* op, int value_input_count,
Node** value_inputs, bool incomplete) {
DCHECK_EQ(op->ValueInputCount(), value_input_count);
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/compiler/interpreter-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698