| Index: src/mips64/full-codegen-mips64.cc
|
| diff --git a/src/mips64/full-codegen-mips64.cc b/src/mips64/full-codegen-mips64.cc
|
| index 0f157ec1a331e6f6fea91bd24e5c6a9e70bc45dc..525b04a23e9e6af969e13ac0f378f82a3dc7cd77 100644
|
| --- a/src/mips64/full-codegen-mips64.cc
|
| +++ b/src/mips64/full-codegen-mips64.cc
|
| @@ -115,7 +115,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()));
|
| @@ -2182,7 +2183,6 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
|
| // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; }
|
| __ bind(&l_catch);
|
| __ mov(a0, v0);
|
| - handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos()));
|
| __ LoadRoot(a2, Heap::kthrow_stringRootIndex); // "throw"
|
| __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter
|
| __ Push(a2, a3, a0); // "throw", iter, except
|
| @@ -2193,17 +2193,18 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
|
| // re-boxing.
|
| __ bind(&l_try);
|
| __ pop(a0); // 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(a0); // result
|
| __ jmp(&l_suspend);
|
| __ bind(&l_continuation);
|
| __ mov(a0, v0);
|
| __ jmp(&l_resume);
|
| __ bind(&l_suspend);
|
| - const int generator_object_depth = kPointerSize + handler_size;
|
| + const int generator_object_depth = kPointerSize + try_block_size;
|
| __ ld(a0, MemOperand(sp, generator_object_depth));
|
| __ push(a0); // g
|
| + __ Push(Smi::FromInt(expr->index())); // handler-index
|
| DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos()));
|
| __ li(a1, Operand(Smi::FromInt(l_continuation.pos())));
|
| __ sd(a1, FieldMemOperand(a0, JSGeneratorObject::kContinuationOffset));
|
| @@ -2211,13 +2212,13 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
|
| __ mov(a1, cp);
|
| __ RecordWriteField(a0, JSGeneratorObject::kContextOffset, a1, a2,
|
| kRAHasBeenSaved, kDontSaveFPRegs);
|
| - __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1);
|
| + __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 2);
|
| __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| __ pop(v0); // result
|
| EmitReturnSequence();
|
| __ mov(a0, v0);
|
| __ bind(&l_resume); // received in a0
|
| - __ PopTryHandler();
|
| + ExitTryBlock(expr->index());
|
|
|
| // receiver = iter; f = 'next'; arg = received;
|
| __ bind(&l_next);
|
| @@ -5363,34 +5364,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.
|
| - __ ld(cp, MemOperand(sp, StackHandlerConstants::kContextOffset));
|
| - __ sd(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| - }
|
| - __ PopTryHandler();
|
| - __ Call(finally_entry_);
|
| -
|
| - *stack_depth = 0;
|
| - *context_length = 0;
|
| - return previous_;
|
| -}
|
| -
|
| -
|
| -#undef __
|
| -
|
|
|
| void BackEdgeTable::PatchAt(Code* unoptimized_code,
|
| Address pc,
|
|
|