| 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 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 6 | 6 |
| 7 #include "src/ic/call-optimization.h" | 7 #include "src/ic/call-optimization.h" |
| 8 #include "src/ic/handler-compiler.h" | 8 #include "src/ic/handler-compiler.h" |
| 9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
| 10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 279 } |
| 280 | 280 |
| 281 Isolate* isolate = masm->isolate(); | 281 Isolate* isolate = masm->isolate(); |
| 282 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 282 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
| 283 bool call_data_undefined = false; | 283 bool call_data_undefined = false; |
| 284 // Put call data in place. | 284 // Put call data in place. |
| 285 if (api_call_info->data()->IsUndefined()) { | 285 if (api_call_info->data()->IsUndefined()) { |
| 286 call_data_undefined = true; | 286 call_data_undefined = true; |
| 287 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); | 287 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); |
| 288 } else { | 288 } else { |
| 289 if (optimization.is_constant_call()) { | 289 __ ldr(data, |
| 290 __ ldr(data, | 290 FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); |
| 291 FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); | 291 __ ldr(data, |
| 292 __ ldr(data, | 292 FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); |
| 293 FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); | 293 __ ldr(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); |
| 294 __ ldr(data, | |
| 295 FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); | |
| 296 } else { | |
| 297 __ ldr(data, | |
| 298 FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); | |
| 299 } | |
| 300 __ ldr(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); | 294 __ ldr(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); |
| 301 } | 295 } |
| 302 | 296 |
| 303 if (api_call_info->fast_handler()->IsCode()) { | 297 if (api_call_info->fast_handler()->IsCode()) { |
| 304 // Just tail call into the fast handler if present. | 298 // Just tail call into the fast handler if present. |
| 305 __ Jump(handle(Code::cast(api_call_info->fast_handler())), | 299 __ Jump(handle(Code::cast(api_call_info->fast_handler())), |
| 306 RelocInfo::CODE_TARGET); | 300 RelocInfo::CODE_TARGET); |
| 307 return; | 301 return; |
| 308 } | 302 } |
| 309 | 303 |
| 310 // Put api_function_address in place. | 304 // Put api_function_address in place. |
| 311 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | 305 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
| 312 ApiFunction fun(function_address); | 306 ApiFunction fun(function_address); |
| 313 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; | 307 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; |
| 314 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); | 308 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); |
| 315 __ mov(api_function_address, Operand(ref)); | 309 __ mov(api_function_address, Operand(ref)); |
| 316 | 310 |
| 317 // Jump to stub. | 311 // Jump to stub. |
| 318 CallApiAccessorStub stub(isolate, is_store, call_data_undefined, | 312 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); |
| 319 !optimization.is_constant_call()); | |
| 320 __ TailCallStub(&stub); | 313 __ TailCallStub(&stub); |
| 321 } | 314 } |
| 322 | 315 |
| 323 | 316 |
| 324 static void StoreIC_PushArgs(MacroAssembler* masm) { | 317 static void StoreIC_PushArgs(MacroAssembler* masm) { |
| 325 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), | 318 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), |
| 326 StoreDescriptor::ValueRegister(), | 319 StoreDescriptor::ValueRegister(), |
| 327 VectorStoreICDescriptor::SlotRegister(), | 320 VectorStoreICDescriptor::SlotRegister(), |
| 328 VectorStoreICDescriptor::VectorRegister()); | 321 VectorStoreICDescriptor::VectorRegister()); |
| 329 } | 322 } |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 // Return the generated code. | 783 // Return the generated code. |
| 791 return GetCode(kind(), Code::NORMAL, name); | 784 return GetCode(kind(), Code::NORMAL, name); |
| 792 } | 785 } |
| 793 | 786 |
| 794 | 787 |
| 795 #undef __ | 788 #undef __ |
| 796 } // namespace internal | 789 } // namespace internal |
| 797 } // namespace v8 | 790 } // namespace v8 |
| 798 | 791 |
| 799 #endif // V8_TARGET_ARCH_ARM | 792 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |