Index: src/arm64/full-codegen-arm64.cc |
diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc |
index 063db979e7b29421006f058da6270bf87b318abe..015ec188cd8164f4a2f5d2544f462f11f7d11caa 100644 |
--- a/src/arm64/full-codegen-arm64.cc |
+++ b/src/arm64/full-codegen-arm64.cc |
@@ -105,7 +105,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())); |
@@ -5043,7 +5044,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())); |
__ LoadRoot(load_name, Heap::kthrow_stringRootIndex); // "throw" |
__ Peek(x3, 1 * kPointerSize); // iter |
__ Push(load_name, x3, x0); // "throw", iter, except |
@@ -5054,8 +5054,8 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
// re-boxing. |
__ Bind(&l_try); |
__ Pop(x0); // 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(x0); // result |
__ B(&l_suspend); |
@@ -5066,9 +5066,10 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
__ B(&l_resume); |
__ Bind(&l_suspend); |
- const int generator_object_depth = kPointerSize + handler_size; |
+ const int generator_object_depth = kPointerSize + try_block_size; |
__ Peek(x0, generator_object_depth); |
__ Push(x0); // g |
+ __ Push(Smi::FromInt(expr->index())); // handler-index |
DCHECK((l_continuation.pos() > 0) && Smi::IsValid(l_continuation.pos())); |
__ Mov(x1, Smi::FromInt(l_continuation.pos())); |
__ Str(x1, FieldMemOperand(x0, JSGeneratorObject::kContinuationOffset)); |
@@ -5076,12 +5077,12 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
__ Mov(x1, cp); |
__ RecordWriteField(x0, JSGeneratorObject::kContextOffset, x1, x2, |
kLRHasBeenSaved, kDontSaveFPRegs); |
- __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1); |
+ __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 2); |
__ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
__ Pop(x0); // result |
EmitReturnSequence(); |
__ Bind(&l_resume); // received in x0 |
- __ PopTryHandler(); |
+ ExitTryBlock(expr->index()); |
// receiver = iter; f = 'next'; arg = received; |
__ Bind(&l_next); |
@@ -5474,37 +5475,6 @@ BackEdgeTable::BackEdgeState BackEdgeTable::GetBackEdgeState( |
} |
-#define __ ACCESS_MASM(masm()) |
- |
- |
-FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit( |
- int* stack_depth, |
- int* context_length) { |
- ASM_LOCATION("FullCodeGenerator::TryFinally::Exit"); |
- // 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. |
- __ Peek(cp, StackHandlerConstants::kContextOffset); |
- __ Str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
- } |
- __ PopTryHandler(); |
- __ Bl(finally_entry_); |
- |
- *stack_depth = 0; |
- *context_length = 0; |
- return previous_; |
-} |
- |
- |
-#undef __ |
- |
- |
} } // namespace v8::internal |
#endif // V8_TARGET_ARCH_ARM64 |