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

Unified Diff: src/hydrogen.cc

Issue 762393008: Fix the order of context binding/simulate insertion for BlockContexts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Test Created 6 years 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 | test/mjsunit/harmony/regress/regress-3741.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 468de1eee448c4a26a042a67c13d67cf947153ce..8570b33ce08a509bc08b5b03250327f116080d87 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -4573,11 +4573,11 @@ void HOptimizedGraphBuilder::VisitBlock(Block* stmt) {
HInstruction* inner_context = Add<HAllocateBlockContext>(
outer_context, function, scope->GetScopeInfo());
HInstruction* instr = Add<HStoreFrameContext>(inner_context);
+ set_scope(scope);
+ environment()->BindContext(inner_context);
if (instr->HasObservableSideEffects()) {
AddSimulate(stmt->EntryId(), REMOVABLE_SIMULATE);
}
- set_scope(scope);
- environment()->BindContext(inner_context);
VisitDeclarations(scope->declarations());
AddSimulate(stmt->DeclsId(), REMOVABLE_SIMULATE);
}
@@ -4591,10 +4591,10 @@ void HOptimizedGraphBuilder::VisitBlock(Block* stmt) {
HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX));
HInstruction* instr = Add<HStoreFrameContext>(outer_context);
+ environment()->BindContext(outer_context);
if (instr->HasObservableSideEffects()) {
AddSimulate(stmt->ExitId(), REMOVABLE_SIMULATE);
}
- environment()->BindContext(outer_context);
}
HBasicBlock* break_block = break_info.break_block();
if (break_block != NULL) {
« no previous file with comments | « no previous file | test/mjsunit/harmony/regress/regress-3741.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698