OLD | NEW |
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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 static void CompileCallLoadPropertyWithInterceptor( | 215 static void CompileCallLoadPropertyWithInterceptor( |
216 MacroAssembler* masm, Register receiver, Register holder, Register name, | 216 MacroAssembler* masm, Register receiver, Register holder, Register name, |
217 Handle<JSObject> holder_obj, IC::UtilityId id) { | 217 Handle<JSObject> holder_obj, IC::UtilityId id) { |
218 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 218 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
219 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()), | 219 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()), |
220 NamedLoadHandlerCompiler::kInterceptorArgsLength); | 220 NamedLoadHandlerCompiler::kInterceptorArgsLength); |
221 } | 221 } |
222 | 222 |
223 | 223 |
224 // Generate call to api function. | 224 // Generate call to api function. |
225 void PropertyHandlerCompiler::GenerateFastApiCall( | 225 void PropertyHandlerCompiler::GenerateApiAccessorCall( |
226 MacroAssembler* masm, const CallOptimization& optimization, | 226 MacroAssembler* masm, const CallOptimization& optimization, |
227 Handle<Map> receiver_map, Register receiver, Register scratch_in, | 227 Handle<Map> receiver_map, Register receiver, Register scratch_in, |
228 bool is_store, int argc, Register* values) { | 228 bool is_store, Register store_parameter) { |
229 DCHECK(!receiver.is(scratch_in)); | 229 DCHECK(!receiver.is(scratch_in)); |
230 // Preparing to push, adjust sp. | 230 __ push(receiver); |
231 __ Subu(sp, sp, Operand((argc + 1) * kPointerSize)); | |
232 __ sw(receiver, MemOperand(sp, argc * kPointerSize)); // Push receiver. | |
233 // Write the arguments to stack frame. | 231 // Write the arguments to stack frame. |
234 for (int i = 0; i < argc; i++) { | 232 if (is_store) { |
235 Register arg = values[argc - 1 - i]; | 233 DCHECK(!receiver.is(store_parameter)); |
236 DCHECK(!receiver.is(arg)); | 234 DCHECK(!scratch_in.is(store_parameter)); |
237 DCHECK(!scratch_in.is(arg)); | 235 __ push(store_parameter); |
238 __ sw(arg, MemOperand(sp, (argc - 1 - i) * kPointerSize)); // Push arg. | |
239 } | 236 } |
240 DCHECK(optimization.is_simple_api_call()); | 237 DCHECK(optimization.is_simple_api_call()); |
241 | 238 |
242 // Abi for CallApiFunctionStub. | 239 // Abi for CallApiFunctionStub. |
243 Register callee = a0; | 240 Register callee = a0; |
244 Register call_data = t0; | 241 Register call_data = t0; |
245 Register holder = a2; | 242 Register holder = a2; |
246 Register api_function_address = a1; | 243 Register api_function_address = a1; |
247 | 244 |
248 // Put holder in place. | 245 // Put holder in place. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 __ li(call_data, call_data_obj); | 278 __ li(call_data, call_data_obj); |
282 } | 279 } |
283 // Put api_function_address in place. | 280 // Put api_function_address in place. |
284 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | 281 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
285 ApiFunction fun(function_address); | 282 ApiFunction fun(function_address); |
286 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; | 283 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; |
287 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); | 284 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); |
288 __ li(api_function_address, Operand(ref)); | 285 __ li(api_function_address, Operand(ref)); |
289 | 286 |
290 // Jump to stub. | 287 // Jump to stub. |
291 CallApiFunctionStub stub(isolate, is_store, call_data_undefined, argc); | 288 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); |
292 __ TailCallStub(&stub); | 289 __ TailCallStub(&stub); |
293 } | 290 } |
294 | 291 |
295 | 292 |
296 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { | 293 void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { |
297 // Push receiver, key and value for runtime call. | 294 // Push receiver, key and value for runtime call. |
298 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | 295 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), |
299 StoreDescriptor::ValueRegister()); | 296 StoreDescriptor::ValueRegister()); |
300 | 297 |
301 // The slow case calls into the runtime to complete the store without causing | 298 // 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 Loading... |
727 // Return the generated code. | 724 // Return the generated code. |
728 return GetCode(kind(), Code::NORMAL, name); | 725 return GetCode(kind(), Code::NORMAL, name); |
729 } | 726 } |
730 | 727 |
731 | 728 |
732 #undef __ | 729 #undef __ |
733 } | 730 } |
734 } // namespace v8::internal | 731 } // namespace v8::internal |
735 | 732 |
736 #endif // V8_TARGET_ARCH_MIPS | 733 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |