MIPS: Remove code object from StackHandler.

Port e0aa8ebf93

Original commit message:
This reduces the size of the StackHandler by one word. We no longer
need to keep track of the code object, as the stack walk finds it.

BUG=

Review URL: https://codereview.chromium.org/990903008

Cr-Commit-Position: refs/heads/master@{#27120}
This commit is contained in:
balazs.kilvady 2015-03-10 12:07:18 -07:00 committed by Commit bot
parent 99e0f1a8db
commit fd012f1080
2 changed files with 16 additions and 19 deletions

View File

@ -3238,32 +3238,30 @@ void MacroAssembler::DebugBreak() {
void MacroAssembler::PushTryHandler(StackHandler::Kind kind,
int handler_index) {
// Adjust this code if not the case.
STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kFPOffset == 3 * kPointerSize);
// For the JSEntry handler, we must preserve a0-a3 and s0.
// t1-t3 are available. We will build up the handler from the bottom by
// pushing on the stack.
// Set up the code object (t1) and the state (t2) for pushing.
// Set up the the state (t2) for pushing.
unsigned state =
StackHandler::IndexField::encode(handler_index) |
StackHandler::KindField::encode(kind);
li(t1, Operand(CodeObject()), CONSTANT_SIZE);
li(t2, Operand(state));
// Push the frame pointer, context, state, and code object.
// Push the frame pointer, context, and state.
if (kind == StackHandler::JS_ENTRY) {
DCHECK_EQ(static_cast<Smi*>(0), Smi::FromInt(0));
// The second zero_reg indicates no context.
// The first zero_reg is the NULL frame pointer.
// The operands are reversed to match the order of MultiPush/Pop.
Push(zero_reg, zero_reg, t2, t1);
Push(zero_reg, zero_reg, t2);
} else {
MultiPush(t1.bit() | t2.bit() | cp.bit() | fp.bit());
MultiPush(t2.bit() | cp.bit() | fp.bit());
}
// Link the current handler as the next handler.

View File

@ -3225,32 +3225,31 @@ void MacroAssembler::DebugBreak() {
void MacroAssembler::PushTryHandler(StackHandler::Kind kind,
int handler_index) {
// Adjust this code if not the case.
STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize);
STATIC_ASSERT(StackHandlerConstants::kFPOffset == 3 * kPointerSize);
// For the JSEntry handler, we must preserve a0-a3 and s0.
// a5-a7 are available. We will build up the handler from the bottom by
// pushing on the stack.
// Set up the code object (a5) and the state (a6) for pushing.
// Set up the the state (r6) for pushing.
unsigned state =
StackHandler::IndexField::encode(handler_index) |
StackHandler::KindField::encode(kind);
li(a5, Operand(CodeObject()), CONSTANT_SIZE);
li(a6, Operand(state));
// Push the frame pointer, context, state, and code object.
// Push the frame pointer, context, and state.
if (kind == StackHandler::JS_ENTRY) {
DCHECK_EQ(static_cast<Smi*>(0), Smi::FromInt(0));
// The second zero_reg indicates no context.
// The first zero_reg is the NULL frame pointer.
// The operands are reversed to match the order of MultiPush/Pop.
Push(zero_reg, zero_reg, a6, a5);
Push(zero_reg, zero_reg, a6);
} else {
MultiPush(a5.bit() | a6.bit() | cp.bit() | fp.bit());
MultiPush(a6.bit() | cp.bit() | fp.bit());
}
// Link the current handler as the next handler.