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

Side by Side Diff: src/ia32/code-stubs-ia32.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/flag-definitions.h ('k') | src/mips/code-stubs-mips.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_IA32 5 #if V8_TARGET_ARCH_IA32
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 3001 matching lines...) Expand 10 before | Expand all | Expand 10 after
3012 __ mov(ebx, MemOperand(ebp, parameter_count_offset)); 3012 __ mov(ebx, MemOperand(ebp, parameter_count_offset));
3013 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); 3013 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
3014 __ pop(ecx); 3014 __ pop(ecx);
3015 int additional_offset = 3015 int additional_offset =
3016 function_mode() == JS_FUNCTION_STUB_MODE ? kPointerSize : 0; 3016 function_mode() == JS_FUNCTION_STUB_MODE ? kPointerSize : 0;
3017 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset)); 3017 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset));
3018 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack. 3018 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack.
3019 } 3019 }
3020 3020
3021 3021
3022 void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
3023 __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
3024 LoadICStub stub(isolate());
3025 stub.GenerateForTrampoline(masm);
3026 }
3027
3028
3029 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { 3022 void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
3030 __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister()); 3023 __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
3031 KeyedLoadICStub stub(isolate()); 3024 KeyedLoadICStub stub(isolate());
3032 stub.GenerateForTrampoline(masm); 3025 stub.GenerateForTrampoline(masm);
3033 } 3026 }
3034 3027
3035 3028
3036 static void HandleArrayCases(MacroAssembler* masm, Register receiver, 3029 static void HandleArrayCases(MacroAssembler* masm, Register receiver,
3037 Register key, Register vector, Register slot, 3030 Register key, Register vector, Register slot,
3038 Register feedback, bool is_polymorphic, 3031 Register feedback, bool is_polymorphic,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
3138 __ bind(&compare_smi_map); 3131 __ bind(&compare_smi_map);
3139 __ CompareRoot(ic_map, Heap::kHeapNumberMapRootIndex); 3132 __ CompareRoot(ic_map, Heap::kHeapNumberMapRootIndex);
3140 __ j(not_equal, miss); 3133 __ j(not_equal, miss);
3141 __ mov(handler, FieldOperand(vector, slot, times_half_pointer_size, 3134 __ mov(handler, FieldOperand(vector, slot, times_half_pointer_size,
3142 FixedArray::kHeaderSize + kPointerSize)); 3135 FixedArray::kHeaderSize + kPointerSize));
3143 __ lea(handler, FieldOperand(handler, Code::kHeaderSize)); 3136 __ lea(handler, FieldOperand(handler, Code::kHeaderSize));
3144 __ jmp(handler); 3137 __ jmp(handler);
3145 } 3138 }
3146 3139
3147 3140
3148 void LoadICStub::Generate(MacroAssembler* masm) { GenerateImpl(masm, false); }
3149
3150
3151 void LoadICStub::GenerateForTrampoline(MacroAssembler* masm) {
3152 GenerateImpl(masm, true);
3153 }
3154
3155
3156 void LoadICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
3157 Register receiver = LoadWithVectorDescriptor::ReceiverRegister(); // edx
3158 Register name = LoadWithVectorDescriptor::NameRegister(); // ecx
3159 Register vector = LoadWithVectorDescriptor::VectorRegister(); // ebx
3160 Register slot = LoadWithVectorDescriptor::SlotRegister(); // eax
3161 Register scratch = edi;
3162 __ mov(scratch, FieldOperand(vector, slot, times_half_pointer_size,
3163 FixedArray::kHeaderSize));
3164
3165 // Is it a weak cell?
3166 Label try_array;
3167 Label not_array, smi_key, key_okay, miss;
3168 __ CompareRoot(FieldOperand(scratch, 0), Heap::kWeakCellMapRootIndex);
3169 __ j(not_equal, &try_array);
3170 HandleMonomorphicCase(masm, receiver, name, vector, slot, scratch, &miss);
3171
3172 // Is it a fixed array?
3173 __ bind(&try_array);
3174 __ CompareRoot(FieldOperand(scratch, 0), Heap::kFixedArrayMapRootIndex);
3175 __ j(not_equal, &not_array);
3176 HandleArrayCases(masm, receiver, name, vector, slot, scratch, true, &miss);
3177
3178 __ bind(&not_array);
3179 __ CompareRoot(scratch, Heap::kmegamorphic_symbolRootIndex);
3180 __ j(not_equal, &miss);
3181 __ push(slot);
3182 __ push(vector);
3183 masm->isolate()->load_stub_cache()->GenerateProbe(masm, receiver, name,
3184 vector, scratch);
3185 __ pop(vector);
3186 __ pop(slot);
3187
3188 __ bind(&miss);
3189 LoadIC::GenerateMiss(masm);
3190 }
3191
3192
3193 void KeyedLoadICStub::Generate(MacroAssembler* masm) { 3141 void KeyedLoadICStub::Generate(MacroAssembler* masm) {
3194 GenerateImpl(masm, false); 3142 GenerateImpl(masm, false);
3195 } 3143 }
3196 3144
3197 3145
3198 void KeyedLoadICStub::GenerateForTrampoline(MacroAssembler* masm) { 3146 void KeyedLoadICStub::GenerateForTrampoline(MacroAssembler* masm) {
3199 GenerateImpl(masm, true); 3147 GenerateImpl(masm, true);
3200 } 3148 }
3201 3149
3202 3150
(...skipping 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after
5203 kStackUnwindSpace, nullptr, return_value_operand, 5151 kStackUnwindSpace, nullptr, return_value_operand,
5204 NULL); 5152 NULL);
5205 } 5153 }
5206 5154
5207 #undef __ 5155 #undef __
5208 5156
5209 } // namespace internal 5157 } // namespace internal
5210 } // namespace v8 5158 } // namespace v8
5211 5159
5212 #endif // V8_TARGET_ARCH_IA32 5160 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698