| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2515 if (type == OUT_OF_MEMORY) { | 2515 if (type == OUT_OF_MEMORY) { |
| 2516 // Set external caught exception to false. | 2516 // Set external caught exception to false. |
| 2517 ExternalReference external_caught(Top::k_external_caught_exception_address); | 2517 ExternalReference external_caught(Top::k_external_caught_exception_address); |
| 2518 __ mov(r0, Operand(false, RelocInfo::NONE)); | 2518 __ mov(r0, Operand(false, RelocInfo::NONE)); |
| 2519 __ mov(r2, Operand(external_caught)); | 2519 __ mov(r2, Operand(external_caught)); |
| 2520 __ str(r0, MemOperand(r2)); | 2520 __ str(r0, MemOperand(r2)); |
| 2521 | 2521 |
| 2522 // Set pending exception and r0 to out of memory exception. | 2522 // Set pending exception and r0 to out of memory exception. |
| 2523 Failure* out_of_memory = Failure::OutOfMemoryException(); | 2523 Failure* out_of_memory = Failure::OutOfMemoryException(); |
| 2524 __ mov(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); | 2524 __ mov(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); |
| 2525 __ mov(r2, Operand(ExternalReference(Top::k_pending_exception_address))); | 2525 __ mov(r2, Operand(ExternalReference::pending_exception_address())); |
| 2526 __ str(r0, MemOperand(r2)); | 2526 __ str(r0, MemOperand(r2)); |
| 2527 } | 2527 } |
| 2528 | 2528 |
| 2529 // Stack layout at this point. See also StackHandlerConstants. | 2529 // Stack layout at this point. See also StackHandlerConstants. |
| 2530 // sp -> state (ENTRY) | 2530 // sp -> state (ENTRY) |
| 2531 // fp | 2531 // fp |
| 2532 // lr | 2532 // lr |
| 2533 | 2533 |
| 2534 // Discard handler state (r2 is not used) and restore frame pointer. | 2534 // Discard handler state (r2 is not used) and restore frame pointer. |
| 2535 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 2 * kPointerSize); | 2535 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 2 * kPointerSize); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2662 __ b(eq, &retry); | 2662 __ b(eq, &retry); |
| 2663 | 2663 |
| 2664 // Special handling of out of memory exceptions. | 2664 // Special handling of out of memory exceptions. |
| 2665 Failure* out_of_memory = Failure::OutOfMemoryException(); | 2665 Failure* out_of_memory = Failure::OutOfMemoryException(); |
| 2666 __ cmp(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); | 2666 __ cmp(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); |
| 2667 __ b(eq, throw_out_of_memory_exception); | 2667 __ b(eq, throw_out_of_memory_exception); |
| 2668 | 2668 |
| 2669 // Retrieve the pending exception and clear the variable. | 2669 // Retrieve the pending exception and clear the variable. |
| 2670 __ mov(ip, Operand(ExternalReference::the_hole_value_location())); | 2670 __ mov(ip, Operand(ExternalReference::the_hole_value_location())); |
| 2671 __ ldr(r3, MemOperand(ip)); | 2671 __ ldr(r3, MemOperand(ip)); |
| 2672 __ mov(ip, Operand(ExternalReference(Top::k_pending_exception_address))); | 2672 __ mov(ip, Operand(ExternalReference::pending_exception_address())); |
| 2673 __ ldr(r0, MemOperand(ip)); | 2673 __ ldr(r0, MemOperand(ip)); |
| 2674 __ str(r3, MemOperand(ip)); | 2674 __ str(r3, MemOperand(ip)); |
| 2675 | 2675 |
| 2676 // Special handling of termination exceptions which are uncatchable | 2676 // Special handling of termination exceptions which are uncatchable |
| 2677 // by javascript code. | 2677 // by javascript code. |
| 2678 __ cmp(r0, Operand(Factory::termination_exception())); | 2678 __ cmp(r0, Operand(Factory::termination_exception())); |
| 2679 __ b(eq, throw_termination_exception); | 2679 __ b(eq, throw_termination_exception); |
| 2680 | 2680 |
| 2681 // Handle normal exception. | 2681 // Handle normal exception. |
| 2682 __ jmp(throw_normal_exception); | 2682 __ jmp(throw_normal_exception); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2798 __ str(fp, MemOperand(r5), eq); | 2798 __ str(fp, MemOperand(r5), eq); |
| 2799 #endif | 2799 #endif |
| 2800 | 2800 |
| 2801 // Call a faked try-block that does the invoke. | 2801 // Call a faked try-block that does the invoke. |
| 2802 __ bl(&invoke); | 2802 __ bl(&invoke); |
| 2803 | 2803 |
| 2804 // Caught exception: Store result (exception) in the pending | 2804 // Caught exception: Store result (exception) in the pending |
| 2805 // exception field in the JSEnv and return a failure sentinel. | 2805 // exception field in the JSEnv and return a failure sentinel. |
| 2806 // Coming in here the fp will be invalid because the PushTryHandler below | 2806 // Coming in here the fp will be invalid because the PushTryHandler below |
| 2807 // sets it to 0 to signal the existence of the JSEntry frame. | 2807 // sets it to 0 to signal the existence of the JSEntry frame. |
| 2808 __ mov(ip, Operand(ExternalReference(Top::k_pending_exception_address))); | 2808 __ mov(ip, Operand(ExternalReference::pending_exception_address())); |
| 2809 __ str(r0, MemOperand(ip)); | 2809 __ str(r0, MemOperand(ip)); |
| 2810 __ mov(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); | 2810 __ mov(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); |
| 2811 __ b(&exit); | 2811 __ b(&exit); |
| 2812 | 2812 |
| 2813 // Invoke: Link this frame into the handler chain. | 2813 // Invoke: Link this frame into the handler chain. |
| 2814 __ bind(&invoke); | 2814 __ bind(&invoke); |
| 2815 // Must preserve r0-r4, r5-r7 are available. | 2815 // Must preserve r0-r4, r5-r7 are available. |
| 2816 __ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER); | 2816 __ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER); |
| 2817 // If an exception not caught by another handler occurs, this handler | 2817 // If an exception not caught by another handler occurs, this handler |
| 2818 // returns control to the code after the bl(&invoke) above, which | 2818 // returns control to the code after the bl(&invoke) above, which |
| 2819 // restores all kCalleeSaved registers (including cp and fp) to their | 2819 // restores all kCalleeSaved registers (including cp and fp) to their |
| 2820 // saved values before returning a failure to C. | 2820 // saved values before returning a failure to C. |
| 2821 | 2821 |
| 2822 // Clear any pending exceptions. | 2822 // Clear any pending exceptions. |
| 2823 __ mov(ip, Operand(ExternalReference::the_hole_value_location())); | 2823 __ mov(ip, Operand(ExternalReference::the_hole_value_location())); |
| 2824 __ ldr(r5, MemOperand(ip)); | 2824 __ ldr(r5, MemOperand(ip)); |
| 2825 __ mov(ip, Operand(ExternalReference(Top::k_pending_exception_address))); | 2825 __ mov(ip, Operand(ExternalReference::pending_exception_address())); |
| 2826 __ str(r5, MemOperand(ip)); | 2826 __ str(r5, MemOperand(ip)); |
| 2827 | 2827 |
| 2828 // Invoke the function by calling through JS entry trampoline builtin. | 2828 // Invoke the function by calling through JS entry trampoline builtin. |
| 2829 // Notice that we cannot store a reference to the trampoline code directly in | 2829 // Notice that we cannot store a reference to the trampoline code directly in |
| 2830 // this stub, because runtime stubs are not traversed when doing GC. | 2830 // this stub, because runtime stubs are not traversed when doing GC. |
| 2831 | 2831 |
| 2832 // Expected registers by Builtins::JSEntryTrampoline | 2832 // Expected registers by Builtins::JSEntryTrampoline |
| 2833 // r0: code entry | 2833 // r0: code entry |
| 2834 // r1: function | 2834 // r1: function |
| 2835 // r2: receiver | 2835 // r2: receiver |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3482 __ b(eq, &failure); | 3482 __ b(eq, &failure); |
| 3483 __ cmp(r0, Operand(NativeRegExpMacroAssembler::EXCEPTION)); | 3483 __ cmp(r0, Operand(NativeRegExpMacroAssembler::EXCEPTION)); |
| 3484 // If not exception it can only be retry. Handle that in the runtime system. | 3484 // If not exception it can only be retry. Handle that in the runtime system. |
| 3485 __ b(ne, &runtime); | 3485 __ b(ne, &runtime); |
| 3486 // Result must now be exception. If there is no pending exception already a | 3486 // Result must now be exception. If there is no pending exception already a |
| 3487 // stack overflow (on the backtrack stack) was detected in RegExp code but | 3487 // stack overflow (on the backtrack stack) was detected in RegExp code but |
| 3488 // haven't created the exception yet. Handle that in the runtime system. | 3488 // haven't created the exception yet. Handle that in the runtime system. |
| 3489 // TODO(592): Rerunning the RegExp to get the stack overflow exception. | 3489 // TODO(592): Rerunning the RegExp to get the stack overflow exception. |
| 3490 __ mov(r0, Operand(ExternalReference::the_hole_value_location())); | 3490 __ mov(r0, Operand(ExternalReference::the_hole_value_location())); |
| 3491 __ ldr(r0, MemOperand(r0, 0)); | 3491 __ ldr(r0, MemOperand(r0, 0)); |
| 3492 __ mov(r1, Operand(ExternalReference(Top::k_pending_exception_address))); | 3492 __ mov(r1, Operand(ExternalReference::pending_exception_address())); |
| 3493 __ ldr(r1, MemOperand(r1, 0)); | 3493 __ ldr(r1, MemOperand(r1, 0)); |
| 3494 __ cmp(r0, r1); | 3494 __ cmp(r0, r1); |
| 3495 __ b(eq, &runtime); | 3495 __ b(eq, &runtime); |
| 3496 __ bind(&failure); | 3496 __ bind(&failure); |
| 3497 // For failure and exception return null. | 3497 // For failure and exception return null. |
| 3498 __ mov(r0, Operand(Factory::null_value())); | 3498 __ mov(r0, Operand(Factory::null_value())); |
| 3499 __ add(sp, sp, Operand(4 * kPointerSize)); | 3499 __ add(sp, sp, Operand(4 * kPointerSize)); |
| 3500 __ Ret(); | 3500 __ Ret(); |
| 3501 | 3501 |
| 3502 // Process the result from the native regexp code. | 3502 // Process the result from the native regexp code. |
| (...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5106 __ pop(r1); | 5106 __ pop(r1); |
| 5107 __ Jump(r2); | 5107 __ Jump(r2); |
| 5108 } | 5108 } |
| 5109 | 5109 |
| 5110 | 5110 |
| 5111 #undef __ | 5111 #undef __ |
| 5112 | 5112 |
| 5113 } } // namespace v8::internal | 5113 } } // namespace v8::internal |
| 5114 | 5114 |
| 5115 #endif // V8_TARGET_ARCH_ARM | 5115 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |