Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/crankshaft/s390/lithium-codegen-s390.cc

Issue 2391043005: [crankshaft] Remove HLoadKeyedGeneric and use HCallWithDescriptor to call KeyedLoadIC. (Closed)
Patch Set: Rebasing Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/crankshaft/ppc/lithium-ppc.cc ('k') | src/crankshaft/s390/lithium-s390.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // 2 //
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 #include "src/crankshaft/s390/lithium-codegen-s390.h" 6 #include "src/crankshaft/s390/lithium-codegen-s390.h"
7 7
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2612 matching lines...) Expand 10 before | Expand all | Expand 10 after
2623 if (NeedsEagerFrame()) { 2623 if (NeedsEagerFrame()) {
2624 masm_->LeaveFrame(StackFrame::JAVA_SCRIPT); 2624 masm_->LeaveFrame(StackFrame::JAVA_SCRIPT);
2625 } 2625 }
2626 __ SmiToPtrArrayOffset(r0, reg); 2626 __ SmiToPtrArrayOffset(r0, reg);
2627 __ AddP(sp, sp, r0); 2627 __ AddP(sp, sp, r0);
2628 } 2628 }
2629 2629
2630 __ Ret(); 2630 __ Ret();
2631 } 2631 }
2632 2632
2633 template <class T>
2634 void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
2635 Register vector_register = ToRegister(instr->temp_vector());
2636 Register slot_register = LoadDescriptor::SlotRegister();
2637 DCHECK(vector_register.is(LoadWithVectorDescriptor::VectorRegister()));
2638 DCHECK(slot_register.is(r2));
2639
2640 AllowDeferredHandleDereference vector_structure_check;
2641 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector();
2642 __ Move(vector_register, vector);
2643 // No need to allocate this register.
2644 FeedbackVectorSlot slot = instr->hydrogen()->slot();
2645 int index = vector->GetIndex(slot);
2646 __ LoadSmiLiteral(slot_register, Smi::FromInt(index));
2647 }
2648
2649 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2633 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2650 Register context = ToRegister(instr->context()); 2634 Register context = ToRegister(instr->context());
2651 Register result = ToRegister(instr->result()); 2635 Register result = ToRegister(instr->result());
2652 __ LoadP(result, ContextMemOperand(context, instr->slot_index())); 2636 __ LoadP(result, ContextMemOperand(context, instr->slot_index()));
2653 if (instr->hydrogen()->RequiresHoleCheck()) { 2637 if (instr->hydrogen()->RequiresHoleCheck()) {
2654 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); 2638 __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
2655 if (instr->hydrogen()->DeoptimizesOnHole()) { 2639 if (instr->hydrogen()->DeoptimizesOnHole()) {
2656 DeoptimizeIf(eq, instr, DeoptimizeReason::kHole); 2640 DeoptimizeIf(eq, instr, DeoptimizeReason::kHole);
2657 } else { 2641 } else {
2658 Label skip; 2642 Label skip;
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
3074 scratch = key; 3058 scratch = key;
3075 } 3059 }
3076 3060
3077 if (!is_int20(base_offset)) { 3061 if (!is_int20(base_offset)) {
3078 __ AddP(scratch, Operand(base_offset)); 3062 __ AddP(scratch, Operand(base_offset));
3079 base_offset = 0; 3063 base_offset = 0;
3080 } 3064 }
3081 return MemOperand(scratch, base, base_offset); 3065 return MemOperand(scratch, base, base_offset);
3082 } 3066 }
3083 3067
3084 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
3085 DCHECK(ToRegister(instr->context()).is(cp));
3086 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
3087 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister()));
3088 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
3089
3090 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code();
3091 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3092 }
3093
3094 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { 3068 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
3095 Register scratch = scratch0(); 3069 Register scratch = scratch0();
3096 Register result = ToRegister(instr->result()); 3070 Register result = ToRegister(instr->result());
3097 3071
3098 if (instr->hydrogen()->from_inlined()) { 3072 if (instr->hydrogen()->from_inlined()) {
3099 __ lay(result, MemOperand(sp, -2 * kPointerSize)); 3073 __ lay(result, MemOperand(sp, -2 * kPointerSize));
3100 } else if (instr->hydrogen()->arguments_adaptor()) { 3074 } else if (instr->hydrogen()->arguments_adaptor()) {
3101 // Check if the calling frame is an arguments adaptor frame. 3075 // Check if the calling frame is an arguments adaptor frame.
3102 Label done, adapted; 3076 Label done, adapted;
3103 __ LoadP(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 3077 __ LoadP(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
(...skipping 2497 matching lines...) Expand 10 before | Expand all | Expand 10 after
5601 __ LoadP(result, 5575 __ LoadP(result,
5602 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); 5576 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize));
5603 __ bind(deferred->exit()); 5577 __ bind(deferred->exit());
5604 __ bind(&done); 5578 __ bind(&done);
5605 } 5579 }
5606 5580
5607 #undef __ 5581 #undef __
5608 5582
5609 } // namespace internal 5583 } // namespace internal
5610 } // namespace v8 5584 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/ppc/lithium-ppc.cc ('k') | src/crankshaft/s390/lithium-s390.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698