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

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

Issue 1205473004: [turbofan] Make global variable loads and stores explicit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/ast-graph-builder.h ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index 57cf360ed46483298aa782dbb97268be8d660bda..bc9dd734c90f3dc265bd39bc30af8125fac71b50 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -3233,7 +3233,7 @@ Node* AstGraphBuilder::BuildVariableLoad(Variable* variable,
// Global var, const, or let variable.
Node* global = BuildLoadGlobalObject();
Handle<Name> name = variable->name();
- Node* value = BuildNamedLoad(global, name, feedback, contextual_mode);
+ Node* value = BuildGlobalLoad(global, name, feedback, contextual_mode);
states.AddToNode(value, bailout_id, combine);
return value;
}
@@ -3367,8 +3367,8 @@ Node* AstGraphBuilder::BuildVariableAssignment(
// Global var, const, or let variable.
Node* global = BuildLoadGlobalObject();
Handle<Name> name = variable->name();
- Node* store = BuildNamedStore(global, name, value, feedback,
- TypeFeedbackId::None());
+ Node* store = BuildGlobalStore(global, name, value, feedback,
+ TypeFeedbackId::None());
states.AddToNode(store, bailout_id, combine);
return store;
}
@@ -3491,10 +3491,8 @@ Node* AstGraphBuilder::BuildKeyedLoad(Node* object, Node* key,
Node* AstGraphBuilder::BuildNamedLoad(Node* object, Handle<Name> name,
- const VectorSlotPair& feedback,
- ContextualMode mode) {
- const Operator* op =
- javascript()->LoadNamed(MakeUnique(name), feedback, mode);
+ const VectorSlotPair& feedback) {
+ const Operator* op = javascript()->LoadNamed(MakeUnique(name), feedback);
Node* node = NewNode(op, object, BuildLoadFeedbackVector());
return Record(js_type_feedback_, node, feedback.slot());
}
@@ -3571,6 +3569,30 @@ Node* AstGraphBuilder::BuildNamedSuperStore(Node* receiver, Node* home_object,
}
+Node* AstGraphBuilder::BuildGlobalLoad(Node* object, Handle<Name> name,
+ const VectorSlotPair& feedback,
+ ContextualMode mode) {
+ const Operator* op =
+ javascript()->LoadGlobal(MakeUnique(name), feedback, mode);
+ Node* node = NewNode(op, object, BuildLoadFeedbackVector());
+ return Record(js_type_feedback_, node, feedback.slot());
+}
+
+
+Node* AstGraphBuilder::BuildGlobalStore(Node* object, Handle<Name> name,
+ Node* value,
+ const VectorSlotPair& feedback,
+ TypeFeedbackId id) {
+ const Operator* op =
+ javascript()->StoreGlobal(language_mode(), MakeUnique(name), feedback);
+ Node* node = NewNode(op, object, value, BuildLoadFeedbackVector());
+ if (FLAG_vector_stores) {
+ return Record(js_type_feedback_, node, feedback.slot());
+ }
+ return Record(js_type_feedback_, node, id);
+}
+
+
Node* AstGraphBuilder::BuildLoadObjectField(Node* object, int offset) {
return NewNode(jsgraph()->machine()->Load(kMachAnyTagged), object,
jsgraph()->IntPtrConstant(offset - kHeapObjectTag));
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698