| 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 2598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2609 | 2609 |
| 2610 | 2610 |
| 2611 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2611 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
| 2612 DCHECK(ToRegister(instr->context()).is(rsi)); | 2612 DCHECK(ToRegister(instr->context()).is(rsi)); |
| 2613 DCHECK(ToRegister(instr->global_object()) | 2613 DCHECK(ToRegister(instr->global_object()) |
| 2614 .is(LoadDescriptor::ReceiverRegister())); | 2614 .is(LoadDescriptor::ReceiverRegister())); |
| 2615 DCHECK(ToRegister(instr->result()).is(rax)); | 2615 DCHECK(ToRegister(instr->result()).is(rax)); |
| 2616 | 2616 |
| 2617 __ Move(LoadDescriptor::NameRegister(), instr->name()); | 2617 __ Move(LoadDescriptor::NameRegister(), instr->name()); |
| 2618 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2618 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
| 2619 Handle<Code> ic = | 2619 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( |
| 2620 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), | 2620 isolate(), instr->typeof_mode(), PREMONOMORPHIC) |
| 2621 SLOPPY, PREMONOMORPHIC).code(); | 2621 .code(); |
| 2622 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2622 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2623 } | 2623 } |
| 2624 | 2624 |
| 2625 | 2625 |
| 2626 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2626 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| 2627 Register context = ToRegister(instr->context()); | 2627 Register context = ToRegister(instr->context()); |
| 2628 Register result = ToRegister(instr->result()); | 2628 Register result = ToRegister(instr->result()); |
| 2629 __ movp(result, ContextOperand(context, instr->slot_index())); | 2629 __ movp(result, ContextOperand(context, instr->slot_index())); |
| 2630 if (instr->hydrogen()->RequiresHoleCheck()) { | 2630 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2631 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | 2631 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2726 } | 2726 } |
| 2727 | 2727 |
| 2728 | 2728 |
| 2729 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 2729 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
| 2730 DCHECK(ToRegister(instr->context()).is(rsi)); | 2730 DCHECK(ToRegister(instr->context()).is(rsi)); |
| 2731 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 2731 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
| 2732 DCHECK(ToRegister(instr->result()).is(rax)); | 2732 DCHECK(ToRegister(instr->result()).is(rax)); |
| 2733 | 2733 |
| 2734 __ Move(LoadDescriptor::NameRegister(), instr->name()); | 2734 __ Move(LoadDescriptor::NameRegister(), instr->name()); |
| 2735 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 2735 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
| 2736 Handle<Code> ic = | 2736 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( |
| 2737 CodeFactory::LoadICInOptimizedCode( | 2737 isolate(), NOT_INSIDE_TYPEOF, |
| 2738 isolate(), NOT_INSIDE_TYPEOF, instr->hydrogen()->language_mode(), | 2738 instr->hydrogen()->initialization_state()) |
| 2739 instr->hydrogen()->initialization_state()).code(); | 2739 .code(); |
| 2740 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2740 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2741 } | 2741 } |
| 2742 | 2742 |
| 2743 | 2743 |
| 2744 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 2744 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
| 2745 Register function = ToRegister(instr->function()); | 2745 Register function = ToRegister(instr->function()); |
| 2746 Register result = ToRegister(instr->result()); | 2746 Register result = ToRegister(instr->result()); |
| 2747 | 2747 |
| 2748 // Get the prototype or initial map from the function. | 2748 // Get the prototype or initial map from the function. |
| 2749 __ movp(result, | 2749 __ movp(result, |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3018 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3018 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
| 3019 DCHECK(ToRegister(instr->context()).is(rsi)); | 3019 DCHECK(ToRegister(instr->context()).is(rsi)); |
| 3020 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3020 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
| 3021 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3021 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
| 3022 | 3022 |
| 3023 if (instr->hydrogen()->HasVectorAndSlot()) { | 3023 if (instr->hydrogen()->HasVectorAndSlot()) { |
| 3024 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3024 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
| 3025 } | 3025 } |
| 3026 | 3026 |
| 3027 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( | 3027 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( |
| 3028 isolate(), instr->hydrogen()->language_mode(), | 3028 isolate(), instr->hydrogen()->initialization_state()) |
| 3029 instr->hydrogen()->initialization_state()).code(); | 3029 .code(); |
| 3030 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3030 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3031 } | 3031 } |
| 3032 | 3032 |
| 3033 | 3033 |
| 3034 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3034 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
| 3035 Register result = ToRegister(instr->result()); | 3035 Register result = ToRegister(instr->result()); |
| 3036 | 3036 |
| 3037 if (instr->hydrogen()->from_inlined()) { | 3037 if (instr->hydrogen()->from_inlined()) { |
| 3038 __ leap(result, Operand(rsp, -kFPOnStackSize + -kPCOnStackSize)); | 3038 __ leap(result, Operand(rsp, -kFPOnStackSize + -kPCOnStackSize)); |
| 3039 } else { | 3039 } else { |
| (...skipping 2574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5614 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5614 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5615 } | 5615 } |
| 5616 | 5616 |
| 5617 | 5617 |
| 5618 #undef __ | 5618 #undef __ |
| 5619 | 5619 |
| 5620 } // namespace internal | 5620 } // namespace internal |
| 5621 } // namespace v8 | 5621 } // namespace v8 |
| 5622 | 5622 |
| 5623 #endif // V8_TARGET_ARCH_X64 | 5623 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |