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

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

Issue 1158183002: [turbofan] Optimize variable loads in DYNAMIC_GLOBAL mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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/ast-graph-builder.cc » ('j') | src/compiler/ast-graph-builder.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.h
diff --git a/src/compiler/ast-graph-builder.h b/src/compiler/ast-graph-builder.h
index f9b8b84359f998d1d1321133bc11835ba6750a3a..78cf11f640bb4e49554035c81f6ccca4c7509469 100644
--- a/src/compiler/ast-graph-builder.h
+++ b/src/compiler/ast-graph-builder.h
@@ -208,9 +208,9 @@ class AstGraphBuilder : public AstVisitor {
void UpdateControlDependencyToLeaveFunction(Node* exit);
// Builds deoptimization for a given node.
- void PrepareFrameState(
- Node* node, BailoutId ast_id,
- OutputFrameStateCombine combine = OutputFrameStateCombine::Ignore());
+ void PrepareFrameState(Node* node, BailoutId ast_id,
+ OutputFrameStateCombine framestate_combine =
+ OutputFrameStateCombine::Ignore());
BitVector* GetVariablesAssignedInLoop(IterationStatement* stmt);
@@ -253,17 +253,30 @@ class AstGraphBuilder : public AstVisitor {
Node* BuildRestArgumentsArray(Variable* rest, int index);
// Builders for variable load and assignment.
- Node* BuildVariableAssignment(
- FrameStateBeforeAndAfter& states, Variable* var, Node* value,
- Token::Value op, BailoutId bailout_id,
- OutputFrameStateCombine combine = OutputFrameStateCombine::Ignore());
+ Node* BuildVariableAssignment(Variable* var, Node* value, Token::Value op,
+ BailoutId bailout_id,
+ FrameStateBeforeAndAfter& states,
+ OutputFrameStateCombine framestate_combine =
+ OutputFrameStateCombine::Ignore());
Node* BuildVariableDelete(Variable* var, BailoutId bailout_id,
- OutputFrameStateCombine combine);
- Node* BuildVariableLoad(FrameStateBeforeAndAfter& states, Variable* var,
- BailoutId bailout_id, const VectorSlotPair& feedback,
- OutputFrameStateCombine combine,
+ OutputFrameStateCombine framestate_combine);
+ Node* BuildVariableLoad(Variable* var, BailoutId bailout_id,
+ FrameStateBeforeAndAfter& states,
+ const VectorSlotPair& feedback,
+ OutputFrameStateCombine framestate_combine,
ContextualMode mode = CONTEXTUAL);
+ // Builders for variables using the global object.
+ Node* BuildGlobalVariableLoad(Variable* var, BailoutId bailout_id,
+ FrameStateBeforeAndAfter& states,
+ const VectorSlotPair& feedback,
+ OutputFrameStateCombine framestate_combine,
+ ContextualMode contextual_mode);
+
+ // Builders for variables using dynamic lookup.
+ Node* BuildDynamicVariableLoad(Variable* var, BailoutId bailout_id,
+ ContextualMode contextual_mode);
+
// Builders for property loads and stores.
Node* BuildKeyedLoad(Node* receiver, Node* key,
const VectorSlotPair& feedback);
@@ -320,6 +333,19 @@ class AstGraphBuilder : public AstVisitor {
Node* ProcessArguments(const Operator* op, int arity);
// ===========================================================================
+ // The following build methods have the same contract as the above ones, but
+ // they can also return {NULL} to indicate that no fragment was built. Note
+ // that these are optimizations, disabling any of them should still produce
+ // correct graphs.
+
+ // Optimizers for variable load and assignment requiring dynamic lookup.
+ Node* TryVariableLoadDynamicGlobal(Variable* variable, BailoutId bailout_id,
+ FrameStateBeforeAndAfter& states,
+ const VectorSlotPair& feedback,
+ OutputFrameStateCombine framestate_combine,
+ ContextualMode contextual_mode);
+
+ // ===========================================================================
// The following visitation methods all recursively visit a subtree of the
// underlying AST and extent the graph. The operand stack is mutated in a way
// consistent with other compilers:
« no previous file with comments | « no previous file | src/compiler/ast-graph-builder.cc » ('j') | src/compiler/ast-graph-builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698