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

Side by Side Diff: src/ic/ia32/handler-compiler-ia32.cc

Issue 1748123003: Rework CallApi*Stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Minor fixes and make Win compiler happy. Created 4 years, 9 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/ic/handler-compiler.h" 7 #include "src/ic/handler-compiler.h"
8 8
9 #include "src/field-type.h" 9 #include "src/field-type.h"
10 #include "src/ic/call-optimization.h" 10 #include "src/ic/call-optimization.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 // Write the arguments to stack frame. 154 // Write the arguments to stack frame.
155 if (is_store) { 155 if (is_store) {
156 DCHECK(!receiver.is(store_parameter)); 156 DCHECK(!receiver.is(store_parameter));
157 DCHECK(!scratch.is(store_parameter)); 157 DCHECK(!scratch.is(store_parameter));
158 __ push(store_parameter); 158 __ push(store_parameter);
159 } 159 }
160 __ push(scratch); 160 __ push(scratch);
161 // Stack now matches JSFunction abi. 161 // Stack now matches JSFunction abi.
162 DCHECK(optimization.is_simple_api_call()); 162 DCHECK(optimization.is_simple_api_call());
163 163
164 // Abi for CallApiFunctionStub. 164 // Abi for CallApiCallbackStub.
165 Register callee = edi; 165 Register callee = edi;
166 Register data = ebx; 166 Register data = ebx;
167 Register holder = ecx; 167 Register holder = ecx;
168 Register api_function_address = edx; 168 Register api_function_address = edx;
169 scratch = no_reg; 169 scratch = no_reg;
170 170
171 // Put callee in place. 171 // Put callee in place.
172 __ LoadAccessor(callee, accessor_holder, accessor_index, 172 __ LoadAccessor(callee, accessor_holder, accessor_index,
173 is_store ? ACCESSOR_SETTER : ACCESSOR_GETTER); 173 is_store ? ACCESSOR_SETTER : ACCESSOR_GETTER);
174 174
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // Just tail call into the code. 216 // Just tail call into the code.
217 __ Jump(handle(Code::cast(api_call_info->fast_handler())), 217 __ Jump(handle(Code::cast(api_call_info->fast_handler())),
218 RelocInfo::CODE_TARGET); 218 RelocInfo::CODE_TARGET);
219 return; 219 return;
220 } 220 }
221 // Put api_function_address in place. 221 // Put api_function_address in place.
222 Address function_address = v8::ToCData<Address>(api_call_info->callback()); 222 Address function_address = v8::ToCData<Address>(api_call_info->callback());
223 __ mov(api_function_address, Immediate(function_address)); 223 __ mov(api_function_address, Immediate(function_address));
224 224
225 // Jump to stub. 225 // Jump to stub.
226 CallApiAccessorStub stub(isolate, is_store, call_data_undefined, 226 CallApiCallbackStub stub(isolate, is_store, call_data_undefined,
227 !optimization.is_constant_call()); 227 !optimization.is_constant_call());
228 __ TailCallStub(&stub); 228 __ TailCallStub(&stub);
229 } 229 }
230 230
231 231
232 // Generate code to check that a global property cell is empty. Create 232 // Generate code to check that a global property cell is empty. Create
233 // the property cell at compilation time if no cell exists for the 233 // the property cell at compilation time if no cell exists for the
234 // property. 234 // property.
235 void PropertyHandlerCompiler::GenerateCheckPropertyCell( 235 void PropertyHandlerCompiler::GenerateCheckPropertyCell(
236 MacroAssembler* masm, Handle<JSGlobalObject> global, Handle<Name> name, 236 MacroAssembler* masm, Handle<JSGlobalObject> global, Handle<Name> name,
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 // Return the generated code. 818 // Return the generated code.
819 return GetCode(kind(), Code::NORMAL, name); 819 return GetCode(kind(), Code::NORMAL, name);
820 } 820 }
821 821
822 822
823 #undef __ 823 #undef __
824 } // namespace internal 824 } // namespace internal
825 } // namespace v8 825 } // namespace v8
826 826
827 #endif // V8_TARGET_ARCH_IA32 827 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698