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