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

Side by Side Diff: src/hydrogen.cc

Issue 1160983004: [turbofan] First step towards sanitizing for-in and making it optimizable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add some comments. Created 5 years, 6 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
« no previous file with comments | « src/compiler/verifier.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 5183 matching lines...) Expand 10 before | Expand all | Expand 10 after
5194 HValue* key = 5194 HValue* key =
5195 Add<HLoadKeyed>(environment()->ExpressionStackAt(2), // Enum cache. 5195 Add<HLoadKeyed>(environment()->ExpressionStackAt(2), // Enum cache.
5196 index, index, FAST_ELEMENTS); 5196 index, index, FAST_ELEMENTS);
5197 5197
5198 if (fast) { 5198 if (fast) {
5199 // Check if the expected map still matches that of the enumerable. 5199 // Check if the expected map still matches that of the enumerable.
5200 // If not just deoptimize. 5200 // If not just deoptimize.
5201 Add<HCheckMapValue>(enumerable, environment()->ExpressionStackAt(3)); 5201 Add<HCheckMapValue>(enumerable, environment()->ExpressionStackAt(3));
5202 Bind(each_var, key); 5202 Bind(each_var, key);
5203 } else { 5203 } else {
5204 HValue* function = AddLoadJSBuiltin(Builtins::FILTER_KEY);
5205 Add<HPushArguments>(enumerable, key); 5204 Add<HPushArguments>(enumerable, key);
5206 key = Add<HInvokeFunction>(function, 2); 5205 Runtime::FunctionId function_id = Runtime::kForInFilter;
5206 key = Add<HCallRuntime>(isolate()->factory()->empty_string(),
5207 Runtime::FunctionForId(function_id), 2);
5207 Bind(each_var, key); 5208 Bind(each_var, key);
5208 Add<HSimulate>(stmt->AssignmentId()); 5209 Add<HSimulate>(stmt->AssignmentId());
5209 Add<HCheckHeapObject>(key); 5210 IfBuilder if_undefined(this);
5211 if_undefined.If<HCompareObjectEqAndBranch>(key,
5212 graph()->GetConstantUndefined());
5213 if_undefined.ThenDeopt(Deoptimizer::kUndefined);
5214 if_undefined.End();
5210 } 5215 }
5211 5216
5212 BreakAndContinueInfo break_info(stmt, scope(), 5); 5217 BreakAndContinueInfo break_info(stmt, scope(), 5);
5213 { 5218 {
5214 BreakAndContinueScope push(&break_info, this); 5219 BreakAndContinueScope push(&break_info, this);
5215 CHECK_BAILOUT(VisitLoopBody(stmt, loop_entry)); 5220 CHECK_BAILOUT(VisitLoopBody(stmt, loop_entry));
5216 } 5221 }
5217 5222
5218 HBasicBlock* body_exit = 5223 HBasicBlock* body_exit =
5219 JoinContinue(stmt, current_block(), break_info.continue_block()); 5224 JoinContinue(stmt, current_block(), break_info.continue_block());
(...skipping 7912 matching lines...) Expand 10 before | Expand all | Expand 10 after
13132 if (ShouldProduceTraceOutput()) { 13137 if (ShouldProduceTraceOutput()) {
13133 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13138 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13134 } 13139 }
13135 13140
13136 #ifdef DEBUG 13141 #ifdef DEBUG
13137 graph_->Verify(false); // No full verify. 13142 graph_->Verify(false); // No full verify.
13138 #endif 13143 #endif
13139 } 13144 }
13140 13145
13141 } } // namespace v8::internal 13146 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler/verifier.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698