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

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

Issue 1419823003: Remove support for "loads and stores to global vars through property cell shortcuts inst… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@disable-shortcuts
Patch Set: Addressing comments Created 5 years, 2 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/bytecode-graph-builder.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 f20bacee2fa3ad7f426e58e11f0190472d457178..d21ae70e0d7df5bc91a443f1d03ee5011740ad81 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -3312,21 +3312,7 @@ Node* AstGraphBuilder::BuildVariableLoad(Variable* variable,
// Optimize global constants like "undefined", "Infinity", and "NaN".
return jsgraph()->Constant(constant_value);
}
- Node* script_context = current_context();
- int slot_index = -1;
- if (variable->index() > 0) {
- DCHECK(variable->IsStaticGlobalObjectProperty());
- slot_index = variable->index();
- int depth = current_scope()->ContextChainLength(variable->scope());
- if (depth > 0) {
- const Operator* op = javascript()->LoadContext(
- depth - 1, Context::PREVIOUS_INDEX, true);
- script_context = NewNode(op, current_context());
- }
- }
- Node* global = BuildLoadGlobalObject();
- Node* value = BuildGlobalLoad(script_context, global, name, feedback,
- typeof_mode, slot_index);
+ Node* value = BuildGlobalLoad(name, feedback, typeof_mode);
states.AddToNode(value, bailout_id, combine);
return value;
}
@@ -3461,23 +3447,9 @@ Node* AstGraphBuilder::BuildVariableAssignment(
case VariableLocation::GLOBAL:
case VariableLocation::UNALLOCATED: {
// Global var, const, or let variable.
- Node* script_context = current_context();
- int slot_index = -1;
- if (variable->index() > 0) {
- DCHECK(variable->IsStaticGlobalObjectProperty());
- slot_index = variable->index();
- int depth = current_scope()->ContextChainLength(variable->scope());
- if (depth > 0) {
- const Operator* op = javascript()->LoadContext(
- depth - 1, Context::PREVIOUS_INDEX, true);
- script_context = NewNode(op, current_context());
- }
- }
- Node* global = BuildLoadGlobalObject();
Handle<Name> name = variable->name();
Node* store =
- BuildGlobalStore(script_context, global, name, value, feedback,
- TypeFeedbackId::None(), slot_index);
+ BuildGlobalStore(name, value, feedback, TypeFeedbackId::None());
states.AddToNode(store, bailout_id, combine);
return store;
}
@@ -3701,25 +3673,21 @@ Node* AstGraphBuilder::BuildNamedSuperStore(Node* receiver, Node* home_object,
}
-Node* AstGraphBuilder::BuildGlobalLoad(Node* script_context, Node* global,
- Handle<Name> name,
+Node* AstGraphBuilder::BuildGlobalLoad(Handle<Name> name,
const VectorSlotPair& feedback,
- TypeofMode typeof_mode, int slot_index) {
- const Operator* op =
- javascript()->LoadGlobal(name, feedback, typeof_mode, slot_index);
- Node* node = NewNode(op, script_context, global, BuildLoadFeedbackVector());
+ TypeofMode typeof_mode) {
+ const Operator* op = javascript()->LoadGlobal(name, feedback, typeof_mode);
+ Node* node = NewNode(op, BuildLoadFeedbackVector());
return Record(js_type_feedback_, node, feedback.slot());
}
-Node* AstGraphBuilder::BuildGlobalStore(Node* script_context, Node* global,
- Handle<Name> name, Node* value,
+Node* AstGraphBuilder::BuildGlobalStore(Handle<Name> name, Node* value,
const VectorSlotPair& feedback,
- TypeFeedbackId id, int slot_index) {
+ TypeFeedbackId id) {
const Operator* op =
- javascript()->StoreGlobal(language_mode(), name, feedback, slot_index);
- Node* node =
- NewNode(op, script_context, global, value, BuildLoadFeedbackVector());
+ javascript()->StoreGlobal(language_mode(), name, feedback);
+ Node* node = NewNode(op, value, BuildLoadFeedbackVector());
if (FLAG_vector_stores) {
return Record(js_type_feedback_, node, feedback.slot());
}
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698