OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3902 Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET); | 3902 Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET); |
3903 } | 3903 } |
3904 | 3904 |
3905 | 3905 |
3906 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) { | 3906 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) { |
3907 return ref0.address() - ref1.address(); | 3907 return ref0.address() - ref1.address(); |
3908 } | 3908 } |
3909 | 3909 |
3910 | 3910 |
3911 void MacroAssembler::CallApiFunctionAndReturn(ExternalReference function, | 3911 void MacroAssembler::CallApiFunctionAndReturn(ExternalReference function, |
| 3912 Address function_address, |
| 3913 ExternalReference thunk_ref, |
| 3914 Register thunk_last_arg, |
3912 int stack_space, | 3915 int stack_space, |
3913 bool returns_handle, | 3916 bool returns_handle, |
3914 int return_value_offset_from_fp) { | 3917 int return_value_offset_from_fp) { |
3915 ExternalReference next_address = | 3918 ExternalReference next_address = |
3916 ExternalReference::handle_scope_next_address(isolate()); | 3919 ExternalReference::handle_scope_next_address(isolate()); |
3917 const int kNextOffset = 0; | 3920 const int kNextOffset = 0; |
3918 const int kLimitOffset = AddressOffset( | 3921 const int kLimitOffset = AddressOffset( |
3919 ExternalReference::handle_scope_limit_address(isolate()), | 3922 ExternalReference::handle_scope_limit_address(isolate()), |
3920 next_address); | 3923 next_address); |
3921 const int kLevelOffset = AddressOffset( | 3924 const int kLevelOffset = AddressOffset( |
(...skipping 18 matching lines...) Expand all Loading... |
3940 } | 3943 } |
3941 | 3944 |
3942 // The O32 ABI requires us to pass a pointer in a0 where the returned struct | 3945 // The O32 ABI requires us to pass a pointer in a0 where the returned struct |
3943 // (4 bytes) will be placed. This is also built into the Simulator. | 3946 // (4 bytes) will be placed. This is also built into the Simulator. |
3944 // Set up the pointer to the returned value (a0). It was allocated in | 3947 // Set up the pointer to the returned value (a0). It was allocated in |
3945 // EnterExitFrame. | 3948 // EnterExitFrame. |
3946 if (returns_handle) { | 3949 if (returns_handle) { |
3947 addiu(a0, fp, ExitFrameConstants::kStackSpaceOffset); | 3950 addiu(a0, fp, ExitFrameConstants::kStackSpaceOffset); |
3948 } | 3951 } |
3949 | 3952 |
| 3953 Label profiler_disabled; |
| 3954 Label end_profiler_check; |
| 3955 bool* is_profiling_flag = |
| 3956 isolate()->cpu_profiler()->is_profiling_address(); |
| 3957 STATIC_ASSERT(sizeof(*is_profiling_flag) == 1); |
| 3958 li(t9, reinterpret_cast<int32_t>(is_profiling_flag)); |
| 3959 lb(t9, MemOperand(t9, 0)); |
| 3960 beq(t9, zero_reg, &profiler_disabled); |
| 3961 |
| 3962 // Third parameter is the address of the actual getter function. |
| 3963 li(thunk_last_arg, reinterpret_cast<int32_t>(function_address)); |
| 3964 li(t9, Operand(thunk_ref)); |
| 3965 jmp(&end_profiler_check); |
| 3966 |
| 3967 bind(&profiler_disabled); |
| 3968 li(t9, Operand(function)); |
| 3969 |
| 3970 bind(&end_profiler_check); |
| 3971 |
3950 // Native call returns to the DirectCEntry stub which redirects to the | 3972 // Native call returns to the DirectCEntry stub which redirects to the |
3951 // return address pushed on stack (could have moved after GC). | 3973 // return address pushed on stack (could have moved after GC). |
3952 // DirectCEntry stub itself is generated early and never moves. | 3974 // DirectCEntry stub itself is generated early and never moves. |
3953 DirectCEntryStub stub; | 3975 DirectCEntryStub stub; |
3954 stub.GenerateCall(this, function); | 3976 stub.GenerateCall(this, t9); |
3955 | 3977 |
3956 if (FLAG_log_timer_events) { | 3978 if (FLAG_log_timer_events) { |
3957 FrameScope frame(this, StackFrame::MANUAL); | 3979 FrameScope frame(this, StackFrame::MANUAL); |
3958 PushSafepointRegisters(); | 3980 PushSafepointRegisters(); |
3959 PrepareCallCFunction(1, a0); | 3981 PrepareCallCFunction(1, a0); |
3960 li(a0, Operand(ExternalReference::isolate_address(isolate()))); | 3982 li(a0, Operand(ExternalReference::isolate_address(isolate()))); |
3961 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); | 3983 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); |
3962 PopSafepointRegisters(); | 3984 PopSafepointRegisters(); |
3963 } | 3985 } |
3964 | 3986 |
(...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5526 opcode == BGTZL); | 5548 opcode == BGTZL); |
5527 opcode = (cond == eq) ? BEQ : BNE; | 5549 opcode = (cond == eq) ? BEQ : BNE; |
5528 instr = (instr & ~kOpcodeMask) | opcode; | 5550 instr = (instr & ~kOpcodeMask) | opcode; |
5529 masm_.emit(instr); | 5551 masm_.emit(instr); |
5530 } | 5552 } |
5531 | 5553 |
5532 | 5554 |
5533 } } // namespace v8::internal | 5555 } } // namespace v8::internal |
5534 | 5556 |
5535 #endif // V8_TARGET_ARCH_MIPS | 5557 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |