Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 8557003: MIPS: Add a level of indirection to exception handler addresses. (Closed)
Patch Set: Rebased on r10024 Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mips/code-stubs-mips.h ('k') | src/mips/frames-mips.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3838 matching lines...) Expand 10 before | Expand all | Expand 10 after
3849 3849
3850 __ bind(&throw_termination_exception); 3850 __ bind(&throw_termination_exception);
3851 GenerateThrowUncatchable(masm, TERMINATION); 3851 GenerateThrowUncatchable(masm, TERMINATION);
3852 3852
3853 __ bind(&throw_normal_exception); 3853 __ bind(&throw_normal_exception);
3854 GenerateThrowTOS(masm); 3854 GenerateThrowTOS(masm);
3855 } 3855 }
3856 3856
3857 3857
3858 void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) { 3858 void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
3859 Label invoke, exit; 3859 Label invoke, handler_entry, exit;
3860 Isolate* isolate = masm->isolate(); 3860 Isolate* isolate = masm->isolate();
3861 3861
3862 // Registers: 3862 // Registers:
3863 // a0: entry address 3863 // a0: entry address
3864 // a1: function 3864 // a1: function
3865 // a2: reveiver 3865 // a2: reveiver
3866 // a3: argc 3866 // a3: argc
3867 // 3867 //
3868 // Stack: 3868 // Stack:
3869 // 4 args slots 3869 // 4 args slots
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
3926 __ sw(fp, MemOperand(t1)); 3926 __ sw(fp, MemOperand(t1));
3927 __ li(t0, Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME))); 3927 __ li(t0, Operand(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME)));
3928 Label cont; 3928 Label cont;
3929 __ b(&cont); 3929 __ b(&cont);
3930 __ nop(); // Branch delay slot nop. 3930 __ nop(); // Branch delay slot nop.
3931 __ bind(&non_outermost_js); 3931 __ bind(&non_outermost_js);
3932 __ li(t0, Operand(Smi::FromInt(StackFrame::INNER_JSENTRY_FRAME))); 3932 __ li(t0, Operand(Smi::FromInt(StackFrame::INNER_JSENTRY_FRAME)));
3933 __ bind(&cont); 3933 __ bind(&cont);
3934 __ push(t0); 3934 __ push(t0);
3935 3935
3936 // Call a faked try-block that does the invoke. 3936 // Jump to a faked try block that does the invoke, with a faked catch
3937 __ bal(&invoke); // bal exposes branch delay slot. 3937 // block that sets the pending exception.
3938 __ nop(); // Branch delay slot nop. 3938 __ jmp(&invoke);
3939 3939 __ bind(&handler_entry);
3940 // Caught exception: Store result (exception) in the pending 3940 handler_offset_ = handler_entry.pos();
3941 // exception field in the JSEnv and return a failure sentinel. 3941 // Caught exception: Store result (exception) in the pending exception
3942 // Coming in here the fp will be invalid because the PushTryHandler below 3942 // field in the JSEnv and return a failure sentinel. Coming in here the
3943 // sets it to 0 to signal the existence of the JSEntry frame. 3943 // fp will be invalid because the PushTryHandler below sets it to 0 to
3944 // signal the existence of the JSEntry frame.
3944 __ li(t0, Operand(ExternalReference(Isolate::kPendingExceptionAddress, 3945 __ li(t0, Operand(ExternalReference(Isolate::kPendingExceptionAddress,
3945 isolate))); 3946 isolate)));
3946 __ sw(v0, MemOperand(t0)); // We come back from 'invoke'. result is in v0. 3947 __ sw(v0, MemOperand(t0)); // We come back from 'invoke'. result is in v0.
3947 __ li(v0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); 3948 __ li(v0, Operand(reinterpret_cast<int32_t>(Failure::Exception())));
3948 __ b(&exit); // b exposes branch delay slot. 3949 __ b(&exit); // b exposes branch delay slot.
3949 __ nop(); // Branch delay slot nop. 3950 __ nop(); // Branch delay slot nop.
3950 3951
3951 // Invoke: Link this frame into the handler chain. 3952 // Invoke: Link this frame into the handler chain. There's only one
3953 // handler block in this code object, so its index is 0.
3952 __ bind(&invoke); 3954 __ bind(&invoke);
3953 __ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER); 3955 __ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER, 0);
3954 // If an exception not caught by another handler occurs, this handler 3956 // If an exception not caught by another handler occurs, this handler
3955 // returns control to the code after the bal(&invoke) above, which 3957 // returns control to the code after the bal(&invoke) above, which
3956 // restores all kCalleeSaved registers (including cp and fp) to their 3958 // restores all kCalleeSaved registers (including cp and fp) to their
3957 // saved values before returning a failure to C. 3959 // saved values before returning a failure to C.
3958 3960
3959 // Clear any pending exceptions. 3961 // Clear any pending exceptions.
3960 __ li(t1, Operand(isolate->factory()->the_hole_value())); 3962 __ li(t1, Operand(isolate->factory()->the_hole_value()));
3961 __ li(t0, Operand(ExternalReference(Isolate::kPendingExceptionAddress, 3963 __ li(t0, Operand(ExternalReference(Isolate::kPendingExceptionAddress,
3962 isolate))); 3964 isolate)));
3963 __ sw(t1, MemOperand(t0)); 3965 __ sw(t1, MemOperand(t0));
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
5096 5098
5097 __ bind(&done); 5099 __ bind(&done);
5098 __ Addu(sp, sp, Operand(3 * kPointerSize)); 5100 __ Addu(sp, sp, Operand(3 * kPointerSize));
5099 __ Ret(); 5101 __ Ret();
5100 5102
5101 __ bind(&slowcase); 5103 __ bind(&slowcase);
5102 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); 5104 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1);
5103 } 5105 }
5104 5106
5105 5107
5106 void CallFunctionStub::FinishCode(Code* code) { 5108 void CallFunctionStub::FinishCode(Handle<Code> code) {
5107 code->set_has_function_cache(false); 5109 code->set_has_function_cache(false);
5108 } 5110 }
5109 5111
5110 5112
5111 void CallFunctionStub::Clear(Heap* heap, Address address) { 5113 void CallFunctionStub::Clear(Heap* heap, Address address) {
5112 UNREACHABLE(); 5114 UNREACHABLE();
5113 } 5115 }
5114 5116
5115 5117
5116 Object* CallFunctionStub::GetCachedValue(Address address) { 5118 Object* CallFunctionStub::GetCachedValue(Address address) {
(...skipping 2344 matching lines...) Expand 10 before | Expand all | Expand 10 after
7461 &slow_elements); 7463 &slow_elements);
7462 __ Ret(); 7464 __ Ret();
7463 } 7465 }
7464 7466
7465 7467
7466 #undef __ 7468 #undef __
7467 7469
7468 } } // namespace v8::internal 7470 } } // namespace v8::internal
7469 7471
7470 #endif // V8_TARGET_ARCH_MIPS 7472 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/code-stubs-mips.h ('k') | src/mips/frames-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698