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

Unified Diff: src/hydrogen.cc

Issue 14696011: Fix polymorphic store. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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/lithium-allocator.cc » ('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 aeeff340459596646fb28f52b736b7f3ad695e9a..537b791d7006ebf17d78dac8cb5fb7e866b583a5 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -7261,8 +7261,21 @@ void HOptimizedGraphBuilder::HandlePolymorphicStoreNamedField(
AddInstruction(HCheckMaps::New(object, types, zone()));
HInstruction* instr = BuildStoreNamedField(
object, name, value, map, &lookup);
+ AddInstruction(instr);
instr->set_position(expr->position());
- return ast_context()->ReturnInstruction(instr, expr->id());
+ // The HSimulate for the store should not see the stored value in
+ // effect contexts (it is not materialized at expr->id() in the
+ // unoptimized code).
+ if (instr->HasObservableSideEffects()) {
+ if (ast_context()->IsEffect()) {
+ AddSimulate(expr->id(), REMOVABLE_SIMULATE);
+ } else {
+ Push(value);
+ AddSimulate(expr->id(), REMOVABLE_SIMULATE);
+ Drop(1);
+ }
+ }
+ return ast_context()->ReturnValue(value);
}
}
« no previous file with comments | « no previous file | src/lithium-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698