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

Side by Side Diff: src/crankshaft/arm/lithium-codegen-arm.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/arm/lithium-arm.cc ('k') | src/crankshaft/arm64/lithium-arm64.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 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 2561 matching lines...) Expand 10 before | Expand all | Expand 10 after
2572 // The argument count parameter is a smi 2572 // The argument count parameter is a smi
2573 __ SmiUntag(reg); 2573 __ SmiUntag(reg);
2574 __ add(sp, sp, Operand(reg, LSL, kPointerSizeLog2)); 2574 __ add(sp, sp, Operand(reg, LSL, kPointerSizeLog2));
2575 } 2575 }
2576 2576
2577 __ Jump(lr); 2577 __ Jump(lr);
2578 } 2578 }
2579 } 2579 }
2580 2580
2581 2581
2582 template <class T>
2583 void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
2584 Register vector_register = ToRegister(instr->temp_vector());
2585 Register slot_register = LoadDescriptor::SlotRegister();
2586 DCHECK(vector_register.is(LoadWithVectorDescriptor::VectorRegister()));
2587 DCHECK(slot_register.is(r0));
2588
2589 AllowDeferredHandleDereference vector_structure_check;
2590 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector();
2591 __ Move(vector_register, vector);
2592 // No need to allocate this register.
2593 FeedbackVectorSlot slot = instr->hydrogen()->slot();
2594 int index = vector->GetIndex(slot);
2595 __ mov(slot_register, Operand(Smi::FromInt(index)));
2596 }
2597
2598
2599 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2582 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2600 Register context = ToRegister(instr->context()); 2583 Register context = ToRegister(instr->context());
2601 Register result = ToRegister(instr->result()); 2584 Register result = ToRegister(instr->result());
2602 __ ldr(result, ContextMemOperand(context, instr->slot_index())); 2585 __ ldr(result, ContextMemOperand(context, instr->slot_index()));
2603 if (instr->hydrogen()->RequiresHoleCheck()) { 2586 if (instr->hydrogen()->RequiresHoleCheck()) {
2604 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); 2587 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
2605 __ cmp(result, ip); 2588 __ cmp(result, ip);
2606 if (instr->hydrogen()->DeoptimizesOnHole()) { 2589 if (instr->hydrogen()->DeoptimizesOnHole()) {
2607 DeoptimizeIf(eq, instr, DeoptimizeReason::kHole); 2590 DeoptimizeIf(eq, instr, DeoptimizeReason::kHole);
2608 } else { 2591 } else {
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
2955 __ add(scratch0(), base, Operand(key, LSL, shift_size)); 2938 __ add(scratch0(), base, Operand(key, LSL, shift_size));
2956 return MemOperand(scratch0(), base_offset); 2939 return MemOperand(scratch0(), base_offset);
2957 } else { 2940 } else {
2958 DCHECK_EQ(-1, shift_size); 2941 DCHECK_EQ(-1, shift_size);
2959 __ add(scratch0(), base, Operand(key, ASR, 1)); 2942 __ add(scratch0(), base, Operand(key, ASR, 1));
2960 return MemOperand(scratch0(), base_offset); 2943 return MemOperand(scratch0(), base_offset);
2961 } 2944 }
2962 } 2945 }
2963 2946
2964 2947
2965 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
2966 DCHECK(ToRegister(instr->context()).is(cp));
2967 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
2968 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister()));
2969
2970 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
2971
2972 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code();
2973 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS);
2974 }
2975
2976
2977 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { 2948 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
2978 Register scratch = scratch0(); 2949 Register scratch = scratch0();
2979 Register result = ToRegister(instr->result()); 2950 Register result = ToRegister(instr->result());
2980 2951
2981 if (instr->hydrogen()->from_inlined()) { 2952 if (instr->hydrogen()->from_inlined()) {
2982 __ sub(result, sp, Operand(2 * kPointerSize)); 2953 __ sub(result, sp, Operand(2 * kPointerSize));
2983 } else if (instr->hydrogen()->arguments_adaptor()) { 2954 } else if (instr->hydrogen()->arguments_adaptor()) {
2984 // Check if the calling frame is an arguments adaptor frame. 2955 // Check if the calling frame is an arguments adaptor frame.
2985 Label done, adapted; 2956 Label done, adapted;
2986 __ ldr(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 2957 __ ldr(scratch, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
(...skipping 2467 matching lines...) Expand 10 before | Expand all | Expand 10 after
5454 __ ldr(result, FieldMemOperand(scratch, 5425 __ ldr(result, FieldMemOperand(scratch,
5455 FixedArray::kHeaderSize - kPointerSize)); 5426 FixedArray::kHeaderSize - kPointerSize));
5456 __ bind(deferred->exit()); 5427 __ bind(deferred->exit());
5457 __ bind(&done); 5428 __ bind(&done);
5458 } 5429 }
5459 5430
5460 #undef __ 5431 #undef __
5461 5432
5462 } // namespace internal 5433 } // namespace internal
5463 } // namespace v8 5434 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/arm/lithium-arm.cc ('k') | src/crankshaft/arm64/lithium-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698