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

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

Issue 2188533002: [turbofan] Generate loop exits in the bytecode graph builder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix translation of int32 constants to allow smis. Created 4 years, 5 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
Index: src/compiler/bytecode-graph-builder.h
diff --git a/src/compiler/bytecode-graph-builder.h b/src/compiler/bytecode-graph-builder.h
index 16e1f2180be53c2b04ce8f7affdfacc236a2b917..e57615655cccff8869da3afa8488659c06d28a79 100644
--- a/src/compiler/bytecode-graph-builder.h
+++ b/src/compiler/bytecode-graph-builder.h
@@ -7,6 +7,7 @@
#include "src/compiler.h"
#include "src/compiler/bytecode-branch-analysis.h"
+#include "src/compiler/bytecode-loop-analysis.h"
#include "src/compiler/js-graph.h"
#include "src/interpreter/bytecode-array-iterator.h"
#include "src/interpreter/bytecode-flags.h"
@@ -147,6 +148,12 @@ class BytecodeGraphBuilder {
// Simulates control flow that exits the function body.
void MergeControlToLeaveFunction(Node* exit);
+ // Builds loop exit nodes for every exited loop between {origin_offset} and
+ // {target_offset}.
Michael Starzinger 2016/07/29 08:54:46 nit: s/{origin_offset}/the current bytecode offset
Jarin 2016/07/29 11:36:46 Done.
+ void BuildLoopExitsForBranch(int target_offset);
+ void BuildLoopExitsForFunctionExit();
+ void BuildLoopExitsUntilLoop(int loop_offset);
+
// Simulates entry and exit of exception handlers.
void EnterAndExitExceptionHandlers(int current_offset);
@@ -206,6 +213,12 @@ class BytecodeGraphBuilder {
branch_analysis_ = branch_analysis;
}
+ const BytecodeLoopAnalysis* loop_analysis() const { return loop_analysis_; }
+
+ void set_loop_analysis(const BytecodeLoopAnalysis* loop_analysis) {
+ loop_analysis_ = loop_analysis;
+ }
+
#define DECLARE_VISIT_BYTECODE(name, ...) void Visit##name();
BYTECODE_LIST(DECLARE_VISIT_BYTECODE)
#undef DECLARE_VISIT_BYTECODE
@@ -218,6 +231,7 @@ class BytecodeGraphBuilder {
const FrameStateFunctionInfo* frame_state_function_info_;
const interpreter::BytecodeArrayIterator* bytecode_iterator_;
const BytecodeBranchAnalysis* branch_analysis_;
+ const BytecodeLoopAnalysis* loop_analysis_;
Environment* environment_;
BailoutId osr_ast_id_;

Powered by Google App Engine
This is Rietveld 408576698