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

Side by Side Diff: src/hydrogen.cc

Issue 9571001: Introduce basic type feedback for for-in statements to avoid deopts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3256 matching lines...) Expand 10 before | Expand all | Expand 10 after
3267 3267
3268 void HGraphBuilder::VisitForInStatement(ForInStatement* stmt) { 3268 void HGraphBuilder::VisitForInStatement(ForInStatement* stmt) {
3269 ASSERT(!HasStackOverflow()); 3269 ASSERT(!HasStackOverflow());
3270 ASSERT(current_block() != NULL); 3270 ASSERT(current_block() != NULL);
3271 ASSERT(current_block()->HasPredecessor()); 3271 ASSERT(current_block()->HasPredecessor());
3272 3272
3273 if (!FLAG_optimize_for_in) { 3273 if (!FLAG_optimize_for_in) {
3274 return Bailout("ForInStatement optimization is disabled"); 3274 return Bailout("ForInStatement optimization is disabled");
3275 } 3275 }
3276 3276
3277 if (!oracle()->IsForInFastCase(stmt)) {
3278 return Bailout("ForInStatement is not fast case");
3279 }
3280
3277 if (!stmt->each()->IsVariableProxy() || 3281 if (!stmt->each()->IsVariableProxy() ||
3278 !stmt->each()->AsVariableProxy()->var()->IsStackLocal()) { 3282 !stmt->each()->AsVariableProxy()->var()->IsStackLocal()) {
3279 return Bailout("ForInStatement with non-local each variable"); 3283 return Bailout("ForInStatement with non-local each variable");
3280 } 3284 }
3281 3285
3282 Variable* each_var = stmt->each()->AsVariableProxy()->var(); 3286 Variable* each_var = stmt->each()->AsVariableProxy()->var();
3283 3287
3284 CHECK_ALIVE(VisitForValue(stmt->enumerable())); 3288 CHECK_ALIVE(VisitForValue(stmt->enumerable()));
3285 HValue* enumerable = Top(); // Leave enumerable at the top. 3289 HValue* enumerable = Top(); // Leave enumerable at the top.
3286 3290
(...skipping 4751 matching lines...) Expand 10 before | Expand all | Expand 10 after
8038 } 8042 }
8039 } 8043 }
8040 8044
8041 #ifdef DEBUG 8045 #ifdef DEBUG
8042 if (graph_ != NULL) graph_->Verify(false); // No full verify. 8046 if (graph_ != NULL) graph_->Verify(false); // No full verify.
8043 if (allocator_ != NULL) allocator_->Verify(); 8047 if (allocator_ != NULL) allocator_->Verify();
8044 #endif 8048 #endif
8045 } 8049 }
8046 8050
8047 } } // namespace v8::internal 8051 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698