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

Unified Diff: src/hydrogen.cc

Issue 1250413002: [stubs] Further optimize Load/StoreGlobalViaContext stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE Created 5 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/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index f4bd4179790f34409068a04ce518c46c6ecca4c7..2689e42d5c1d89e38bb3f698b6503be70e5bc965 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5564,12 +5564,11 @@ void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
} else if (variable->IsGlobalSlot()) {
DCHECK(variable->index() > 0);
DCHECK(variable->IsStaticGlobalObjectProperty());
- // Each var occupies two slots in the context: for reads and writes.
int slot_index = variable->index();
int depth = scope()->ContextChainLength(variable->scope());
HLoadGlobalViaContext* instr =
- New<HLoadGlobalViaContext>(variable->name(), depth, slot_index);
+ New<HLoadGlobalViaContext>(depth, slot_index);
return ast_context()->ReturnInstruction(instr, expr->id());
} else {
@@ -6796,12 +6795,11 @@ void HOptimizedGraphBuilder::HandleGlobalVariableAssignment(
} else if (var->IsGlobalSlot()) {
DCHECK(var->index() > 0);
DCHECK(var->IsStaticGlobalObjectProperty());
- // Each var occupies two slots in the context: for reads and writes.
- int slot_index = var->index() + 1;
+ int slot_index = var->index();
int depth = scope()->ContextChainLength(var->scope());
HStoreGlobalViaContext* instr = Add<HStoreGlobalViaContext>(
- var->name(), value, depth, slot_index, function_language_mode());
+ value, depth, slot_index, function_language_mode());
USE(instr);
DCHECK(instr->HasObservableSideEffects());
Add<HSimulate>(ast_id, REMOVABLE_SIMULATE);

Powered by Google App Engine
This is Rietveld 408576698