OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3705 } | 3705 } |
3706 | 3706 |
3707 | 3707 |
3708 void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) { | 3708 void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) { |
3709 // r0: code entry | 3709 // r0: code entry |
3710 // r1: function | 3710 // r1: function |
3711 // r2: receiver | 3711 // r2: receiver |
3712 // r3: argc | 3712 // r3: argc |
3713 // [sp+0]: argv | 3713 // [sp+0]: argv |
3714 | 3714 |
3715 Label invoke, handler_entry, exit; | 3715 Label invoke, exit; |
3716 | 3716 |
3717 // Called from C, so do not pop argc and args on exit (preserve sp) | 3717 // Called from C, so do not pop argc and args on exit (preserve sp) |
3718 // No need to save register-passed args | 3718 // No need to save register-passed args |
3719 // Save callee-saved registers (incl. cp and fp), sp, and lr | 3719 // Save callee-saved registers (incl. cp and fp), sp, and lr |
3720 __ stm(db_w, sp, kCalleeSaved | lr.bit()); | 3720 __ stm(db_w, sp, kCalleeSaved | lr.bit()); |
3721 | 3721 |
3722 if (CpuFeatures::IsSupported(VFP3)) { | 3722 if (CpuFeatures::IsSupported(VFP3)) { |
3723 CpuFeatures::Scope scope(VFP3); | 3723 CpuFeatures::Scope scope(VFP3); |
3724 // Save callee-saved vfp registers. | 3724 // Save callee-saved vfp registers. |
3725 __ vstm(db_w, sp, kFirstCalleeSavedDoubleReg, kLastCalleeSavedDoubleReg); | 3725 __ vstm(db_w, sp, kFirstCalleeSavedDoubleReg, kLastCalleeSavedDoubleReg); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3768 __ b(ne, &non_outermost_js); | 3768 __ b(ne, &non_outermost_js); |
3769 __ str(fp, MemOperand(r5)); | 3769 __ str(fp, MemOperand(r5)); |
3770 __ mov(ip, Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME))); | 3770 __ mov(ip, Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME))); |
3771 Label cont; | 3771 Label cont; |
3772 __ b(&cont); | 3772 __ b(&cont); |
3773 __ bind(&non_outermost_js); | 3773 __ bind(&non_outermost_js); |
3774 __ mov(ip, Operand(Smi::FromInt(StackFrame::INNER_JSENTRY_FRAME))); | 3774 __ mov(ip, Operand(Smi::FromInt(StackFrame::INNER_JSENTRY_FRAME))); |
3775 __ bind(&cont); | 3775 __ bind(&cont); |
3776 __ push(ip); | 3776 __ push(ip); |
3777 | 3777 |
3778 // Jump to a faked try block that does the invoke, with a faked catch | 3778 // Call a faked try-block that does the invoke. |
3779 // block that sets the pending exception. | 3779 __ bl(&invoke); |
3780 __ jmp(&invoke); | 3780 |
3781 __ bind(&handler_entry); | 3781 // Caught exception: Store result (exception) in the pending |
3782 handler_offset_ = handler_entry.pos(); | 3782 // exception field in the JSEnv and return a failure sentinel. |
3783 // Caught exception: Store result (exception) in the pending exception | 3783 // Coming in here the fp will be invalid because the PushTryHandler below |
3784 // field in the JSEnv and return a failure sentinel. Coming in here the | 3784 // sets it to 0 to signal the existence of the JSEntry frame. |
3785 // fp will be invalid because the PushTryHandler below sets it to 0 to | |
3786 // signal the existence of the JSEntry frame. | |
3787 __ mov(ip, Operand(ExternalReference(Isolate::kPendingExceptionAddress, | 3785 __ mov(ip, Operand(ExternalReference(Isolate::kPendingExceptionAddress, |
3788 isolate))); | 3786 isolate))); |
3789 __ str(r0, MemOperand(ip)); | 3787 __ str(r0, MemOperand(ip)); |
3790 __ mov(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); | 3788 __ mov(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); |
3791 __ b(&exit); | 3789 __ b(&exit); |
3792 | 3790 |
3793 // Invoke: Link this frame into the handler chain. There's only one | 3791 // Invoke: Link this frame into the handler chain. |
3794 // handler block in this code object, so its index is 0. | |
3795 __ bind(&invoke); | 3792 __ bind(&invoke); |
3796 // Must preserve r0-r4, r5-r7 are available. | 3793 // Must preserve r0-r4, r5-r7 are available. |
3797 __ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER, 0); | 3794 __ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER); |
3798 // If an exception not caught by another handler occurs, this handler | 3795 // If an exception not caught by another handler occurs, this handler |
3799 // returns control to the code after the bl(&invoke) above, which | 3796 // returns control to the code after the bl(&invoke) above, which |
3800 // restores all kCalleeSaved registers (including cp and fp) to their | 3797 // restores all kCalleeSaved registers (including cp and fp) to their |
3801 // saved values before returning a failure to C. | 3798 // saved values before returning a failure to C. |
3802 | 3799 |
3803 // Clear any pending exceptions. | 3800 // Clear any pending exceptions. |
3804 __ mov(r5, Operand(isolate->factory()->the_hole_value())); | 3801 __ mov(r5, Operand(isolate->factory()->the_hole_value())); |
3805 __ mov(ip, Operand(ExternalReference(Isolate::kPendingExceptionAddress, | 3802 __ mov(ip, Operand(ExternalReference(Isolate::kPendingExceptionAddress, |
3806 isolate))); | 3803 isolate))); |
3807 __ str(r5, MemOperand(ip)); | 3804 __ str(r5, MemOperand(ip)); |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4896 | 4893 |
4897 __ bind(&done); | 4894 __ bind(&done); |
4898 __ add(sp, sp, Operand(3 * kPointerSize)); | 4895 __ add(sp, sp, Operand(3 * kPointerSize)); |
4899 __ Ret(); | 4896 __ Ret(); |
4900 | 4897 |
4901 __ bind(&slowcase); | 4898 __ bind(&slowcase); |
4902 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); | 4899 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); |
4903 } | 4900 } |
4904 | 4901 |
4905 | 4902 |
4906 void CallFunctionStub::FinishCode(Handle<Code> code) { | 4903 void CallFunctionStub::FinishCode(Code* code) { |
4907 code->set_has_function_cache(false); | 4904 code->set_has_function_cache(false); |
4908 } | 4905 } |
4909 | 4906 |
4910 | 4907 |
4911 void CallFunctionStub::Clear(Heap* heap, Address address) { | 4908 void CallFunctionStub::Clear(Heap* heap, Address address) { |
4912 UNREACHABLE(); | 4909 UNREACHABLE(); |
4913 } | 4910 } |
4914 | 4911 |
4915 | 4912 |
4916 Object* CallFunctionStub::GetCachedValue(Address address) { | 4913 Object* CallFunctionStub::GetCachedValue(Address address) { |
(...skipping 2205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7122 __ bind(&need_incremental); | 7119 __ bind(&need_incremental); |
7123 | 7120 |
7124 // Fall through when we need to inform the incremental marker. | 7121 // Fall through when we need to inform the incremental marker. |
7125 } | 7122 } |
7126 | 7123 |
7127 #undef __ | 7124 #undef __ |
7128 | 7125 |
7129 } } // namespace v8::internal | 7126 } } // namespace v8::internal |
7130 | 7127 |
7131 #endif // V8_TARGET_ARCH_ARM | 7128 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |