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 2612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2623 // After shadowing stops, the original labels are unshadowed and the | 2623 // After shadowing stops, the original labels are unshadowed and the |
2624 // LabelShadows represent the formerly shadowing labels. | 2624 // LabelShadows represent the formerly shadowing labels. |
2625 bool has_unlinks = false; | 2625 bool has_unlinks = false; |
2626 for (int i = 0; i < shadows.length(); i++) { | 2626 for (int i = 0; i < shadows.length(); i++) { |
2627 shadows[i]->StopShadowing(); | 2627 shadows[i]->StopShadowing(); |
2628 has_unlinks = has_unlinks || shadows[i]->is_linked(); | 2628 has_unlinks = has_unlinks || shadows[i]->is_linked(); |
2629 } | 2629 } |
2630 function_return_is_shadowed_ = function_return_was_shadowed; | 2630 function_return_is_shadowed_ = function_return_was_shadowed; |
2631 | 2631 |
2632 // Get an external reference to the handler address. | 2632 // Get an external reference to the handler address. |
2633 ExternalReference handler_address(Top::k_handler_address); | 2633 ExternalReference handler_address(Isolate::k_handler_address); |
2634 | 2634 |
2635 // If we can fall off the end of the try block, unlink from try chain. | 2635 // If we can fall off the end of the try block, unlink from try chain. |
2636 if (has_valid_frame()) { | 2636 if (has_valid_frame()) { |
2637 // The next handler address is on top of the frame. Unlink from | 2637 // The next handler address is on top of the frame. Unlink from |
2638 // the handler list and drop the rest of this handler from the | 2638 // the handler list and drop the rest of this handler from the |
2639 // frame. | 2639 // frame. |
2640 ASSERT(StackHandlerConstants::kNextOffset == 0); | 2640 ASSERT(StackHandlerConstants::kNextOffset == 0); |
2641 frame_->EmitPop(r1); | 2641 frame_->EmitPop(r1); |
2642 __ mov(r3, Operand(handler_address)); | 2642 __ mov(r3, Operand(handler_address)); |
2643 __ str(r1, MemOperand(r3)); | 2643 __ str(r1, MemOperand(r3)); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2737 // After shadowing stops, the original labels are unshadowed and the | 2737 // After shadowing stops, the original labels are unshadowed and the |
2738 // LabelShadows represent the formerly shadowing labels. | 2738 // LabelShadows represent the formerly shadowing labels. |
2739 int nof_unlinks = 0; | 2739 int nof_unlinks = 0; |
2740 for (int i = 0; i < shadows.length(); i++) { | 2740 for (int i = 0; i < shadows.length(); i++) { |
2741 shadows[i]->StopShadowing(); | 2741 shadows[i]->StopShadowing(); |
2742 if (shadows[i]->is_linked()) nof_unlinks++; | 2742 if (shadows[i]->is_linked()) nof_unlinks++; |
2743 } | 2743 } |
2744 function_return_is_shadowed_ = function_return_was_shadowed; | 2744 function_return_is_shadowed_ = function_return_was_shadowed; |
2745 | 2745 |
2746 // Get an external reference to the handler address. | 2746 // Get an external reference to the handler address. |
2747 ExternalReference handler_address(Top::k_handler_address); | 2747 ExternalReference handler_address(Isolate::k_handler_address); |
2748 | 2748 |
2749 // If we can fall off the end of the try block, unlink from the try | 2749 // If we can fall off the end of the try block, unlink from the try |
2750 // chain and set the state on the frame to FALLING. | 2750 // chain and set the state on the frame to FALLING. |
2751 if (has_valid_frame()) { | 2751 if (has_valid_frame()) { |
2752 // The next handler address is on top of the frame. | 2752 // The next handler address is on top of the frame. |
2753 ASSERT(StackHandlerConstants::kNextOffset == 0); | 2753 ASSERT(StackHandlerConstants::kNextOffset == 0); |
2754 frame_->EmitPop(r1); | 2754 frame_->EmitPop(r1); |
2755 __ mov(r3, Operand(handler_address)); | 2755 __ mov(r3, Operand(handler_address)); |
2756 __ str(r1, MemOperand(r3)); | 2756 __ str(r1, MemOperand(r3)); |
2757 frame_->Drop(StackHandlerConstants::kSize / kPointerSize - 1); | 2757 frame_->Drop(StackHandlerConstants::kSize / kPointerSize - 1); |
(...skipping 2171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4929 } | 4929 } |
4930 | 4930 |
4931 | 4931 |
4932 void CodeGenerator::GenerateGetFromCache(ZoneList<Expression*>* args) { | 4932 void CodeGenerator::GenerateGetFromCache(ZoneList<Expression*>* args) { |
4933 ASSERT_EQ(2, args->length()); | 4933 ASSERT_EQ(2, args->length()); |
4934 | 4934 |
4935 ASSERT_NE(NULL, args->at(0)->AsLiteral()); | 4935 ASSERT_NE(NULL, args->at(0)->AsLiteral()); |
4936 int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->handle()))->value(); | 4936 int cache_id = Smi::cast(*(args->at(0)->AsLiteral()->handle()))->value(); |
4937 | 4937 |
4938 Handle<FixedArray> jsfunction_result_caches( | 4938 Handle<FixedArray> jsfunction_result_caches( |
4939 Top::global_context()->jsfunction_result_caches()); | 4939 Isolate::Current()->global_context()->jsfunction_result_caches()); |
4940 if (jsfunction_result_caches->length() <= cache_id) { | 4940 if (jsfunction_result_caches->length() <= cache_id) { |
4941 __ Abort("Attempt to use undefined cache."); | 4941 __ Abort("Attempt to use undefined cache."); |
4942 frame_->EmitPushRoot(Heap::kUndefinedValueRootIndex); | 4942 frame_->EmitPushRoot(Heap::kUndefinedValueRootIndex); |
4943 return; | 4943 return; |
4944 } | 4944 } |
4945 | 4945 |
4946 Load(args->at(1)); | 4946 Load(args->at(1)); |
4947 | 4947 |
4948 VirtualFrame::SpilledScope spilled_scope(frame_); | 4948 VirtualFrame::SpilledScope spilled_scope(frame_); |
4949 | 4949 |
(...skipping 3556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8506 } | 8506 } |
8507 | 8507 |
8508 | 8508 |
8509 void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) { | 8509 void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) { |
8510 // r0 holds the exception. | 8510 // r0 holds the exception. |
8511 | 8511 |
8512 // Adjust this code if not the case. | 8512 // Adjust this code if not the case. |
8513 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); | 8513 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); |
8514 | 8514 |
8515 // Drop the sp to the top of the handler. | 8515 // Drop the sp to the top of the handler. |
8516 __ mov(r3, Operand(ExternalReference(Top::k_handler_address))); | 8516 __ mov(r3, Operand(ExternalReference(Isolate::k_handler_address))); |
8517 __ ldr(sp, MemOperand(r3)); | 8517 __ ldr(sp, MemOperand(r3)); |
8518 | 8518 |
8519 // Restore the next handler and frame pointer, discard handler state. | 8519 // Restore the next handler and frame pointer, discard handler state. |
8520 ASSERT(StackHandlerConstants::kNextOffset == 0); | 8520 ASSERT(StackHandlerConstants::kNextOffset == 0); |
8521 __ pop(r2); | 8521 __ pop(r2); |
8522 __ str(r2, MemOperand(r3)); | 8522 __ str(r2, MemOperand(r3)); |
8523 ASSERT(StackHandlerConstants::kFPOffset == 2 * kPointerSize); | 8523 ASSERT(StackHandlerConstants::kFPOffset == 2 * kPointerSize); |
8524 __ ldm(ia_w, sp, r3.bit() | fp.bit()); // r3: discarded state. | 8524 __ ldm(ia_w, sp, r3.bit() | fp.bit()); // r3: discarded state. |
8525 | 8525 |
8526 // Before returning we restore the context from the frame pointer if | 8526 // Before returning we restore the context from the frame pointer if |
(...skipping 13 matching lines...) Expand all Loading... |
8540 __ pop(pc); | 8540 __ pop(pc); |
8541 } | 8541 } |
8542 | 8542 |
8543 | 8543 |
8544 void CEntryStub::GenerateThrowUncatchable(MacroAssembler* masm, | 8544 void CEntryStub::GenerateThrowUncatchable(MacroAssembler* masm, |
8545 UncatchableExceptionType type) { | 8545 UncatchableExceptionType type) { |
8546 // Adjust this code if not the case. | 8546 // Adjust this code if not the case. |
8547 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); | 8547 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); |
8548 | 8548 |
8549 // Drop sp to the top stack handler. | 8549 // Drop sp to the top stack handler. |
8550 __ mov(r3, Operand(ExternalReference(Top::k_handler_address))); | 8550 __ mov(r3, Operand(ExternalReference(Isolate::k_handler_address))); |
8551 __ ldr(sp, MemOperand(r3)); | 8551 __ ldr(sp, MemOperand(r3)); |
8552 | 8552 |
8553 // Unwind the handlers until the ENTRY handler is found. | 8553 // Unwind the handlers until the ENTRY handler is found. |
8554 Label loop, done; | 8554 Label loop, done; |
8555 __ bind(&loop); | 8555 __ bind(&loop); |
8556 // Load the type of the current stack handler. | 8556 // Load the type of the current stack handler. |
8557 const int kStateOffset = StackHandlerConstants::kStateOffset; | 8557 const int kStateOffset = StackHandlerConstants::kStateOffset; |
8558 __ ldr(r2, MemOperand(sp, kStateOffset)); | 8558 __ ldr(r2, MemOperand(sp, kStateOffset)); |
8559 __ cmp(r2, Operand(StackHandler::ENTRY)); | 8559 __ cmp(r2, Operand(StackHandler::ENTRY)); |
8560 __ b(eq, &done); | 8560 __ b(eq, &done); |
8561 // Fetch the next handler in the list. | 8561 // Fetch the next handler in the list. |
8562 const int kNextOffset = StackHandlerConstants::kNextOffset; | 8562 const int kNextOffset = StackHandlerConstants::kNextOffset; |
8563 __ ldr(sp, MemOperand(sp, kNextOffset)); | 8563 __ ldr(sp, MemOperand(sp, kNextOffset)); |
8564 __ jmp(&loop); | 8564 __ jmp(&loop); |
8565 __ bind(&done); | 8565 __ bind(&done); |
8566 | 8566 |
8567 // Set the top handler address to next handler past the current ENTRY handler. | 8567 // Set the top handler address to next handler past the current ENTRY handler. |
8568 ASSERT(StackHandlerConstants::kNextOffset == 0); | 8568 ASSERT(StackHandlerConstants::kNextOffset == 0); |
8569 __ pop(r2); | 8569 __ pop(r2); |
8570 __ str(r2, MemOperand(r3)); | 8570 __ str(r2, MemOperand(r3)); |
8571 | 8571 |
8572 if (type == OUT_OF_MEMORY) { | 8572 if (type == OUT_OF_MEMORY) { |
8573 // Set external caught exception to false. | 8573 // Set external caught exception to false. |
8574 ExternalReference external_caught(Top::k_external_caught_exception_address); | 8574 ExternalReference external_caught( |
| 8575 Isolate::k_external_caught_exception_address); |
8575 __ mov(r0, Operand(false)); | 8576 __ mov(r0, Operand(false)); |
8576 __ mov(r2, Operand(external_caught)); | 8577 __ mov(r2, Operand(external_caught)); |
8577 __ str(r0, MemOperand(r2)); | 8578 __ str(r0, MemOperand(r2)); |
8578 | 8579 |
8579 // Set pending exception and r0 to out of memory exception. | 8580 // Set pending exception and r0 to out of memory exception. |
8580 Failure* out_of_memory = Failure::OutOfMemoryException(); | 8581 Failure* out_of_memory = Failure::OutOfMemoryException(); |
8581 __ mov(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); | 8582 __ mov(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); |
8582 __ mov(r2, Operand(ExternalReference(Top::k_pending_exception_address))); | 8583 __ mov(r2, Operand( |
| 8584 ExternalReference(Isolate::k_pending_exception_address))); |
8583 __ str(r0, MemOperand(r2)); | 8585 __ str(r0, MemOperand(r2)); |
8584 } | 8586 } |
8585 | 8587 |
8586 // Stack layout at this point. See also StackHandlerConstants. | 8588 // Stack layout at this point. See also StackHandlerConstants. |
8587 // sp -> state (ENTRY) | 8589 // sp -> state (ENTRY) |
8588 // fp | 8590 // fp |
8589 // lr | 8591 // lr |
8590 | 8592 |
8591 // Discard handler state (r2 is not used) and restore frame pointer. | 8593 // Discard handler state (r2 is not used) and restore frame pointer. |
8592 ASSERT(StackHandlerConstants::kFPOffset == 2 * kPointerSize); | 8594 ASSERT(StackHandlerConstants::kFPOffset == 2 * kPointerSize); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8719 __ b(eq, &retry); | 8721 __ b(eq, &retry); |
8720 | 8722 |
8721 // Special handling of out of memory exceptions. | 8723 // Special handling of out of memory exceptions. |
8722 Failure* out_of_memory = Failure::OutOfMemoryException(); | 8724 Failure* out_of_memory = Failure::OutOfMemoryException(); |
8723 __ cmp(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); | 8725 __ cmp(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); |
8724 __ b(eq, throw_out_of_memory_exception); | 8726 __ b(eq, throw_out_of_memory_exception); |
8725 | 8727 |
8726 // Retrieve the pending exception and clear the variable. | 8728 // Retrieve the pending exception and clear the variable. |
8727 __ mov(ip, Operand(ExternalReference::the_hole_value_location())); | 8729 __ mov(ip, Operand(ExternalReference::the_hole_value_location())); |
8728 __ ldr(r3, MemOperand(ip)); | 8730 __ ldr(r3, MemOperand(ip)); |
8729 __ mov(ip, Operand(ExternalReference(Top::k_pending_exception_address))); | 8731 __ mov(ip, Operand(ExternalReference(Isolate::k_pending_exception_address))); |
8730 __ ldr(r0, MemOperand(ip)); | 8732 __ ldr(r0, MemOperand(ip)); |
8731 __ str(r3, MemOperand(ip)); | 8733 __ str(r3, MemOperand(ip)); |
8732 | 8734 |
8733 // Special handling of termination exceptions which are uncatchable | 8735 // Special handling of termination exceptions which are uncatchable |
8734 // by javascript code. | 8736 // by javascript code. |
8735 __ cmp(r0, Operand(Factory::termination_exception())); | 8737 __ cmp(r0, Operand(Factory::termination_exception())); |
8736 __ b(eq, throw_termination_exception); | 8738 __ b(eq, throw_termination_exception); |
8737 | 8739 |
8738 // Handle normal exception. | 8740 // Handle normal exception. |
8739 __ jmp(throw_normal_exception); | 8741 __ jmp(throw_normal_exception); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8832 // Push a frame with special values setup to mark it as an entry frame. | 8834 // Push a frame with special values setup to mark it as an entry frame. |
8833 // r0: code entry | 8835 // r0: code entry |
8834 // r1: function | 8836 // r1: function |
8835 // r2: receiver | 8837 // r2: receiver |
8836 // r3: argc | 8838 // r3: argc |
8837 // r4: argv | 8839 // r4: argv |
8838 __ mov(r8, Operand(-1)); // Push a bad frame pointer to fail if it is used. | 8840 __ mov(r8, Operand(-1)); // Push a bad frame pointer to fail if it is used. |
8839 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; | 8841 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; |
8840 __ mov(r7, Operand(Smi::FromInt(marker))); | 8842 __ mov(r7, Operand(Smi::FromInt(marker))); |
8841 __ mov(r6, Operand(Smi::FromInt(marker))); | 8843 __ mov(r6, Operand(Smi::FromInt(marker))); |
8842 __ mov(r5, Operand(ExternalReference(Top::k_c_entry_fp_address))); | 8844 __ mov(r5, Operand(ExternalReference(Isolate::k_c_entry_fp_address))); |
8843 __ ldr(r5, MemOperand(r5)); | 8845 __ ldr(r5, MemOperand(r5)); |
8844 __ Push(r8, r7, r6, r5); | 8846 __ Push(r8, r7, r6, r5); |
8845 | 8847 |
8846 // Setup frame pointer for the frame to be pushed. | 8848 // Setup frame pointer for the frame to be pushed. |
8847 __ add(fp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); | 8849 __ add(fp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); |
8848 | 8850 |
8849 // Call a faked try-block that does the invoke. | 8851 // Call a faked try-block that does the invoke. |
8850 __ bl(&invoke); | 8852 __ bl(&invoke); |
8851 | 8853 |
8852 // Caught exception: Store result (exception) in the pending | 8854 // Caught exception: Store result (exception) in the pending |
8853 // exception field in the JSEnv and return a failure sentinel. | 8855 // exception field in the JSEnv and return a failure sentinel. |
8854 // Coming in here the fp will be invalid because the PushTryHandler below | 8856 // Coming in here the fp will be invalid because the PushTryHandler below |
8855 // sets it to 0 to signal the existence of the JSEntry frame. | 8857 // sets it to 0 to signal the existence of the JSEntry frame. |
8856 __ mov(ip, Operand(ExternalReference(Top::k_pending_exception_address))); | 8858 __ mov(ip, Operand(ExternalReference(Isolate::k_pending_exception_address))); |
8857 __ str(r0, MemOperand(ip)); | 8859 __ str(r0, MemOperand(ip)); |
8858 __ mov(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); | 8860 __ mov(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); |
8859 __ b(&exit); | 8861 __ b(&exit); |
8860 | 8862 |
8861 // Invoke: Link this frame into the handler chain. | 8863 // Invoke: Link this frame into the handler chain. |
8862 __ bind(&invoke); | 8864 __ bind(&invoke); |
8863 // Must preserve r0-r4, r5-r7 are available. | 8865 // Must preserve r0-r4, r5-r7 are available. |
8864 __ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER); | 8866 __ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER); |
8865 // If an exception not caught by another handler occurs, this handler | 8867 // If an exception not caught by another handler occurs, this handler |
8866 // returns control to the code after the bl(&invoke) above, which | 8868 // returns control to the code after the bl(&invoke) above, which |
8867 // restores all kCalleeSaved registers (including cp and fp) to their | 8869 // restores all kCalleeSaved registers (including cp and fp) to their |
8868 // saved values before returning a failure to C. | 8870 // saved values before returning a failure to C. |
8869 | 8871 |
8870 // Clear any pending exceptions. | 8872 // Clear any pending exceptions. |
8871 __ mov(ip, Operand(ExternalReference::the_hole_value_location())); | 8873 __ mov(ip, Operand(ExternalReference::the_hole_value_location())); |
8872 __ ldr(r5, MemOperand(ip)); | 8874 __ ldr(r5, MemOperand(ip)); |
8873 __ mov(ip, Operand(ExternalReference(Top::k_pending_exception_address))); | 8875 __ mov(ip, Operand(ExternalReference(Isolate::k_pending_exception_address))); |
8874 __ str(r5, MemOperand(ip)); | 8876 __ str(r5, MemOperand(ip)); |
8875 | 8877 |
8876 // Invoke the function by calling through JS entry trampoline builtin. | 8878 // Invoke the function by calling through JS entry trampoline builtin. |
8877 // Notice that we cannot store a reference to the trampoline code directly in | 8879 // Notice that we cannot store a reference to the trampoline code directly in |
8878 // this stub, because runtime stubs are not traversed when doing GC. | 8880 // this stub, because runtime stubs are not traversed when doing GC. |
8879 | 8881 |
8880 // Expected registers by Builtins::JSEntryTrampoline | 8882 // Expected registers by Builtins::JSEntryTrampoline |
8881 // r0: code entry | 8883 // r0: code entry |
8882 // r1: function | 8884 // r1: function |
8883 // r2: receiver | 8885 // r2: receiver |
(...skipping 12 matching lines...) Expand all Loading... |
8896 // macro for the add instruction because we don't want the coverage tool | 8898 // macro for the add instruction because we don't want the coverage tool |
8897 // inserting instructions here after we read the pc. | 8899 // inserting instructions here after we read the pc. |
8898 __ mov(lr, Operand(pc)); | 8900 __ mov(lr, Operand(pc)); |
8899 masm->add(pc, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); | 8901 masm->add(pc, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); |
8900 | 8902 |
8901 // Unlink this frame from the handler chain. When reading the | 8903 // Unlink this frame from the handler chain. When reading the |
8902 // address of the next handler, there is no need to use the address | 8904 // address of the next handler, there is no need to use the address |
8903 // displacement since the current stack pointer (sp) points directly | 8905 // displacement since the current stack pointer (sp) points directly |
8904 // to the stack handler. | 8906 // to the stack handler. |
8905 __ ldr(r3, MemOperand(sp, StackHandlerConstants::kNextOffset)); | 8907 __ ldr(r3, MemOperand(sp, StackHandlerConstants::kNextOffset)); |
8906 __ mov(ip, Operand(ExternalReference(Top::k_handler_address))); | 8908 __ mov(ip, Operand(ExternalReference(Isolate::k_handler_address))); |
8907 __ str(r3, MemOperand(ip)); | 8909 __ str(r3, MemOperand(ip)); |
8908 // No need to restore registers | 8910 // No need to restore registers |
8909 __ add(sp, sp, Operand(StackHandlerConstants::kSize)); | 8911 __ add(sp, sp, Operand(StackHandlerConstants::kSize)); |
8910 | 8912 |
8911 | 8913 |
8912 __ bind(&exit); // r0 holds result | 8914 __ bind(&exit); // r0 holds result |
8913 // Restore the top frame descriptors from the stack. | 8915 // Restore the top frame descriptors from the stack. |
8914 __ pop(r3); | 8916 __ pop(r3); |
8915 __ mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address))); | 8917 __ mov(ip, Operand(ExternalReference(Isolate::k_c_entry_fp_address))); |
8916 __ str(r3, MemOperand(ip)); | 8918 __ str(r3, MemOperand(ip)); |
8917 | 8919 |
8918 // Reset the stack to the callee saved registers. | 8920 // Reset the stack to the callee saved registers. |
8919 __ add(sp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); | 8921 __ add(sp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); |
8920 | 8922 |
8921 // Restore callee-saved registers and return. | 8923 // Restore callee-saved registers and return. |
8922 #ifdef DEBUG | 8924 #ifdef DEBUG |
8923 if (FLAG_debug_code) { | 8925 if (FLAG_debug_code) { |
8924 __ mov(lr, Operand(pc)); | 8926 __ mov(lr, Operand(pc)); |
8925 } | 8927 } |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9421 __ b(eq, &failure); | 9423 __ b(eq, &failure); |
9422 __ cmp(r0, Operand(NativeRegExpMacroAssembler::EXCEPTION)); | 9424 __ cmp(r0, Operand(NativeRegExpMacroAssembler::EXCEPTION)); |
9423 // If not exception it can only be retry. Handle that in the runtime system. | 9425 // If not exception it can only be retry. Handle that in the runtime system. |
9424 __ b(ne, &runtime); | 9426 __ b(ne, &runtime); |
9425 // Result must now be exception. If there is no pending exception already a | 9427 // Result must now be exception. If there is no pending exception already a |
9426 // stack overflow (on the backtrack stack) was detected in RegExp code but | 9428 // stack overflow (on the backtrack stack) was detected in RegExp code but |
9427 // haven't created the exception yet. Handle that in the runtime system. | 9429 // haven't created the exception yet. Handle that in the runtime system. |
9428 // TODO(592): Rerunning the RegExp to get the stack overflow exception. | 9430 // TODO(592): Rerunning the RegExp to get the stack overflow exception. |
9429 __ mov(r0, Operand(ExternalReference::the_hole_value_location())); | 9431 __ mov(r0, Operand(ExternalReference::the_hole_value_location())); |
9430 __ ldr(r0, MemOperand(r0, 0)); | 9432 __ ldr(r0, MemOperand(r0, 0)); |
9431 __ mov(r1, Operand(ExternalReference(Top::k_pending_exception_address))); | 9433 __ mov(r1, Operand(ExternalReference(Isolate::k_pending_exception_address))); |
9432 __ ldr(r1, MemOperand(r1, 0)); | 9434 __ ldr(r1, MemOperand(r1, 0)); |
9433 __ cmp(r0, r1); | 9435 __ cmp(r0, r1); |
9434 __ b(eq, &runtime); | 9436 __ b(eq, &runtime); |
9435 __ bind(&failure); | 9437 __ bind(&failure); |
9436 // For failure and exception return null. | 9438 // For failure and exception return null. |
9437 __ mov(r0, Operand(Factory::null_value())); | 9439 __ mov(r0, Operand(Factory::null_value())); |
9438 __ add(sp, sp, Operand(4 * kPointerSize)); | 9440 __ add(sp, sp, Operand(4 * kPointerSize)); |
9439 __ Ret(); | 9441 __ Ret(); |
9440 | 9442 |
9441 // Process the result from the native regexp code. | 9443 // Process the result from the native regexp code. |
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10698 __ bind(&string_add_runtime); | 10700 __ bind(&string_add_runtime); |
10699 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); | 10701 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); |
10700 } | 10702 } |
10701 | 10703 |
10702 | 10704 |
10703 #undef __ | 10705 #undef __ |
10704 | 10706 |
10705 } } // namespace v8::internal | 10707 } } // namespace v8::internal |
10706 | 10708 |
10707 #endif // V8_TARGET_ARCH_ARM | 10709 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |