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

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

Issue 2307863002: [turbofan] Add liveness analysis to the BytecodeGraphBuilder. (Closed)
Patch Set: Update. Created 4 years, 3 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 | « no previous file | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-graph-builder.h
diff --git a/src/compiler/bytecode-graph-builder.h b/src/compiler/bytecode-graph-builder.h
index f8cb18fb720ca27a2ec2aa14ff9e7fa516325814..d87fac9e8166f0ee00573c83f6c04eabe126aef0 100644
--- a/src/compiler/bytecode-graph-builder.h
+++ b/src/compiler/bytecode-graph-builder.h
@@ -8,6 +8,8 @@
#include "src/compiler/bytecode-branch-analysis.h"
#include "src/compiler/bytecode-loop-analysis.h"
#include "src/compiler/js-graph.h"
+#include "src/compiler/liveness-analyzer.h"
+#include "src/compiler/state-values-utils.h"
#include "src/compiler/type-hint-analyzer.h"
#include "src/interpreter/bytecode-array-iterator.h"
#include "src/interpreter/bytecode-flags.h"
@@ -115,6 +117,10 @@ class BytecodeGraphBuilder {
interpreter::Register first_arg,
size_t arity);
+ // Computes register liveness and replaces dead ones in frame states with the
+ // undefined values.
+ void ClearNonLiveSlotsInFrameStates();
+
void BuildCreateLiteral(const Operator* op);
void BuildCreateArguments(CreateArgumentsType type);
Node* BuildLoadContextSlot();
@@ -231,6 +237,12 @@ class BytecodeGraphBuilder {
loop_analysis_ = loop_analysis;
}
+ LivenessAnalyzer* liveness_analyzer() { return &liveness_analyzer_; }
+
+ bool IsLivenessAnalysisEnabled() const {
+ return this->is_liveness_analysis_enabled_;
+ }
+
#define DECLARE_VISIT_BYTECODE(name, ...) void Visit##name();
BYTECODE_LIST(DECLARE_VISIT_BYTECODE)
#undef DECLARE_VISIT_BYTECODE
@@ -268,6 +280,13 @@ class BytecodeGraphBuilder {
// Control nodes that exit the function body.
ZoneVector<Node*> exit_controls_;
+ bool const is_liveness_analysis_enabled_;
+
+ StateValuesCache state_values_cache_;
+
+ // Analyzer of register liveness.
+ LivenessAnalyzer liveness_analyzer_;
+
static int const kBinaryOperationHintIndex = 1;
static int const kCountOperationHintIndex = 0;
static int const kBinaryOperationSmiHintIndex = 2;
« no previous file with comments | « no previous file | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698