| Index: src/x87/full-codegen-x87.cc
|
| diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc
|
| index 2d1a614ab21208796bcab51658f3bac5eed39dd5..59ff09f2db8f35e8821b5554064bd757c6eeded7 100644
|
| --- a/src/x87/full-codegen-x87.cc
|
| +++ b/src/x87/full-codegen-x87.cc
|
| @@ -95,7 +95,8 @@ class JumpPatchSite BASE_EMBEDDED {
|
| void FullCodeGenerator::Generate() {
|
| CompilationInfo* info = info_;
|
| handler_table_ =
|
| - isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED);
|
| + Handle<HandlerTable>::cast(isolate()->factory()->NewFixedArray(
|
| + HandlerTable::LengthForRange(function()->handler_count()), TENURED));
|
|
|
| profiling_counter_ = isolate()->factory()->NewCell(
|
| Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
|
| @@ -2108,7 +2109,6 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
|
|
|
| // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; }
|
| __ bind(&l_catch);
|
| - handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos()));
|
| __ mov(load_name, isolate()->factory()->throw_string()); // "throw"
|
| __ push(load_name); // "throw"
|
| __ push(Operand(esp, 2 * kPointerSize)); // iter
|
| @@ -2120,16 +2120,17 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
|
| // re-boxing.
|
| __ bind(&l_try);
|
| __ pop(eax); // result
|
| - __ PushTryHandler(StackHandler::CATCH, expr->index());
|
| - const int handler_size = StackHandlerConstants::kSize;
|
| + EnterTryBlock(expr->index(), &l_catch);
|
| + const int try_block_size = TryCatch::kElementCount * kPointerSize;
|
| __ push(eax); // result
|
| __ jmp(&l_suspend);
|
| __ bind(&l_continuation);
|
| __ jmp(&l_resume);
|
| __ bind(&l_suspend);
|
| - const int generator_object_depth = kPointerSize + handler_size;
|
| + const int generator_object_depth = kPointerSize + try_block_size;
|
| __ mov(eax, Operand(esp, generator_object_depth));
|
| __ push(eax); // g
|
| + __ push(Immediate(Smi::FromInt(expr->index()))); // handler-index
|
| DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos()));
|
| __ mov(FieldOperand(eax, JSGeneratorObject::kContinuationOffset),
|
| Immediate(Smi::FromInt(l_continuation.pos())));
|
| @@ -2137,13 +2138,13 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
|
| __ mov(ecx, esi);
|
| __ RecordWriteField(eax, JSGeneratorObject::kContextOffset, ecx, edx,
|
| kDontSaveFPRegs);
|
| - __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1);
|
| + __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 2);
|
| __ mov(context_register(),
|
| Operand(ebp, StandardFrameConstants::kContextOffset));
|
| __ pop(eax); // result
|
| EmitReturnSequence();
|
| __ bind(&l_resume); // received in eax
|
| - __ PopTryHandler();
|
| + ExitTryBlock(expr->index());
|
|
|
| // receiver = iter; f = iter.next; arg = received;
|
| __ bind(&l_next);
|
| @@ -5268,33 +5269,6 @@ void FullCodeGenerator::ExitFinallyBlock() {
|
|
|
| #undef __
|
|
|
| -#define __ ACCESS_MASM(masm())
|
| -
|
| -FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit(
|
| - int* stack_depth,
|
| - int* context_length) {
|
| - // The macros used here must preserve the result register.
|
| -
|
| - // Because the handler block contains the context of the finally
|
| - // code, we can restore it directly from there for the finally code
|
| - // rather than iteratively unwinding contexts via their previous
|
| - // links.
|
| - __ Drop(*stack_depth); // Down to the handler block.
|
| - if (*context_length > 0) {
|
| - // Restore the context to its dedicated register and the stack.
|
| - __ mov(esi, Operand(esp, StackHandlerConstants::kContextOffset));
|
| - __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi);
|
| - }
|
| - __ PopTryHandler();
|
| - __ call(finally_entry_);
|
| -
|
| - *stack_depth = 0;
|
| - *context_length = 0;
|
| - return previous_;
|
| -}
|
| -
|
| -#undef __
|
| -
|
|
|
| static const byte kJnsInstruction = 0x79;
|
| static const byte kJnsOffset = 0x11;
|
|
|