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

Side by Side Diff: src/crankshaft/x87/lithium-codegen-x87.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/x64/lithium-x64.cc ('k') | src/crankshaft/x87/lithium-x87.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 #if V8_TARGET_ARCH_X87 5 #if V8_TARGET_ARCH_X87
6 6
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" 7 #include "src/crankshaft/x87/lithium-codegen-x87.h"
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 2641 matching lines...) Expand 10 before | Expand all | Expand 10 after
2652 } 2652 }
2653 if (NeedsEagerFrame()) { 2653 if (NeedsEagerFrame()) {
2654 __ mov(esp, ebp); 2654 __ mov(esp, ebp);
2655 __ pop(ebp); 2655 __ pop(ebp);
2656 } 2656 }
2657 2657
2658 EmitReturn(instr); 2658 EmitReturn(instr);
2659 } 2659 }
2660 2660
2661 2661
2662 template <class T>
2663 void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
2664 Register vector_register = ToRegister(instr->temp_vector());
2665 Register slot_register = LoadWithVectorDescriptor::SlotRegister();
2666 DCHECK(vector_register.is(LoadWithVectorDescriptor::VectorRegister()));
2667 DCHECK(slot_register.is(eax));
2668
2669 AllowDeferredHandleDereference vector_structure_check;
2670 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector();
2671 __ mov(vector_register, vector);
2672 // No need to allocate this register.
2673 FeedbackVectorSlot slot = instr->hydrogen()->slot();
2674 int index = vector->GetIndex(slot);
2675 __ mov(slot_register, Immediate(Smi::FromInt(index)));
2676 }
2677
2678
2679 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2662 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2680 Register context = ToRegister(instr->context()); 2663 Register context = ToRegister(instr->context());
2681 Register result = ToRegister(instr->result()); 2664 Register result = ToRegister(instr->result());
2682 __ mov(result, ContextOperand(context, instr->slot_index())); 2665 __ mov(result, ContextOperand(context, instr->slot_index()));
2683 2666
2684 if (instr->hydrogen()->RequiresHoleCheck()) { 2667 if (instr->hydrogen()->RequiresHoleCheck()) {
2685 __ cmp(result, factory()->the_hole_value()); 2668 __ cmp(result, factory()->the_hole_value());
2686 if (instr->hydrogen()->DeoptimizesOnHole()) { 2669 if (instr->hydrogen()->DeoptimizesOnHole()) {
2687 DeoptimizeIf(equal, instr, DeoptimizeReason::kHole); 2670 DeoptimizeIf(equal, instr, DeoptimizeReason::kHole);
2688 } else { 2671 } else {
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
2984 } 2967 }
2985 ScaleFactor scale_factor = static_cast<ScaleFactor>(shift_size); 2968 ScaleFactor scale_factor = static_cast<ScaleFactor>(shift_size);
2986 return Operand(elements_pointer_reg, 2969 return Operand(elements_pointer_reg,
2987 ToRegister(key), 2970 ToRegister(key),
2988 scale_factor, 2971 scale_factor,
2989 base_offset); 2972 base_offset);
2990 } 2973 }
2991 } 2974 }
2992 2975
2993 2976
2994 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
2995 DCHECK(ToRegister(instr->context()).is(esi));
2996 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
2997 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister()));
2998
2999 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
3000
3001 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code();
3002 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3003 }
3004
3005
3006 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { 2977 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
3007 Register result = ToRegister(instr->result()); 2978 Register result = ToRegister(instr->result());
3008 2979
3009 if (instr->hydrogen()->from_inlined()) { 2980 if (instr->hydrogen()->from_inlined()) {
3010 __ lea(result, Operand(esp, -2 * kPointerSize)); 2981 __ lea(result, Operand(esp, -2 * kPointerSize));
3011 } else if (instr->hydrogen()->arguments_adaptor()) { 2982 } else if (instr->hydrogen()->arguments_adaptor()) {
3012 // Check for arguments adapter frame. 2983 // Check for arguments adapter frame.
3013 Label done, adapted; 2984 Label done, adapted;
3014 __ mov(result, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); 2985 __ mov(result, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
3015 __ mov(result, 2986 __ mov(result,
(...skipping 2688 matching lines...) Expand 10 before | Expand all | Expand 10 after
5704 __ bind(deferred->exit()); 5675 __ bind(deferred->exit());
5705 __ bind(&done); 5676 __ bind(&done);
5706 } 5677 }
5707 5678
5708 #undef __ 5679 #undef __
5709 5680
5710 } // namespace internal 5681 } // namespace internal
5711 } // namespace v8 5682 } // namespace v8
5712 5683
5713 #endif // V8_TARGET_ARCH_X87 5684 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/crankshaft/x64/lithium-x64.cc ('k') | src/crankshaft/x87/lithium-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698