| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 Register src1, const Operand& src2) { | 78 Register src1, const Operand& src2) { |
| 79 Branch(2, NegateCondition(cond), src1, src2); | 79 Branch(2, NegateCondition(cond), src1, src2); |
| 80 sw(source, MemOperand(s6, index << kPointerSizeLog2)); | 80 sw(source, MemOperand(s6, index << kPointerSizeLog2)); |
| 81 } | 81 } |
| 82 | 82 |
| 83 | 83 |
| 84 void MacroAssembler::LoadHeapObject(Register result, | 84 void MacroAssembler::LoadHeapObject(Register result, |
| 85 Handle<HeapObject> object) { | 85 Handle<HeapObject> object) { |
| 86 AllowDeferredHandleDereference using_raw_address; | 86 AllowDeferredHandleDereference using_raw_address; |
| 87 if (isolate()->heap()->InNewSpace(*object)) { | 87 if (isolate()->heap()->InNewSpace(*object)) { |
| 88 Handle<JSGlobalPropertyCell> cell = | 88 Handle<Cell> cell = isolate()->factory()->NewCell(object); |
| 89 isolate()->factory()->NewJSGlobalPropertyCell(object); | |
| 90 li(result, Operand(cell)); | 89 li(result, Operand(cell)); |
| 91 lw(result, FieldMemOperand(result, JSGlobalPropertyCell::kValueOffset)); | 90 lw(result, FieldMemOperand(result, Cell::kValueOffset)); |
| 92 } else { | 91 } else { |
| 93 li(result, Operand(object)); | 92 li(result, Operand(object)); |
| 94 } | 93 } |
| 95 } | 94 } |
| 96 | 95 |
| 97 | 96 |
| 98 // Push and pop all registers that can hold pointers. | 97 // Push and pop all registers that can hold pointers. |
| 99 void MacroAssembler::PushSafepointRegisters() { | 98 void MacroAssembler::PushSafepointRegisters() { |
| 100 // Safepoints expect a block of kNumSafepointRegisters values on the | 99 // Safepoints expect a block of kNumSafepointRegisters values on the |
| 101 // stack, so adjust the stack for unsaved registers. | 100 // stack, so adjust the stack for unsaved registers. |
| (...skipping 3801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3903 Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET); | 3902 Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET); |
| 3904 } | 3903 } |
| 3905 | 3904 |
| 3906 | 3905 |
| 3907 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) { | 3906 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) { |
| 3908 return ref0.address() - ref1.address(); | 3907 return ref0.address() - ref1.address(); |
| 3909 } | 3908 } |
| 3910 | 3909 |
| 3911 | 3910 |
| 3912 void MacroAssembler::CallApiFunctionAndReturn(ExternalReference function, | 3911 void MacroAssembler::CallApiFunctionAndReturn(ExternalReference function, |
| 3912 Address function_address, |
| 3913 ExternalReference thunk_ref, |
| 3914 Register thunk_last_arg, |
| 3913 int stack_space, | 3915 int stack_space, |
| 3914 bool returns_handle, | 3916 bool returns_handle, |
| 3915 int return_value_offset_from_fp) { | 3917 int return_value_offset_from_fp) { |
| 3916 ExternalReference next_address = | 3918 ExternalReference next_address = |
| 3917 ExternalReference::handle_scope_next_address(isolate()); | 3919 ExternalReference::handle_scope_next_address(isolate()); |
| 3918 const int kNextOffset = 0; | 3920 const int kNextOffset = 0; |
| 3919 const int kLimitOffset = AddressOffset( | 3921 const int kLimitOffset = AddressOffset( |
| 3920 ExternalReference::handle_scope_limit_address(isolate()), | 3922 ExternalReference::handle_scope_limit_address(isolate()), |
| 3921 next_address); | 3923 next_address); |
| 3922 const int kLevelOffset = AddressOffset( | 3924 const int kLevelOffset = AddressOffset( |
| (...skipping 18 matching lines...) Expand all Loading... |
| 3941 } | 3943 } |
| 3942 | 3944 |
| 3943 // 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 |
| 3944 // (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. |
| 3945 // 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 |
| 3946 // EnterExitFrame. | 3948 // EnterExitFrame. |
| 3947 if (returns_handle) { | 3949 if (returns_handle) { |
| 3948 addiu(a0, fp, ExitFrameConstants::kStackSpaceOffset); | 3950 addiu(a0, fp, ExitFrameConstants::kStackSpaceOffset); |
| 3949 } | 3951 } |
| 3950 | 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 |
| 3951 // Native call returns to the DirectCEntry stub which redirects to the | 3972 // Native call returns to the DirectCEntry stub which redirects to the |
| 3952 // return address pushed on stack (could have moved after GC). | 3973 // return address pushed on stack (could have moved after GC). |
| 3953 // DirectCEntry stub itself is generated early and never moves. | 3974 // DirectCEntry stub itself is generated early and never moves. |
| 3954 DirectCEntryStub stub; | 3975 DirectCEntryStub stub; |
| 3955 stub.GenerateCall(this, function); | 3976 stub.GenerateCall(this, t9); |
| 3956 | 3977 |
| 3957 if (FLAG_log_timer_events) { | 3978 if (FLAG_log_timer_events) { |
| 3958 FrameScope frame(this, StackFrame::MANUAL); | 3979 FrameScope frame(this, StackFrame::MANUAL); |
| 3959 PushSafepointRegisters(); | 3980 PushSafepointRegisters(); |
| 3960 PrepareCallCFunction(1, a0); | 3981 PrepareCallCFunction(1, a0); |
| 3961 li(a0, Operand(ExternalReference::isolate_address(isolate()))); | 3982 li(a0, Operand(ExternalReference::isolate_address(isolate()))); |
| 3962 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); | 3983 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); |
| 3963 PopSafepointRegisters(); | 3984 PopSafepointRegisters(); |
| 3964 } | 3985 } |
| 3965 | 3986 |
| (...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5527 opcode == BGTZL); | 5548 opcode == BGTZL); |
| 5528 opcode = (cond == eq) ? BEQ : BNE; | 5549 opcode = (cond == eq) ? BEQ : BNE; |
| 5529 instr = (instr & ~kOpcodeMask) | opcode; | 5550 instr = (instr & ~kOpcodeMask) | opcode; |
| 5530 masm_.emit(instr); | 5551 masm_.emit(instr); |
| 5531 } | 5552 } |
| 5532 | 5553 |
| 5533 | 5554 |
| 5534 } } // namespace v8::internal | 5555 } } // namespace v8::internal |
| 5535 | 5556 |
| 5536 #endif // V8_TARGET_ARCH_MIPS | 5557 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |