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

Side by Side Diff: src/mips/macro-assembler-mips.cc

Issue 9373022: Streamline throwing in the C entry stub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 months 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 | Annotate | Revision Log
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/x64/code-stubs-x64.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 2661 matching lines...) Expand 10 before | Expand all | Expand 10 after
2672 // or cp. 2672 // or cp.
2673 Label done; 2673 Label done;
2674 Branch(&done, eq, cp, Operand(zero_reg)); 2674 Branch(&done, eq, cp, Operand(zero_reg));
2675 sw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2675 sw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2676 bind(&done); 2676 bind(&done);
2677 2677
2678 JumpToHandlerEntry(); 2678 JumpToHandlerEntry();
2679 } 2679 }
2680 2680
2681 2681
2682 void MacroAssembler::ThrowUncatchable(UncatchableExceptionType type, 2682 void MacroAssembler::ThrowUncatchable(Register value) {
2683 Register value) {
2684 // Adjust this code if not the case. 2683 // Adjust this code if not the case.
2685 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); 2684 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize);
2686 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); 2685 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize);
2687 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); 2686 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize);
2688 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); 2687 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize);
2689 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); 2688 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize);
2690 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); 2689 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize);
2691 2690
2692 // The exception is expected in v0. 2691 // The exception is expected in v0.
2693 if (type == OUT_OF_MEMORY) { 2692 if (!value.is(v0)) {
2694 // Set external caught exception to false.
2695 ExternalReference external_caught(Isolate::kExternalCaughtExceptionAddress,
2696 isolate());
2697 li(a0, Operand(false, RelocInfo::NONE));
2698 li(a2, Operand(external_caught));
2699 sw(a0, MemOperand(a2));
2700
2701 // Set pending exception and v0 to out of memory exception.
2702 Failure* out_of_memory = Failure::OutOfMemoryException();
2703 li(v0, Operand(reinterpret_cast<int32_t>(out_of_memory)));
2704 li(a2, Operand(ExternalReference(Isolate::kPendingExceptionAddress,
2705 isolate())));
2706 sw(v0, MemOperand(a2));
2707 } else if (!value.is(v0)) {
2708 mov(v0, value); 2693 mov(v0, value);
2709 } 2694 }
2710
2711 // Drop the stack pointer to the top of the top stack handler. 2695 // Drop the stack pointer to the top of the top stack handler.
2712 li(a3, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); 2696 li(a3, Operand(ExternalReference(Isolate::kHandlerAddress, isolate())));
2713 lw(sp, MemOperand(a3)); 2697 lw(sp, MemOperand(a3));
2714 2698
2715 // Unwind the handlers until the ENTRY handler is found. 2699 // Unwind the handlers until the ENTRY handler is found.
2716 Label fetch_next, check_kind; 2700 Label fetch_next, check_kind;
2717 jmp(&check_kind); 2701 jmp(&check_kind);
2718 bind(&fetch_next); 2702 bind(&fetch_next);
2719 lw(sp, MemOperand(sp, StackHandlerConstants::kNextOffset)); 2703 lw(sp, MemOperand(sp, StackHandlerConstants::kNextOffset));
2720 2704
(...skipping 2492 matching lines...) Expand 10 before | Expand all | Expand 10 after
5213 opcode == BGTZL); 5197 opcode == BGTZL);
5214 opcode = (cond == eq) ? BEQ : BNE; 5198 opcode = (cond == eq) ? BEQ : BNE;
5215 instr = (instr & ~kOpcodeMask) | opcode; 5199 instr = (instr & ~kOpcodeMask) | opcode;
5216 masm_.emit(instr); 5200 masm_.emit(instr);
5217 } 5201 }
5218 5202
5219 5203
5220 } } // namespace v8::internal 5204 } } // namespace v8::internal
5221 5205
5222 #endif // V8_TARGET_ARCH_MIPS 5206 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698