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

Unified Diff: src/hydrogen.cc

Issue 9463052: When compiling for-in pass correct context value to the increment instruction. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 4908586f7c757c1654004bd1513930b694908d83..7267773c2682c7facf4359ed9c669ab0727deca2 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -3075,7 +3075,6 @@ void HGraphBuilder::PreProcessOsrEntry(IterationStatement* statement) {
}
}
-
AddSimulate(osr_entry_id);
AddInstruction(new(zone()) HOsrEntry(osr_entry_id));
HContext* context = new(zone()) HContext;
@@ -3256,10 +3255,8 @@ void HGraphBuilder::VisitForInStatement(ForInStatement* stmt) {
CHECK_ALIVE(VisitForValue(stmt->enumerable()));
HValue* enumerable = Top(); // Leave enumerable at the top.
- HValue* context = environment()->LookupContext();
-
HInstruction* map = AddInstruction(new(zone()) HForInPrepareMap(
- context, enumerable));
+ environment()->LookupContext(), enumerable));
AddSimulate(stmt->PrepareId());
HInstruction* array = AddInstruction(
@@ -3336,9 +3333,11 @@ void HGraphBuilder::VisitForInStatement(ForInStatement* stmt) {
set_current_block(body_exit);
HValue* current_index = Pop();
- PushAndAdd(
- new(zone()) HAdd(context, current_index, graph()->GetConstant1()));
-
+ HInstruction* new_index = new(zone()) HAdd(environment()->LookupContext(),
+ current_index,
+ graph()->GetConstant1());
+ new_index->AssumeRepresentation(Representation::Integer32());
+ PushAndAdd(new_index);
body_exit = current_block();
}

Powered by Google App Engine
This is Rietveld 408576698