| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 6 | 6 |
| 7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 2779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2790 } | 2790 } |
| 2791 | 2791 |
| 2792 Label fast_elements_case; | 2792 Label fast_elements_case; |
| 2793 __ Branch(&fast_elements_case, eq, a3, Operand(FAST_ELEMENTS)); | 2793 __ Branch(&fast_elements_case, eq, a3, Operand(FAST_ELEMENTS)); |
| 2794 GenerateCase(masm, FAST_HOLEY_ELEMENTS); | 2794 GenerateCase(masm, FAST_HOLEY_ELEMENTS); |
| 2795 | 2795 |
| 2796 __ bind(&fast_elements_case); | 2796 __ bind(&fast_elements_case); |
| 2797 GenerateCase(masm, FAST_ELEMENTS); | 2797 GenerateCase(masm, FAST_ELEMENTS); |
| 2798 } | 2798 } |
| 2799 | 2799 |
| 2800 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) { | |
| 2801 int64_t offset = (ref0.address() - ref1.address()); | |
| 2802 DCHECK(static_cast<int>(offset) == offset); | |
| 2803 return static_cast<int>(offset); | |
| 2804 } | |
| 2805 | |
| 2806 | |
| 2807 // Calls an API function. Allocates HandleScope, extracts returned value | 2800 // Calls an API function. Allocates HandleScope, extracts returned value |
| 2808 // from handle and propagates exceptions. Restores context. stack_space | 2801 // from handle and propagates exceptions. Restores context. stack_space |
| 2809 // - space to be unwound on exit (includes the call JS arguments space and | 2802 // - space to be unwound on exit (includes the call JS arguments space and |
| 2810 // the additional space allocated for the fast call). | 2803 // the additional space allocated for the fast call). |
| 2811 static void CallApiFunctionAndReturn( | 2804 static void CallApiFunctionAndReturn( |
| 2812 MacroAssembler* masm, Register function_address, | 2805 MacroAssembler* masm, Register function_address, |
| 2813 ExternalReference thunk_ref, int stack_space, int32_t stack_space_offset, | 2806 ExternalReference thunk_ref, int stack_space, int32_t stack_space_offset, |
| 2814 MemOperand return_value_operand, MemOperand* context_restore_operand) { | 2807 MemOperand return_value_operand, MemOperand* context_restore_operand) { |
| 2815 Isolate* isolate = masm->isolate(); | 2808 Isolate* isolate = masm->isolate(); |
| 2816 ExternalReference next_address = | 2809 ExternalReference next_address = |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2907 } | 2900 } |
| 2908 __ LeaveExitFrame(false, s0, !restore_context, NO_EMIT_RETURN, | 2901 __ LeaveExitFrame(false, s0, !restore_context, NO_EMIT_RETURN, |
| 2909 stack_space_offset != kInvalidStackOffset); | 2902 stack_space_offset != kInvalidStackOffset); |
| 2910 | 2903 |
| 2911 // Check if the function scheduled an exception. | 2904 // Check if the function scheduled an exception. |
| 2912 __ LoadRoot(a4, Heap::kTheHoleValueRootIndex); | 2905 __ LoadRoot(a4, Heap::kTheHoleValueRootIndex); |
| 2913 __ li(at, Operand(ExternalReference::scheduled_exception_address(isolate))); | 2906 __ li(at, Operand(ExternalReference::scheduled_exception_address(isolate))); |
| 2914 __ Ld(a5, MemOperand(at)); | 2907 __ Ld(a5, MemOperand(at)); |
| 2915 __ Branch(&promote_scheduled_exception, ne, a4, Operand(a5)); | 2908 __ Branch(&promote_scheduled_exception, ne, a4, Operand(a5)); |
| 2916 | 2909 |
| 2910 // Check if the function returned a valid JavaScript value. |
| 2911 __ AssertApiCallResult(v0); |
| 2912 |
| 2917 __ Ret(); | 2913 __ Ret(); |
| 2918 | 2914 |
| 2919 // Re-throw by promoting a scheduled exception. | 2915 // Re-throw by promoting a scheduled exception. |
| 2920 __ bind(&promote_scheduled_exception); | 2916 __ bind(&promote_scheduled_exception); |
| 2921 __ TailCallRuntime(Runtime::kPromoteScheduledException); | 2917 __ TailCallRuntime(Runtime::kPromoteScheduledException); |
| 2922 | 2918 |
| 2923 // HandleScope limit has changed. Delete allocated extensions. | 2919 // HandleScope limit has changed. Delete allocated extensions. |
| 2924 __ bind(&delete_allocated_handles); | 2920 __ bind(&delete_allocated_handles); |
| 2925 __ Sd(s1, MemOperand(s3, kLimitOffset)); | 2921 __ Sd(s1, MemOperand(s3, kLimitOffset)); |
| 2926 __ mov(s0, v0); | 2922 __ mov(s0, v0); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3105 kStackUnwindSpace, kInvalidStackOffset, | 3101 kStackUnwindSpace, kInvalidStackOffset, |
| 3106 return_value_operand, NULL); | 3102 return_value_operand, NULL); |
| 3107 } | 3103 } |
| 3108 | 3104 |
| 3109 #undef __ | 3105 #undef __ |
| 3110 | 3106 |
| 3111 } // namespace internal | 3107 } // namespace internal |
| 3112 } // namespace v8 | 3108 } // namespace v8 |
| 3113 | 3109 |
| 3114 #endif // V8_TARGET_ARCH_MIPS64 | 3110 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |