OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 4010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4021 ASSERT(Failure::RETRY_AFTER_GC == 0); | 4021 ASSERT(Failure::RETRY_AFTER_GC == 0); |
4022 __ tst(r0, Operand(((1 << kFailureTypeTagSize) - 1) << kFailureTagSize)); | 4022 __ tst(r0, Operand(((1 << kFailureTypeTagSize) - 1) << kFailureTagSize)); |
4023 __ b(eq, &retry); | 4023 __ b(eq, &retry); |
4024 | 4024 |
4025 Label continue_exception; | 4025 Label continue_exception; |
4026 // If the returned failure is EXCEPTION then promote Top::pending_exception(). | 4026 // If the returned failure is EXCEPTION then promote Top::pending_exception(). |
4027 __ cmp(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); | 4027 __ cmp(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); |
4028 __ b(ne, &continue_exception); | 4028 __ b(ne, &continue_exception); |
4029 | 4029 |
4030 // Retrieve the pending exception and clear the variable. | 4030 // Retrieve the pending exception and clear the variable. |
4031 __ mov(ip, Operand(Factory::the_hole_value().location())); | 4031 __ mov(ip, Operand(ExternalReference::the_hole_value_location())); |
4032 __ ldr(r3, MemOperand(ip)); | 4032 __ ldr(r3, MemOperand(ip)); |
4033 __ mov(ip, Operand(Top::pending_exception_address())); | 4033 __ mov(ip, Operand(ExternalReference(Top::k_pending_exception_address))); |
4034 __ ldr(r0, MemOperand(ip)); | 4034 __ ldr(r0, MemOperand(ip)); |
4035 __ str(r3, MemOperand(ip)); | 4035 __ str(r3, MemOperand(ip)); |
4036 | 4036 |
4037 __ bind(&continue_exception); | 4037 __ bind(&continue_exception); |
4038 // Special handling of out of memory exception. | 4038 // Special handling of out of memory exception. |
4039 Failure* out_of_memory = Failure::OutOfMemoryException(); | 4039 Failure* out_of_memory = Failure::OutOfMemoryException(); |
4040 __ cmp(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); | 4040 __ cmp(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); |
4041 __ b(eq, throw_out_of_memory_exception); | 4041 __ b(eq, throw_out_of_memory_exception); |
4042 | 4042 |
4043 // Handle normal exception. | 4043 // Handle normal exception. |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4153 // Setup frame pointer for the frame to be pushed. | 4153 // Setup frame pointer for the frame to be pushed. |
4154 __ add(fp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); | 4154 __ add(fp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); |
4155 | 4155 |
4156 // Call a faked try-block that does the invoke. | 4156 // Call a faked try-block that does the invoke. |
4157 __ bl(&invoke); | 4157 __ bl(&invoke); |
4158 | 4158 |
4159 // Caught exception: Store result (exception) in the pending | 4159 // Caught exception: Store result (exception) in the pending |
4160 // exception field in the JSEnv and return a failure sentinel. | 4160 // exception field in the JSEnv and return a failure sentinel. |
4161 // Coming in here the fp will be invalid because the PushTryHandler below | 4161 // Coming in here the fp will be invalid because the PushTryHandler below |
4162 // sets it to 0 to signal the existence of the JSEntry frame. | 4162 // sets it to 0 to signal the existence of the JSEntry frame. |
4163 __ mov(ip, Operand(Top::pending_exception_address())); | 4163 __ mov(ip, Operand(ExternalReference(Top::k_pending_exception_address))); |
4164 __ str(r0, MemOperand(ip)); | 4164 __ str(r0, MemOperand(ip)); |
4165 __ mov(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); | 4165 __ mov(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); |
4166 __ b(&exit); | 4166 __ b(&exit); |
4167 | 4167 |
4168 // Invoke: Link this frame into the handler chain. | 4168 // Invoke: Link this frame into the handler chain. |
4169 __ bind(&invoke); | 4169 __ bind(&invoke); |
4170 // Must preserve r0-r4, r5-r7 are available. | 4170 // Must preserve r0-r4, r5-r7 are available. |
4171 __ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER); | 4171 __ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER); |
4172 // If an exception not caught by another handler occurs, this handler returns | 4172 // If an exception not caught by another handler occurs, this handler returns |
4173 // control to the code after the bl(&invoke) above, which restores all | 4173 // control to the code after the bl(&invoke) above, which restores all |
4174 // kCalleeSaved registers (including cp, pp and fp) to their saved values | 4174 // kCalleeSaved registers (including cp, pp and fp) to their saved values |
4175 // before returning a failure to C. | 4175 // before returning a failure to C. |
4176 | 4176 |
4177 // Clear any pending exceptions. | 4177 // Clear any pending exceptions. |
4178 __ mov(ip, Operand(ExternalReference::the_hole_value_location())); | 4178 __ mov(ip, Operand(ExternalReference::the_hole_value_location())); |
4179 __ ldr(r5, MemOperand(ip)); | 4179 __ ldr(r5, MemOperand(ip)); |
4180 __ mov(ip, Operand(Top::pending_exception_address())); | 4180 __ mov(ip, Operand(ExternalReference(Top::k_pending_exception_address))); |
4181 __ str(r5, MemOperand(ip)); | 4181 __ str(r5, MemOperand(ip)); |
4182 | 4182 |
4183 // Invoke the function by calling through JS entry trampoline builtin. | 4183 // Invoke the function by calling through JS entry trampoline builtin. |
4184 // Notice that we cannot store a reference to the trampoline code directly in | 4184 // Notice that we cannot store a reference to the trampoline code directly in |
4185 // this stub, because runtime stubs are not traversed when doing GC. | 4185 // this stub, because runtime stubs are not traversed when doing GC. |
4186 | 4186 |
4187 // Expected registers by Builtins::JSEntryTrampoline | 4187 // Expected registers by Builtins::JSEntryTrampoline |
4188 // r0: code entry | 4188 // r0: code entry |
4189 // r1: function | 4189 // r1: function |
4190 // r2: receiver | 4190 // r2: receiver |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4350 __ mov(r2, Operand(0)); | 4350 __ mov(r2, Operand(0)); |
4351 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); | 4351 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); |
4352 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), | 4352 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), |
4353 RelocInfo::CODE_TARGET); | 4353 RelocInfo::CODE_TARGET); |
4354 } | 4354 } |
4355 | 4355 |
4356 | 4356 |
4357 #undef __ | 4357 #undef __ |
4358 | 4358 |
4359 } } // namespace v8::internal | 4359 } } // namespace v8::internal |
OLD | NEW |