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

Unified Diff: src/compiler/bytecode-graph-builder.cc

Issue 2392333002: [ignition/turbo] Remove stack check from inlined functions (Closed)
Patch Set: Change 'while' to 'for' Created 4 years, 1 month 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/js-inlining.cc » ('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 b00bcec339f02a6b9c9ecb01daee5e1d7bff8bd5..ab7db8079b69fd99590931e62890f12226094a6f 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -569,7 +569,7 @@ VectorSlotPair BytecodeGraphBuilder::CreateVectorSlotPair(int slot_id) {
return VectorSlotPair(feedback_vector(), slot);
}
-bool BytecodeGraphBuilder::CreateGraph() {
+bool BytecodeGraphBuilder::CreateGraph(bool stack_check) {
// Set up the basic structure of the graph. Outputs for {Start} are the formal
// parameters (including the receiver) plus new target, number of arguments,
// context and closure.
@@ -581,7 +581,7 @@ bool BytecodeGraphBuilder::CreateGraph() {
GetFunctionContext());
set_environment(&env);
- VisitBytecodes();
+ VisitBytecodes(stack_check);
// Finish the basic structure of the graph.
DCHECK_NE(0u, exit_controls_.size());
@@ -641,7 +641,7 @@ void BytecodeGraphBuilder::ClearNonLiveSlotsInFrameStates() {
}
}
-void BytecodeGraphBuilder::VisitBytecodes() {
+void BytecodeGraphBuilder::VisitBytecodes(bool stack_check) {
BytecodeBranchAnalysis analysis(bytecode_array(), local_zone());
BytecodeLoopAnalysis loop_analysis(bytecode_array(), &analysis, local_zone());
analysis.Analyze();
@@ -655,7 +655,7 @@ void BytecodeGraphBuilder::VisitBytecodes() {
bytecode_array()->source_position_table());
BuildOSRNormalEntryPoint();
- while (!iterator.done()) {
+ for (; !iterator.done(); iterator.Advance()) {
int current_offset = iterator.current_offset();
UpdateCurrentSourcePosition(&source_position_iterator, current_offset);
EnterAndExitExceptionHandlers(current_offset);
@@ -664,6 +664,13 @@ void BytecodeGraphBuilder::VisitBytecodes() {
BuildLoopHeaderEnvironment(current_offset);
BuildOSRLoopEntryPoint(current_offset);
+ // Skip the first stack check if stack_check is false
+ if (!stack_check &&
+ iterator.current_bytecode() == interpreter::Bytecode::kStackCheck) {
+ stack_check = true;
+ continue;
+ }
+
switch (iterator.current_bytecode()) {
#define BYTECODE_CASE(name, ...) \
case interpreter::Bytecode::k##name: \
@@ -673,7 +680,6 @@ void BytecodeGraphBuilder::VisitBytecodes() {
#undef BYTECODE_CODE
}
}
- iterator.Advance();
}
set_branch_analysis(nullptr);
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/compiler/js-inlining.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698