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

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

Issue 853323002: MIPS: split api call stubs into accessor and function call stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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/ic/mips/handler-compiler-mips.cc ('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 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/ic/call-optimization.h" 9 #include "src/ic/call-optimization.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 static void CompileCallLoadPropertyWithInterceptor( 216 static void CompileCallLoadPropertyWithInterceptor(
217 MacroAssembler* masm, Register receiver, Register holder, Register name, 217 MacroAssembler* masm, Register receiver, Register holder, Register name,
218 Handle<JSObject> holder_obj, IC::UtilityId id) { 218 Handle<JSObject> holder_obj, IC::UtilityId id) {
219 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); 219 PushInterceptorArguments(masm, receiver, holder, name, holder_obj);
220 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()), 220 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()),
221 NamedLoadHandlerCompiler::kInterceptorArgsLength); 221 NamedLoadHandlerCompiler::kInterceptorArgsLength);
222 } 222 }
223 223
224 224
225 // Generate call to api function. 225 // Generate call to api function.
226 void PropertyHandlerCompiler::GenerateFastApiCall( 226 void PropertyHandlerCompiler::GenerateApiAccessorCall(
227 MacroAssembler* masm, const CallOptimization& optimization, 227 MacroAssembler* masm, const CallOptimization& optimization,
228 Handle<Map> receiver_map, Register receiver, Register scratch_in, 228 Handle<Map> receiver_map, Register receiver, Register scratch_in,
229 bool is_store, int argc, Register* values) { 229 bool is_store, Register store_parameter) {
230 DCHECK(!receiver.is(scratch_in)); 230 DCHECK(!receiver.is(scratch_in));
231 // Preparing to push, adjust sp. 231 __ push(receiver);
232 __ Dsubu(sp, sp, Operand((argc + 1) * kPointerSize));
233 __ sd(receiver, MemOperand(sp, argc * kPointerSize)); // Push receiver.
234 // Write the arguments to stack frame. 232 // Write the arguments to stack frame.
235 for (int i = 0; i < argc; i++) { 233 if (is_store) {
236 Register arg = values[argc - 1 - i]; 234 DCHECK(!receiver.is(store_parameter));
237 DCHECK(!receiver.is(arg)); 235 DCHECK(!scratch_in.is(store_parameter));
238 DCHECK(!scratch_in.is(arg)); 236 __ push(store_parameter);
239 __ sd(arg, MemOperand(sp, (argc - 1 - i) * kPointerSize)); // Push arg.
240 } 237 }
241 DCHECK(optimization.is_simple_api_call()); 238 DCHECK(optimization.is_simple_api_call());
242 239
243 // Abi for CallApiFunctionStub. 240 // Abi for CallApiFunctionStub.
244 Register callee = a0; 241 Register callee = a0;
245 Register call_data = a4; 242 Register call_data = a4;
246 Register holder = a2; 243 Register holder = a2;
247 Register api_function_address = a1; 244 Register api_function_address = a1;
248 245
249 // Put holder in place. 246 // Put holder in place.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 __ li(call_data, call_data_obj); 279 __ li(call_data, call_data_obj);
283 } 280 }
284 // Put api_function_address in place. 281 // Put api_function_address in place.
285 Address function_address = v8::ToCData<Address>(api_call_info->callback()); 282 Address function_address = v8::ToCData<Address>(api_call_info->callback());
286 ApiFunction fun(function_address); 283 ApiFunction fun(function_address);
287 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; 284 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL;
288 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); 285 ExternalReference ref = ExternalReference(&fun, type, masm->isolate());
289 __ li(api_function_address, Operand(ref)); 286 __ li(api_function_address, Operand(ref));
290 287
291 // Jump to stub. 288 // Jump to stub.
292 CallApiFunctionStub stub(isolate, is_store, call_data_undefined, argc); 289 CallApiAccessorStub stub(isolate, is_store, call_data_undefined);
293 __ TailCallStub(&stub); 290 __ TailCallStub(&stub);
294 } 291 }
295 292
296 293
297 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { 294 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
298 // Push receiver, key and value for runtime call. 295 // Push receiver, key and value for runtime call.
299 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), 296 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
300 StoreDescriptor::ValueRegister()); 297 StoreDescriptor::ValueRegister());
301 298
302 // The slow case calls into the runtime to complete the store without causing 299 // The slow case calls into the runtime to complete the store without causing
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 // Return the generated code. 725 // Return the generated code.
729 return GetCode(kind(), Code::NORMAL, name); 726 return GetCode(kind(), Code::NORMAL, name);
730 } 727 }
731 728
732 729
733 #undef __ 730 #undef __
734 } 731 }
735 } // namespace v8::internal 732 } // namespace v8::internal
736 733
737 #endif // V8_TARGET_ARCH_MIPS64 734 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/ic/mips/handler-compiler-mips.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698