| 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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 // Put call data in place. | 276 // Put call data in place. |
| 277 if (api_call_info->data()->IsUndefined()) { | 277 if (api_call_info->data()->IsUndefined()) { |
| 278 call_data_undefined = true; | 278 call_data_undefined = true; |
| 279 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); | 279 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); |
| 280 } else { | 280 } else { |
| 281 __ lw(data, FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); | 281 __ lw(data, FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); |
| 282 __ lw(data, FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); | 282 __ lw(data, FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); |
| 283 __ lw(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); | 283 __ lw(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); |
| 284 __ lw(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); | 284 __ lw(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); |
| 285 } | 285 } |
| 286 |
| 287 if (api_call_info->fast_handler()->IsCode()) { |
| 288 // Just tail call into the fast handler if present. |
| 289 __ Jump(handle(Code::cast(api_call_info->fast_handler())), |
| 290 RelocInfo::CODE_TARGET); |
| 291 return; |
| 292 } |
| 286 // Put api_function_address in place. | 293 // Put api_function_address in place. |
| 287 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | 294 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
| 288 ApiFunction fun(function_address); | 295 ApiFunction fun(function_address); |
| 289 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; | 296 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; |
| 290 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); | 297 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); |
| 291 __ li(api_function_address, Operand(ref)); | 298 __ li(api_function_address, Operand(ref)); |
| 292 | 299 |
| 293 // Jump to stub. | 300 // Jump to stub. |
| 294 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); | 301 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); |
| 295 __ TailCallStub(&stub); | 302 __ TailCallStub(&stub); |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 // Return the generated code. | 781 // Return the generated code. |
| 775 return GetCode(kind(), Code::NORMAL, name); | 782 return GetCode(kind(), Code::NORMAL, name); |
| 776 } | 783 } |
| 777 | 784 |
| 778 | 785 |
| 779 #undef __ | 786 #undef __ |
| 780 } // namespace internal | 787 } // namespace internal |
| 781 } // namespace v8 | 788 } // namespace v8 |
| 782 | 789 |
| 783 #endif // V8_TARGET_ARCH_MIPS | 790 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |