OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/arm/lithium-codegen-arm.h" | 5 #include "src/crankshaft/arm/lithium-codegen-arm.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" | 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" |
(...skipping 2611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2622 | 2622 |
2623 | 2623 |
2624 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2624 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
2625 DCHECK(ToRegister(instr->context()).is(cp)); | 2625 DCHECK(ToRegister(instr->context()).is(cp)); |
2626 DCHECK(ToRegister(instr->global_object()) | 2626 DCHECK(ToRegister(instr->global_object()) |
2627 .is(LoadDescriptor::ReceiverRegister())); | 2627 .is(LoadDescriptor::ReceiverRegister())); |
2628 DCHECK(ToRegister(instr->result()).is(r0)); | 2628 DCHECK(ToRegister(instr->result()).is(r0)); |
2629 | 2629 |
2630 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2630 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2631 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2631 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2632 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( | 2632 Handle<Code> ic = |
2633 isolate(), instr->typeof_mode(), PREMONOMORPHIC) | 2633 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode()) |
2634 .code(); | 2634 .code(); |
2635 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2635 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2636 } | 2636 } |
2637 | 2637 |
2638 | 2638 |
2639 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2639 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2640 Register context = ToRegister(instr->context()); | 2640 Register context = ToRegister(instr->context()); |
2641 Register result = ToRegister(instr->result()); | 2641 Register result = ToRegister(instr->result()); |
2642 __ ldr(result, ContextMemOperand(context, instr->slot_index())); | 2642 __ ldr(result, ContextMemOperand(context, instr->slot_index())); |
2643 if (instr->hydrogen()->RequiresHoleCheck()) { | 2643 if (instr->hydrogen()->RequiresHoleCheck()) { |
2644 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 2644 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2719 | 2719 |
2720 | 2720 |
2721 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 2721 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
2722 DCHECK(ToRegister(instr->context()).is(cp)); | 2722 DCHECK(ToRegister(instr->context()).is(cp)); |
2723 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 2723 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
2724 DCHECK(ToRegister(instr->result()).is(r0)); | 2724 DCHECK(ToRegister(instr->result()).is(r0)); |
2725 | 2725 |
2726 // Name is always in r2. | 2726 // Name is always in r2. |
2727 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2727 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2728 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 2728 EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
2729 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode( | 2729 Handle<Code> ic = |
2730 isolate(), NOT_INSIDE_TYPEOF, | 2730 CodeFactory::LoadICInOptimizedCode(isolate(), NOT_INSIDE_TYPEOF).code(); |
2731 instr->hydrogen()->initialization_state()) | |
2732 .code(); | |
2733 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 2731 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
2734 } | 2732 } |
2735 | 2733 |
2736 | 2734 |
2737 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 2735 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { |
2738 Register scratch = scratch0(); | 2736 Register scratch = scratch0(); |
2739 Register function = ToRegister(instr->function()); | 2737 Register function = ToRegister(instr->function()); |
2740 Register result = ToRegister(instr->result()); | 2738 Register result = ToRegister(instr->result()); |
2741 | 2739 |
2742 // Get the prototype or initial map from the function. | 2740 // Get the prototype or initial map from the function. |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3016 return MemOperand(scratch0(), base_offset); | 3014 return MemOperand(scratch0(), base_offset); |
3017 } | 3015 } |
3018 } | 3016 } |
3019 | 3017 |
3020 | 3018 |
3021 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3019 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3022 DCHECK(ToRegister(instr->context()).is(cp)); | 3020 DCHECK(ToRegister(instr->context()).is(cp)); |
3023 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3021 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3024 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3022 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3025 | 3023 |
3026 if (instr->hydrogen()->HasVectorAndSlot()) { | 3024 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
3027 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | |
3028 } | |
3029 | 3025 |
3030 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode( | 3026 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code(); |
3031 isolate(), instr->hydrogen()->initialization_state()) | |
3032 .code(); | |
3033 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 3027 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
3034 } | 3028 } |
3035 | 3029 |
3036 | 3030 |
3037 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3031 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3038 Register scratch = scratch0(); | 3032 Register scratch = scratch0(); |
3039 Register result = ToRegister(instr->result()); | 3033 Register result = ToRegister(instr->result()); |
3040 | 3034 |
3041 if (instr->hydrogen()->from_inlined()) { | 3035 if (instr->hydrogen()->from_inlined()) { |
3042 __ sub(result, sp, Operand(2 * kPointerSize)); | 3036 __ sub(result, sp, Operand(2 * kPointerSize)); |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3869 } | 3863 } |
3870 } | 3864 } |
3871 } | 3865 } |
3872 | 3866 |
3873 | 3867 |
3874 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 3868 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
3875 DCHECK(ToRegister(instr->context()).is(cp)); | 3869 DCHECK(ToRegister(instr->context()).is(cp)); |
3876 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 3870 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
3877 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 3871 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
3878 | 3872 |
3879 if (instr->hydrogen()->HasVectorAndSlot()) { | 3873 EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr); |
3880 EmitVectorStoreICRegisters<LStoreNamedGeneric>(instr); | |
3881 } | |
3882 | 3874 |
3883 __ mov(StoreDescriptor::NameRegister(), Operand(instr->name())); | 3875 __ mov(StoreDescriptor::NameRegister(), Operand(instr->name())); |
3884 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( | 3876 Handle<Code> ic = |
3885 isolate(), instr->language_mode(), | 3877 CodeFactory::StoreICInOptimizedCode(isolate(), instr->language_mode()) |
3886 instr->hydrogen()->initialization_state()).code(); | 3878 .code(); |
3887 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 3879 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
3888 } | 3880 } |
3889 | 3881 |
3890 | 3882 |
3891 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 3883 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
3892 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 3884 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; |
3893 if (instr->index()->IsConstantOperand()) { | 3885 if (instr->index()->IsConstantOperand()) { |
3894 Operand index = ToOperand(instr->index()); | 3886 Operand index = ToOperand(instr->index()); |
3895 Register length = ToRegister(instr->length()); | 3887 Register length = ToRegister(instr->length()); |
3896 __ cmp(length, index); | 3888 __ cmp(length, index); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4083 } | 4075 } |
4084 } | 4076 } |
4085 | 4077 |
4086 | 4078 |
4087 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 4079 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
4088 DCHECK(ToRegister(instr->context()).is(cp)); | 4080 DCHECK(ToRegister(instr->context()).is(cp)); |
4089 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 4081 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4090 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); | 4082 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); |
4091 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 4083 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4092 | 4084 |
4093 if (instr->hydrogen()->HasVectorAndSlot()) { | 4085 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr); |
4094 EmitVectorStoreICRegisters<LStoreKeyedGeneric>(instr); | |
4095 } | |
4096 | 4086 |
4097 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( | 4087 Handle<Code> ic = CodeFactory::KeyedStoreICInOptimizedCode( |
4098 isolate(), instr->language_mode(), | 4088 isolate(), instr->language_mode()) |
4099 instr->hydrogen()->initialization_state()).code(); | 4089 .code(); |
4100 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 4090 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
4101 } | 4091 } |
4102 | 4092 |
4103 | 4093 |
4104 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { | 4094 void LCodeGen::DoMaybeGrowElements(LMaybeGrowElements* instr) { |
4105 class DeferredMaybeGrowElements final : public LDeferredCode { | 4095 class DeferredMaybeGrowElements final : public LDeferredCode { |
4106 public: | 4096 public: |
4107 DeferredMaybeGrowElements(LCodeGen* codegen, LMaybeGrowElements* instr) | 4097 DeferredMaybeGrowElements(LCodeGen* codegen, LMaybeGrowElements* instr) |
4108 : LDeferredCode(codegen), instr_(instr) {} | 4098 : LDeferredCode(codegen), instr_(instr) {} |
4109 void Generate() override { codegen()->DoDeferredMaybeGrowElements(instr_); } | 4099 void Generate() override { codegen()->DoDeferredMaybeGrowElements(instr_); } |
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5570 __ ldr(result, FieldMemOperand(scratch, | 5560 __ ldr(result, FieldMemOperand(scratch, |
5571 FixedArray::kHeaderSize - kPointerSize)); | 5561 FixedArray::kHeaderSize - kPointerSize)); |
5572 __ bind(deferred->exit()); | 5562 __ bind(deferred->exit()); |
5573 __ bind(&done); | 5563 __ bind(&done); |
5574 } | 5564 } |
5575 | 5565 |
5576 #undef __ | 5566 #undef __ |
5577 | 5567 |
5578 } // namespace internal | 5568 } // namespace internal |
5579 } // namespace v8 | 5569 } // namespace v8 |
OLD | NEW |