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 3929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3940 STATIC_ASSERT(Failure::RETRY_AFTER_GC == 0); | 3940 STATIC_ASSERT(Failure::RETRY_AFTER_GC == 0); |
3941 __ andi(t0, v0, ((1 << kFailureTypeTagSize) - 1) << kFailureTagSize); | 3941 __ andi(t0, v0, ((1 << kFailureTypeTagSize) - 1) << kFailureTagSize); |
3942 __ Branch(&retry, eq, t0, Operand(zero_reg)); | 3942 __ Branch(&retry, eq, t0, Operand(zero_reg)); |
3943 | 3943 |
3944 // Special handling of out of memory exceptions. | 3944 // Special handling of out of memory exceptions. |
3945 Failure* out_of_memory = Failure::OutOfMemoryException(); | 3945 Failure* out_of_memory = Failure::OutOfMemoryException(); |
3946 __ Branch(throw_out_of_memory_exception, eq, | 3946 __ Branch(throw_out_of_memory_exception, eq, |
3947 v0, Operand(reinterpret_cast<int32_t>(out_of_memory))); | 3947 v0, Operand(reinterpret_cast<int32_t>(out_of_memory))); |
3948 | 3948 |
3949 // Retrieve the pending exception and clear the variable. | 3949 // Retrieve the pending exception and clear the variable. |
3950 __ li(a3, Operand(isolate->factory()->the_hole_value())); | 3950 __ LoadRoot(a3, Heap::kTheHoleValueRootIndex); |
3951 __ li(t0, Operand(ExternalReference(Isolate::kPendingExceptionAddress, | 3951 __ li(t0, Operand(ExternalReference(Isolate::kPendingExceptionAddress, |
3952 isolate))); | 3952 isolate))); |
3953 __ lw(v0, MemOperand(t0)); | 3953 __ lw(v0, MemOperand(t0)); |
3954 __ sw(a3, MemOperand(t0)); | 3954 __ sw(a3, MemOperand(t0)); |
3955 | 3955 |
3956 // Special handling of termination exceptions which are uncatchable | 3956 // Special handling of termination exceptions which are uncatchable |
3957 // by javascript code. | 3957 // by javascript code. |
3958 __ LoadRoot(t0, Heap::kTerminationExceptionRootIndex); | |
3958 __ Branch(throw_termination_exception, eq, | 3959 __ Branch(throw_termination_exception, eq, |
Erik Corry
2012/03/17 02:49:18
This all fits on one line now.
| |
3959 v0, Operand(isolate->factory()->termination_exception())); | 3960 v0, Operand(t0)); |
3960 | 3961 |
3961 // Handle normal exception. | 3962 // Handle normal exception. |
3962 __ jmp(throw_normal_exception); | 3963 __ jmp(throw_normal_exception); |
3963 | 3964 |
3964 __ bind(&retry); | 3965 __ bind(&retry); |
3965 // Last failure (v0) will be moved to (a0) for parameter when retrying. | 3966 // Last failure (v0) will be moved to (a0) for parameter when retrying. |
3966 } | 3967 } |
3967 | 3968 |
3968 | 3969 |
3969 void CEntryStub::Generate(MacroAssembler* masm) { | 3970 void CEntryStub::Generate(MacroAssembler* masm) { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4076 __ Move(kDoubleRegZero, 0.0); | 4077 __ Move(kDoubleRegZero, 0.0); |
4077 } | 4078 } |
4078 | 4079 |
4079 | 4080 |
4080 // Load argv in s0 register. | 4081 // Load argv in s0 register. |
4081 int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize; | 4082 int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize; |
4082 if (CpuFeatures::IsSupported(FPU)) { | 4083 if (CpuFeatures::IsSupported(FPU)) { |
4083 offset_to_argv += kNumCalleeSavedFPU * kDoubleSize; | 4084 offset_to_argv += kNumCalleeSavedFPU * kDoubleSize; |
4084 } | 4085 } |
4085 | 4086 |
4087 __ InitializeRootRegister(); | |
4086 __ lw(s0, MemOperand(sp, offset_to_argv + kCArgsSlotsSize)); | 4088 __ lw(s0, MemOperand(sp, offset_to_argv + kCArgsSlotsSize)); |
4087 | 4089 |
4088 // We build an EntryFrame. | 4090 // We build an EntryFrame. |
4089 __ li(t3, Operand(-1)); // Push a bad frame pointer to fail if it is used. | 4091 __ li(t3, Operand(-1)); // Push a bad frame pointer to fail if it is used. |
4090 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; | 4092 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; |
4091 __ li(t2, Operand(Smi::FromInt(marker))); | 4093 __ li(t2, Operand(Smi::FromInt(marker))); |
4092 __ li(t1, Operand(Smi::FromInt(marker))); | 4094 __ li(t1, Operand(Smi::FromInt(marker))); |
4093 __ li(t0, Operand(ExternalReference(Isolate::kCEntryFPAddress, | 4095 __ li(t0, Operand(ExternalReference(Isolate::kCEntryFPAddress, |
4094 isolate))); | 4096 isolate))); |
4095 __ lw(t0, MemOperand(t0)); | 4097 __ lw(t0, MemOperand(t0)); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4148 // Invoke: Link this frame into the handler chain. There's only one | 4150 // Invoke: Link this frame into the handler chain. There's only one |
4149 // handler block in this code object, so its index is 0. | 4151 // handler block in this code object, so its index is 0. |
4150 __ bind(&invoke); | 4152 __ bind(&invoke); |
4151 __ PushTryHandler(StackHandler::JS_ENTRY, 0); | 4153 __ PushTryHandler(StackHandler::JS_ENTRY, 0); |
4152 // If an exception not caught by another handler occurs, this handler | 4154 // If an exception not caught by another handler occurs, this handler |
4153 // returns control to the code after the bal(&invoke) above, which | 4155 // returns control to the code after the bal(&invoke) above, which |
4154 // restores all kCalleeSaved registers (including cp and fp) to their | 4156 // restores all kCalleeSaved registers (including cp and fp) to their |
4155 // saved values before returning a failure to C. | 4157 // saved values before returning a failure to C. |
4156 | 4158 |
4157 // Clear any pending exceptions. | 4159 // Clear any pending exceptions. |
4158 __ li(t1, Operand(isolate->factory()->the_hole_value())); | 4160 __ LoadRoot(t1, Heap::kTheHoleValueRootIndex); |
4159 __ li(t0, Operand(ExternalReference(Isolate::kPendingExceptionAddress, | 4161 __ li(t0, Operand(ExternalReference(Isolate::kPendingExceptionAddress, |
4160 isolate))); | 4162 isolate))); |
4161 __ sw(t1, MemOperand(t0)); | 4163 __ sw(t1, MemOperand(t0)); |
4162 | 4164 |
4163 // Invoke the function by calling through JS entry trampoline builtin. | 4165 // Invoke the function by calling through JS entry trampoline builtin. |
4164 // Notice that we cannot store a reference to the trampoline code directly in | 4166 // Notice that we cannot store a reference to the trampoline code directly in |
4165 // this stub, because runtime stubs are not traversed when doing GC. | 4167 // this stub, because runtime stubs are not traversed when doing GC. |
4166 | 4168 |
4167 // Registers: | 4169 // Registers: |
4168 // a0: entry_address | 4170 // a0: entry_address |
(...skipping 2905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7074 masm->bal(&find_ra); // ra = pc + 8. | 7076 masm->bal(&find_ra); // ra = pc + 8. |
7075 masm->nop(); // Branch delay slot nop. | 7077 masm->nop(); // Branch delay slot nop. |
7076 masm->bind(&find_ra); | 7078 masm->bind(&find_ra); |
7077 | 7079 |
7078 const int kNumInstructionsToJump = 6; | 7080 const int kNumInstructionsToJump = 6; |
7079 masm->addiu(ra, ra, kNumInstructionsToJump * kPointerSize); | 7081 masm->addiu(ra, ra, kNumInstructionsToJump * kPointerSize); |
7080 // Push return address (accessible to GC through exit frame pc). | 7082 // Push return address (accessible to GC through exit frame pc). |
7081 // This spot for ra was reserved in EnterExitFrame. | 7083 // This spot for ra was reserved in EnterExitFrame. |
7082 masm->sw(ra, MemOperand(sp, kCArgsSlotsSize)); | 7084 masm->sw(ra, MemOperand(sp, kCArgsSlotsSize)); |
7083 masm->li(ra, Operand(reinterpret_cast<intptr_t>(GetCode().location()), | 7085 masm->li(ra, Operand(reinterpret_cast<intptr_t>(GetCode().location()), |
7084 RelocInfo::CODE_TARGET), true); | 7086 RelocInfo::CODE_TARGET), CONSTANT_SIZE); |
Erik Corry
2012/03/17 02:49:18
I fixed some strange line breaking here.
| |
7085 // Call the function. | 7087 // Call the function. |
7086 masm->Jump(t9); | 7088 masm->Jump(t9); |
7087 // Make sure the stored 'ra' points to this position. | 7089 // Make sure the stored 'ra' points to this position. |
7088 ASSERT_EQ(kNumInstructionsToJump, masm->InstructionsGeneratedSince(&find_ra)); | 7090 ASSERT_EQ(kNumInstructionsToJump, masm->InstructionsGeneratedSince(&find_ra)); |
7089 } | 7091 } |
7090 | 7092 |
7091 | 7093 |
7092 void StringDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm, | 7094 void StringDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm, |
7093 Label* miss, | 7095 Label* miss, |
7094 Label* done, | 7096 Label* done, |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7682 __ Ret(USE_DELAY_SLOT); | 7684 __ Ret(USE_DELAY_SLOT); |
7683 __ mov(v0, a0); | 7685 __ mov(v0, a0); |
7684 } | 7686 } |
7685 | 7687 |
7686 | 7688 |
7687 #undef __ | 7689 #undef __ |
7688 | 7690 |
7689 } } // namespace v8::internal | 7691 } } // namespace v8::internal |
7690 | 7692 |
7691 #endif // V8_TARGET_ARCH_MIPS | 7693 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |