| OLD | NEW |
| 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/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
| 10 #include "src/ast/ast-numbering.h" | 10 #include "src/ast/ast-numbering.h" |
| (...skipping 5384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5395 FinishCurrentBlock( | 5395 FinishCurrentBlock( |
| 5396 New<HCompareObjectEqAndBranch>(enumerable_map, type, if_fast, if_slow)); | 5396 New<HCompareObjectEqAndBranch>(enumerable_map, type, if_fast, if_slow)); |
| 5397 set_current_block(if_fast); | 5397 set_current_block(if_fast); |
| 5398 { | 5398 { |
| 5399 // The enum cache for enumerable is still valid, no need to check key. | 5399 // The enum cache for enumerable is still valid, no need to check key. |
| 5400 Push(key); | 5400 Push(key); |
| 5401 Goto(if_join); | 5401 Goto(if_join); |
| 5402 } | 5402 } |
| 5403 set_current_block(if_slow); | 5403 set_current_block(if_slow); |
| 5404 { | 5404 { |
| 5405 // Check if key is still valid for enumerable. | 5405 ForInFilterStub stub(isolate()); |
| 5406 Add<HPushArguments>(enumerable, key); | 5406 HValue* values[] = {context(), key, enumerable}; |
| 5407 Runtime::FunctionId function_id = Runtime::kForInFilter; | 5407 HConstant* stub_value = Add<HConstant>(stub.GetCode()); |
| 5408 Push(Add<HCallRuntime>(Runtime::FunctionForId(function_id), 2)); | 5408 Push(Add<HCallWithDescriptor>(stub_value, 0, |
| 5409 stub.GetCallInterfaceDescriptor(), |
| 5410 ArrayVector(values))); |
| 5409 Add<HSimulate>(stmt->FilterId()); | 5411 Add<HSimulate>(stmt->FilterId()); |
| 5410 FinishCurrentBlock(New<HCompareObjectEqAndBranch>( | 5412 FinishCurrentBlock(New<HCompareObjectEqAndBranch>( |
| 5411 Top(), graph()->GetConstantUndefined(), if_slow_skip, if_slow_pass)); | 5413 Top(), graph()->GetConstantUndefined(), if_slow_skip, if_slow_pass)); |
| 5412 } | 5414 } |
| 5413 set_current_block(if_slow_pass); | 5415 set_current_block(if_slow_pass); |
| 5414 { Goto(if_join); } | 5416 { Goto(if_join); } |
| 5415 set_current_block(if_slow_skip); | 5417 set_current_block(if_slow_skip); |
| 5416 { | 5418 { |
| 5417 // The key is no longer valid for enumerable, skip it. | 5419 // The key is no longer valid for enumerable, skip it. |
| 5418 Drop(1); | 5420 Drop(1); |
| (...skipping 7996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13415 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13417 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13416 } | 13418 } |
| 13417 | 13419 |
| 13418 #ifdef DEBUG | 13420 #ifdef DEBUG |
| 13419 graph_->Verify(false); // No full verify. | 13421 graph_->Verify(false); // No full verify. |
| 13420 #endif | 13422 #endif |
| 13421 } | 13423 } |
| 13422 | 13424 |
| 13423 } // namespace internal | 13425 } // namespace internal |
| 13424 } // namespace v8 | 13426 } // namespace v8 |
| OLD | NEW |