| Index: src/ia32/macro-assembler-ia32.cc
|
| diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
|
| index 6a208080b729f1a44931d511f0e5939021dd10f3..9986c3ed86e3a313f21b7840648cba88f5523af1 100644
|
| --- a/src/ia32/macro-assembler-ia32.cc
|
| +++ b/src/ia32/macro-assembler-ia32.cc
|
| @@ -764,8 +764,7 @@ void MacroAssembler::LeaveApiExitFrame() {
|
| }
|
|
|
|
|
| -void MacroAssembler::PushTryHandler(CodeLocation try_location,
|
| - HandlerType type,
|
| +void MacroAssembler::PushTryHandler(StackHandler::Kind kind,
|
| int handler_index) {
|
| // Adjust this code if not the case.
|
| STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize);
|
| @@ -776,25 +775,21 @@ void MacroAssembler::PushTryHandler(CodeLocation try_location,
|
| STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize);
|
|
|
| // We will build up the handler from the bottom by pushing on the stack.
|
| - // First compute the state and push the frame pointer and context.
|
| - unsigned state = StackHandler::OffsetField::encode(handler_index);
|
| - if (try_location == IN_JAVASCRIPT) {
|
| - push(ebp);
|
| - push(esi);
|
| - state |= (type == TRY_CATCH_HANDLER)
|
| - ? StackHandler::KindField::encode(StackHandler::TRY_CATCH)
|
| - : StackHandler::KindField::encode(StackHandler::TRY_FINALLY);
|
| - } else {
|
| - ASSERT(try_location == IN_JS_ENTRY);
|
| + // First push the frame pointer and context.
|
| + if (kind == StackHandler::JS_ENTRY) {
|
| // The frame pointer does not point to a JS frame so we save NULL for
|
| // ebp. We expect the code throwing an exception to check ebp before
|
| // dereferencing it to restore the context.
|
| push(Immediate(0)); // NULL frame pointer.
|
| push(Immediate(Smi::FromInt(0))); // No context.
|
| - state |= StackHandler::KindField::encode(StackHandler::ENTRY);
|
| + } else {
|
| + push(ebp);
|
| + push(esi);
|
| }
|
| -
|
| // Push the state and the code object.
|
| + unsigned state =
|
| + StackHandler::IndexField::encode(handler_index) |
|
| + StackHandler::KindField::encode(kind);
|
| push(Immediate(state));
|
| Push(CodeObject());
|
|
|
| @@ -904,7 +899,7 @@ void MacroAssembler::ThrowUncatchable(UncatchableExceptionType type,
|
| mov(esp, Operand(esp, StackHandlerConstants::kNextOffset));
|
|
|
| bind(&check_kind);
|
| - STATIC_ASSERT(StackHandler::ENTRY == 0);
|
| + STATIC_ASSERT(StackHandler::JS_ENTRY == 0);
|
| test(Operand(esp, StackHandlerConstants::kStateOffset),
|
| Immediate(StackHandler::KindField::kMask));
|
| j(not_zero, &fetch_next);
|
|
|