| 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 5502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5513 DCHECK(!environment->HasBeenRegistered()); | 5513 DCHECK(!environment->HasBeenRegistered()); |
| 5514 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 5514 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
| 5515 | 5515 |
| 5516 GenerateOsrPrologue(); | 5516 GenerateOsrPrologue(); |
| 5517 } | 5517 } |
| 5518 | 5518 |
| 5519 | 5519 |
| 5520 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { | 5520 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { |
| 5521 DCHECK(ToRegister(instr->context()).is(rsi)); | 5521 DCHECK(ToRegister(instr->context()).is(rsi)); |
| 5522 | 5522 |
| 5523 Condition cc = masm()->CheckSmi(rax); | |
| 5524 DeoptimizeIf(cc, instr, Deoptimizer::kSmi); | |
| 5525 | |
| 5526 STATIC_ASSERT(JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); | |
| 5527 __ CmpObjectType(rax, JS_PROXY_TYPE, rcx); | |
| 5528 DeoptimizeIf(below_equal, instr, Deoptimizer::kWrongInstanceType); | |
| 5529 | |
| 5530 Label use_cache, call_runtime; | 5523 Label use_cache, call_runtime; |
| 5531 Register null_value = rdi; | 5524 __ CheckEnumCache(&call_runtime); |
| 5532 __ LoadRoot(null_value, Heap::kNullValueRootIndex); | |
| 5533 __ CheckEnumCache(null_value, &call_runtime); | |
| 5534 | 5525 |
| 5535 __ movp(rax, FieldOperand(rax, HeapObject::kMapOffset)); | 5526 __ movp(rax, FieldOperand(rax, HeapObject::kMapOffset)); |
| 5536 __ jmp(&use_cache, Label::kNear); | 5527 __ jmp(&use_cache, Label::kNear); |
| 5537 | 5528 |
| 5538 // Get the set of properties to enumerate. | 5529 // Get the set of properties to enumerate. |
| 5539 __ bind(&call_runtime); | 5530 __ bind(&call_runtime); |
| 5540 __ Push(rax); | 5531 __ Push(rax); |
| 5541 CallRuntime(Runtime::kGetPropertyNamesFast, instr); | 5532 CallRuntime(Runtime::kGetPropertyNamesFast, instr); |
| 5542 | |
| 5543 __ CompareRoot(FieldOperand(rax, HeapObject::kMapOffset), | |
| 5544 Heap::kMetaMapRootIndex); | |
| 5545 DeoptimizeIf(not_equal, instr, Deoptimizer::kWrongMap); | |
| 5546 __ bind(&use_cache); | 5533 __ bind(&use_cache); |
| 5547 } | 5534 } |
| 5548 | 5535 |
| 5549 | 5536 |
| 5550 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { | 5537 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { |
| 5551 Register map = ToRegister(instr->map()); | 5538 Register map = ToRegister(instr->map()); |
| 5552 Register result = ToRegister(instr->result()); | 5539 Register result = ToRegister(instr->result()); |
| 5553 Label load_cache, done; | 5540 Label load_cache, done; |
| 5554 __ EnumLength(result, map); | 5541 __ EnumLength(result, map); |
| 5555 __ Cmp(result, Smi::FromInt(0)); | 5542 __ Cmp(result, Smi::FromInt(0)); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5662 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5649 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5663 } | 5650 } |
| 5664 | 5651 |
| 5665 | 5652 |
| 5666 #undef __ | 5653 #undef __ |
| 5667 | 5654 |
| 5668 } // namespace internal | 5655 } // namespace internal |
| 5669 } // namespace v8 | 5656 } // namespace v8 |
| 5670 | 5657 |
| 5671 #endif // V8_TARGET_ARCH_X64 | 5658 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |