| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.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/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
| (...skipping 2636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2647 masm_->LeaveFrame(StackFrame::JAVA_SCRIPT); | 2647 masm_->LeaveFrame(StackFrame::JAVA_SCRIPT); |
| 2648 } | 2648 } |
| 2649 __ SmiToPtrArrayOffset(r0, reg); | 2649 __ SmiToPtrArrayOffset(r0, reg); |
| 2650 __ add(sp, sp, r0); | 2650 __ add(sp, sp, r0); |
| 2651 } | 2651 } |
| 2652 | 2652 |
| 2653 __ blr(); | 2653 __ blr(); |
| 2654 } | 2654 } |
| 2655 | 2655 |
| 2656 | 2656 |
| 2657 template <class T> | |
| 2658 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | |
| 2659 Register vector_register = ToRegister(instr->temp_vector()); | |
| 2660 Register slot_register = LoadDescriptor::SlotRegister(); | |
| 2661 DCHECK(vector_register.is(LoadWithVectorDescriptor::VectorRegister())); | |
| 2662 DCHECK(slot_register.is(r3)); | |
| 2663 | |
| 2664 AllowDeferredHandleDereference vector_structure_check; | |
| 2665 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | |
| 2666 __ Move(vector_register, vector); | |
| 2667 // No need to allocate this register. | |
| 2668 FeedbackVectorSlot slot = instr->hydrogen()->slot(); | |
| 2669 int index = vector->GetIndex(slot); | |
| 2670 __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); | |
| 2671 } | |
| 2672 | |
| 2673 | |
| 2674 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2657 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| 2675 Register context = ToRegister(instr->context()); | 2658 Register context = ToRegister(instr->context()); |
| 2676 Register result = ToRegister(instr->result()); | 2659 Register result = ToRegister(instr->result()); |
| 2677 __ LoadP(result, ContextMemOperand(context, instr->slot_index())); | 2660 __ LoadP(result, ContextMemOperand(context, instr->slot_index())); |
| 2678 if (instr->hydrogen()->RequiresHoleCheck()) { | 2661 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2679 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 2662 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| 2680 if (instr->hydrogen()->DeoptimizesOnHole()) { | 2663 if (instr->hydrogen()->DeoptimizesOnHole()) { |
| 2681 __ cmp(result, ip); | 2664 __ cmp(result, ip); |
| 2682 DeoptimizeIf(eq, instr, DeoptimizeReason::kHole); | 2665 DeoptimizeIf(eq, instr, DeoptimizeReason::kHole); |
| 2683 } else { | 2666 } else { |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3115 } | 3098 } |
| 3116 | 3099 |
| 3117 if (base_offset) { | 3100 if (base_offset) { |
| 3118 __ Add(scratch, key, base_offset, r0); | 3101 __ Add(scratch, key, base_offset, r0); |
| 3119 } | 3102 } |
| 3120 | 3103 |
| 3121 return MemOperand(base, scratch); | 3104 return MemOperand(base, scratch); |
| 3122 } | 3105 } |
| 3123 | 3106 |
| 3124 | 3107 |
| 3125 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | |
| 3126 DCHECK(ToRegister(instr->context()).is(cp)); | |
| 3127 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | |
| 3128 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | |
| 3129 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | |
| 3130 | |
| 3131 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code(); | |
| 3132 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
| 3133 } | |
| 3134 | |
| 3135 | |
| 3136 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 3108 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
| 3137 Register scratch = scratch0(); | 3109 Register scratch = scratch0(); |
| 3138 Register result = ToRegister(instr->result()); | 3110 Register result = ToRegister(instr->result()); |
| 3139 | 3111 |
| 3140 if (instr->hydrogen()->from_inlined()) { | 3112 if (instr->hydrogen()->from_inlined()) { |
| 3141 __ subi(result, sp, Operand(2 * kPointerSize)); | 3113 __ subi(result, sp, Operand(2 * kPointerSize)); |
| 3142 } else if (instr->hydrogen()->arguments_adaptor()) { | 3114 } else if (instr->hydrogen()->arguments_adaptor()) { |
| 3143 // Check if the calling frame is an arguments adaptor frame. | 3115 // Check if the calling frame is an arguments adaptor frame. |
| 3144 __ LoadP(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 3116 __ LoadP(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 3145 __ LoadP( | 3117 __ LoadP( |
| (...skipping 2561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5707 __ LoadP(result, | 5679 __ LoadP(result, |
| 5708 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5680 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
| 5709 __ bind(deferred->exit()); | 5681 __ bind(deferred->exit()); |
| 5710 __ bind(&done); | 5682 __ bind(&done); |
| 5711 } | 5683 } |
| 5712 | 5684 |
| 5713 #undef __ | 5685 #undef __ |
| 5714 | 5686 |
| 5715 } // namespace internal | 5687 } // namespace internal |
| 5716 } // namespace v8 | 5688 } // namespace v8 |
| OLD | NEW |