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

Side by Side Diff: src/x87/code-stubs-x87.cc

Issue 2418513002: [stubs] Drop LoadICStub and LoadICTrampolineStub (the non-TurboFan implementations of LoadIC dispatc (Closed)
Patch Set: 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/x64/code-stubs-x64.cc ('k') | test/cctest/test-api.cc » ('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/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 2813 matching lines...) Expand 10 before | Expand all | Expand 10 after
2824 __ mov(ebx, MemOperand(ebp, parameter_count_offset)); 2824 __ mov(ebx, MemOperand(ebp, parameter_count_offset));
2825 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); 2825 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
2826 __ pop(ecx); 2826 __ pop(ecx);
2827 int additional_offset = 2827 int additional_offset =
2828 function_mode() == JS_FUNCTION_STUB_MODE ? kPointerSize : 0; 2828 function_mode() == JS_FUNCTION_STUB_MODE ? kPointerSize : 0;
2829 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset)); 2829 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset));
2830 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack. 2830 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack.
2831 } 2831 }
2832 2832
2833 2833
2834 void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
2835 __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
2836 LoadICStub stub(isolate());
2837 stub.GenerateForTrampoline(masm);
2838 }
2839
2840
2841 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { 2834 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
2842 __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister()); 2835 __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
2843 KeyedLoadICStub stub(isolate()); 2836 KeyedLoadICStub stub(isolate());
2844 stub.GenerateForTrampoline(masm); 2837 stub.GenerateForTrampoline(masm);
2845 } 2838 }
2846 2839
2847 2840
2848 static void HandleArrayCases(MacroAssembler* masm, Register receiver, 2841 static void HandleArrayCases(MacroAssembler* masm, Register receiver,
2849 Register key, Register vector, Register slot, 2842 Register key, Register vector, Register slot,
2850 Register feedback, bool is_polymorphic, 2843 Register feedback, bool is_polymorphic,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
2950 __ bind(&compare_smi_map); 2943 __ bind(&compare_smi_map);
2951 __ CompareRoot(ic_map, Heap::kHeapNumberMapRootIndex); 2944 __ CompareRoot(ic_map, Heap::kHeapNumberMapRootIndex);
2952 __ j(not_equal, miss); 2945 __ j(not_equal, miss);
2953 __ mov(handler, FieldOperand(vector, slot, times_half_pointer_size, 2946 __ mov(handler, FieldOperand(vector, slot, times_half_pointer_size,
2954 FixedArray::kHeaderSize + kPointerSize)); 2947 FixedArray::kHeaderSize + kPointerSize));
2955 __ lea(handler, FieldOperand(handler, Code::kHeaderSize)); 2948 __ lea(handler, FieldOperand(handler, Code::kHeaderSize));
2956 __ jmp(handler); 2949 __ jmp(handler);
2957 } 2950 }
2958 2951
2959 2952
2960 void LoadICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); }
2961
2962
2963 void LoadICStub::GenerateForTrampoline(MacroAssembler* masm) {
2964 GenerateImpl(masm, true);
2965 }
2966
2967
2968 void LoadICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
2969 Register receiver = LoadWithVectorDescriptor::ReceiverRegister(); // edx
2970 Register name = LoadWithVectorDescriptor::NameRegister(); // ecx
2971 Register vector = LoadWithVectorDescriptor::VectorRegister(); // ebx
2972 Register slot = LoadWithVectorDescriptor::SlotRegister(); // eax
2973 Register scratch = edi;
2974 __ mov(scratch, FieldOperand(vector, slot, times_half_pointer_size,
2975 FixedArray::kHeaderSize));
2976
2977 // Is it a weak cell?
2978 Label try_array;
2979 Label not_array, smi_key, key_okay, miss;
2980 __ CompareRoot(FieldOperand(scratch, 0), Heap::kWeakCellMapRootIndex);
2981 __ j(not_equal, &try_array);
2982 HandleMonomorphicCase(masm, receiver, name, vector, slot, scratch, &miss);
2983
2984 // Is it a fixed array?
2985 __ bind(&try_array);
2986 __ CompareRoot(FieldOperand(scratch, 0), Heap::kFixedArrayMapRootIndex);
2987 __ j(not_equal, &not_array);
2988 HandleArrayCases(masm, receiver, name, vector, slot, scratch, true, &miss);
2989
2990 __ bind(&not_array);
2991 __ CompareRoot(scratch, Heap::kmegamorphic_symbolRootIndex);
2992 __ j(not_equal, &miss);
2993 __ push(slot);
2994 __ push(vector);
2995 masm->isolate()->load_stub_cache()->GenerateProbe(masm, receiver, name,
2996 vector, scratch);
2997 __ pop(vector);
2998 __ pop(slot);
2999
3000 __ bind(&miss);
3001 LoadIC::GenerateMiss(masm);
3002 }
3003
3004
3005 void KeyedLoadICStub::Generate(MacroAssembler* masm) { 2953 void KeyedLoadICStub::Generate(MacroAssembler* masm) {
3006 GenerateImpl(masm, false); 2954 GenerateImpl(masm, false);
3007 } 2955 }
3008 2956
3009 2957
3010 void KeyedLoadICStub::GenerateForTrampoline(MacroAssembler* masm) { 2958 void KeyedLoadICStub::GenerateForTrampoline(MacroAssembler* masm) {
3011 GenerateImpl(masm, true); 2959 GenerateImpl(masm, true);
3012 } 2960 }
3013 2961
3014 2962
(...skipping 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after
4994 kStackUnwindSpace, nullptr, return_value_operand, 4942 kStackUnwindSpace, nullptr, return_value_operand,
4995 NULL); 4943 NULL);
4996 } 4944 }
4997 4945
4998 #undef __ 4946 #undef __
4999 4947
5000 } // namespace internal 4948 } // namespace internal
5001 } // namespace v8 4949 } // namespace v8
5002 4950
5003 #endif // V8_TARGET_ARCH_X87 4951 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698