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

Side by Side Diff: src/crankshaft/ia32/lithium-codegen-ia32.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/hydrogen-instructions.cc ('k') | src/crankshaft/ia32/lithium-ia32.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_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.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 2357 matching lines...) Expand 10 before | Expand all | Expand 10 after
2368 if (info()->saves_caller_doubles()) RestoreCallerDoubles(); 2368 if (info()->saves_caller_doubles()) RestoreCallerDoubles();
2369 if (NeedsEagerFrame()) { 2369 if (NeedsEagerFrame()) {
2370 __ mov(esp, ebp); 2370 __ mov(esp, ebp);
2371 __ pop(ebp); 2371 __ pop(ebp);
2372 } 2372 }
2373 2373
2374 EmitReturn(instr); 2374 EmitReturn(instr);
2375 } 2375 }
2376 2376
2377 2377
2378 template <class T>
2379 void LCodeGen::EmitVectorLoadICRegisters(T* instr) {
2380 Register vector_register = ToRegister(instr->temp_vector());
2381 Register slot_register = LoadWithVectorDescriptor::SlotRegister();
2382 DCHECK(vector_register.is(LoadWithVectorDescriptor::VectorRegister()));
2383 DCHECK(slot_register.is(eax));
2384
2385 AllowDeferredHandleDereference vector_structure_check;
2386 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector();
2387 __ mov(vector_register, vector);
2388 // No need to allocate this register.
2389 FeedbackVectorSlot slot = instr->hydrogen()->slot();
2390 int index = vector->GetIndex(slot);
2391 __ mov(slot_register, Immediate(Smi::FromInt(index)));
2392 }
2393
2394
2395 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2378 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2396 Register context = ToRegister(instr->context()); 2379 Register context = ToRegister(instr->context());
2397 Register result = ToRegister(instr->result()); 2380 Register result = ToRegister(instr->result());
2398 __ mov(result, ContextOperand(context, instr->slot_index())); 2381 __ mov(result, ContextOperand(context, instr->slot_index()));
2399 2382
2400 if (instr->hydrogen()->RequiresHoleCheck()) { 2383 if (instr->hydrogen()->RequiresHoleCheck()) {
2401 __ cmp(result, factory()->the_hole_value()); 2384 __ cmp(result, factory()->the_hole_value());
2402 if (instr->hydrogen()->DeoptimizesOnHole()) { 2385 if (instr->hydrogen()->DeoptimizesOnHole()) {
2403 DeoptimizeIf(equal, instr, DeoptimizeReason::kHole); 2386 DeoptimizeIf(equal, instr, DeoptimizeReason::kHole);
2404 } else { 2387 } else {
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
2709 } 2692 }
2710 ScaleFactor scale_factor = static_cast<ScaleFactor>(shift_size); 2693 ScaleFactor scale_factor = static_cast<ScaleFactor>(shift_size);
2711 return Operand(elements_pointer_reg, 2694 return Operand(elements_pointer_reg,
2712 ToRegister(key), 2695 ToRegister(key),
2713 scale_factor, 2696 scale_factor,
2714 base_offset); 2697 base_offset);
2715 } 2698 }
2716 } 2699 }
2717 2700
2718 2701
2719 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
2720 DCHECK(ToRegister(instr->context()).is(esi));
2721 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister()));
2722 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister()));
2723
2724 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr);
2725
2726 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code();
2727 CallCode(ic, RelocInfo::CODE_TARGET, instr);
2728 }
2729
2730
2731 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { 2702 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) {
2732 Register result = ToRegister(instr->result()); 2703 Register result = ToRegister(instr->result());
2733 2704
2734 if (instr->hydrogen()->from_inlined()) { 2705 if (instr->hydrogen()->from_inlined()) {
2735 __ lea(result, Operand(esp, -2 * kPointerSize)); 2706 __ lea(result, Operand(esp, -2 * kPointerSize));
2736 } else if (instr->hydrogen()->arguments_adaptor()) { 2707 } else if (instr->hydrogen()->arguments_adaptor()) {
2737 // Check for arguments adapter frame. 2708 // Check for arguments adapter frame.
2738 Label done, adapted; 2709 Label done, adapted;
2739 __ mov(result, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); 2710 __ mov(result, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
2740 __ mov(result, 2711 __ mov(result,
(...skipping 2472 matching lines...) Expand 10 before | Expand all | Expand 10 after
5213 __ bind(deferred->exit()); 5184 __ bind(deferred->exit());
5214 __ bind(&done); 5185 __ bind(&done);
5215 } 5186 }
5216 5187
5217 #undef __ 5188 #undef __
5218 5189
5219 } // namespace internal 5190 } // namespace internal
5220 } // namespace v8 5191 } // namespace v8
5221 5192
5222 #endif // V8_TARGET_ARCH_IA32 5193 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen-instructions.cc ('k') | src/crankshaft/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698