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/mips64/lithium-codegen-mips64.h" | 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/crankshaft/hydrogen-osr.h" | 9 #include "src/crankshaft/hydrogen-osr.h" |
10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" | 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" |
(...skipping 2582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2593 Register reg = ToRegister(instr->parameter_count()); | 2593 Register reg = ToRegister(instr->parameter_count()); |
2594 // The argument count parameter is a smi | 2594 // The argument count parameter is a smi |
2595 __ SmiUntag(reg); | 2595 __ SmiUntag(reg); |
2596 __ Dlsa(sp, sp, reg, kPointerSizeLog2); | 2596 __ Dlsa(sp, sp, reg, kPointerSizeLog2); |
2597 } | 2597 } |
2598 | 2598 |
2599 __ Jump(ra); | 2599 __ Jump(ra); |
2600 } | 2600 } |
2601 | 2601 |
2602 | 2602 |
2603 template <class T> | |
2604 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | |
2605 Register vector_register = ToRegister(instr->temp_vector()); | |
2606 Register slot_register = LoadWithVectorDescriptor::SlotRegister(); | |
2607 DCHECK(vector_register.is(LoadWithVectorDescriptor::VectorRegister())); | |
2608 DCHECK(slot_register.is(a0)); | |
2609 | |
2610 AllowDeferredHandleDereference vector_structure_check; | |
2611 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | |
2612 __ li(vector_register, vector); | |
2613 // No need to allocate this register. | |
2614 FeedbackVectorSlot slot = instr->hydrogen()->slot(); | |
2615 int index = vector->GetIndex(slot); | |
2616 __ li(slot_register, Operand(Smi::FromInt(index))); | |
2617 } | |
2618 | |
2619 | |
2620 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2603 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2621 Register context = ToRegister(instr->context()); | 2604 Register context = ToRegister(instr->context()); |
2622 Register result = ToRegister(instr->result()); | 2605 Register result = ToRegister(instr->result()); |
2623 | 2606 |
2624 __ ld(result, ContextMemOperand(context, instr->slot_index())); | 2607 __ ld(result, ContextMemOperand(context, instr->slot_index())); |
2625 if (instr->hydrogen()->RequiresHoleCheck()) { | 2608 if (instr->hydrogen()->RequiresHoleCheck()) { |
2626 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 2609 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
2627 | 2610 |
2628 if (instr->hydrogen()->DeoptimizesOnHole()) { | 2611 if (instr->hydrogen()->DeoptimizesOnHole()) { |
2629 DeoptimizeIf(eq, instr, DeoptimizeReason::kHole, result, Operand(at)); | 2612 DeoptimizeIf(eq, instr, DeoptimizeReason::kHole, result, Operand(at)); |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3051 __ dsra32(scratch0(), key, 0); | 3034 __ dsra32(scratch0(), key, 0); |
3052 } else { | 3035 } else { |
3053 __ dsra(scratch0(), key, -shift_size); | 3036 __ dsra(scratch0(), key, -shift_size); |
3054 } | 3037 } |
3055 __ Daddu(scratch0(), base, scratch0()); | 3038 __ Daddu(scratch0(), base, scratch0()); |
3056 return MemOperand(scratch0(), base_offset); | 3039 return MemOperand(scratch0(), base_offset); |
3057 } | 3040 } |
3058 } | 3041 } |
3059 | 3042 |
3060 | 3043 |
3061 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | |
3062 DCHECK(ToRegister(instr->context()).is(cp)); | |
3063 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | |
3064 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | |
3065 | |
3066 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | |
3067 | |
3068 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code(); | |
3069 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
3070 } | |
3071 | |
3072 | |
3073 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3044 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3074 Register scratch = scratch0(); | 3045 Register scratch = scratch0(); |
3075 Register temp = scratch1(); | 3046 Register temp = scratch1(); |
3076 Register result = ToRegister(instr->result()); | 3047 Register result = ToRegister(instr->result()); |
3077 | 3048 |
3078 if (instr->hydrogen()->from_inlined()) { | 3049 if (instr->hydrogen()->from_inlined()) { |
3079 __ Dsubu(result, sp, 2 * kPointerSize); | 3050 __ Dsubu(result, sp, 2 * kPointerSize); |
3080 } else if (instr->hydrogen()->arguments_adaptor()) { | 3051 } else if (instr->hydrogen()->arguments_adaptor()) { |
3081 // Check if the calling frame is an arguments adaptor frame. | 3052 // Check if the calling frame is an arguments adaptor frame. |
3082 Label done, adapted; | 3053 Label done, adapted; |
(...skipping 2591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5674 __ ld(result, FieldMemOperand(scratch, | 5645 __ ld(result, FieldMemOperand(scratch, |
5675 FixedArray::kHeaderSize - kPointerSize)); | 5646 FixedArray::kHeaderSize - kPointerSize)); |
5676 __ bind(deferred->exit()); | 5647 __ bind(deferred->exit()); |
5677 __ bind(&done); | 5648 __ bind(&done); |
5678 } | 5649 } |
5679 | 5650 |
5680 #undef __ | 5651 #undef __ |
5681 | 5652 |
5682 } // namespace internal | 5653 } // namespace internal |
5683 } // namespace v8 | 5654 } // namespace v8 |
OLD | NEW |