Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Unified Diff: src/ia32/code-stubs-ia32.cc

Issue 969533004: [turbofan] Implement throwing exceptions into TurboFan code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix code lookup. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/frames.h ('k') | src/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/code-stubs-ia32.cc
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc
index f9bc28dd4bc03240b2f2b280600d442dcdb8c7f1..2eb1debe42a42da7598513de56e1b5f074ab2283 100644
--- a/src/ia32/code-stubs-ia32.cc
+++ b/src/ia32/code-stubs-ia32.cc
@@ -4893,7 +4893,6 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm,
__ mov(eax, return_value_operand);
Label promote_scheduled_exception;
- Label exception_handled;
Label delete_allocated_handles;
Label leave_exit_frame;
@@ -4905,7 +4904,17 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm,
__ Assert(above_equal, kInvalidHandleScopeLevel);
__ cmp(edi, Operand::StaticVariable(limit_address));
__ j(not_equal, &delete_allocated_handles);
+
+ // Leave the API exit frame.
__ bind(&leave_exit_frame);
+ bool restore_context = context_restore_operand != NULL;
+ if (restore_context) {
+ __ mov(esi, *context_restore_operand);
+ }
+ if (stack_space_operand != nullptr) {
+ __ mov(ebx, *stack_space_operand);
+ }
+ __ LeaveApiExitFrame(!restore_context);
// Check if the function scheduled an exception.
ExternalReference scheduled_exception_address =
@@ -4913,7 +4922,6 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm,
__ cmp(Operand::StaticVariable(scheduled_exception_address),
Immediate(isolate->factory()->the_hole_value()));
__ j(not_equal, &promote_scheduled_exception);
- __ bind(&exception_handled);
#if DEBUG
// Check if the function returned a valid JavaScript value.
@@ -4950,14 +4958,6 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm,
__ bind(&ok);
#endif
- bool restore_context = context_restore_operand != NULL;
- if (restore_context) {
- __ mov(esi, *context_restore_operand);
- }
- if (stack_space_operand != nullptr) {
- __ mov(ebx, *stack_space_operand);
- }
- __ LeaveApiExitFrame(!restore_context);
if (stack_space_operand != nullptr) {
DCHECK_EQ(0, stack_space);
__ pop(ecx);
@@ -4967,12 +4967,9 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm,
__ ret(stack_space * kPointerSize);
}
+ // Re-throw by promoting a scheduled exception.
__ bind(&promote_scheduled_exception);
- {
- FrameScope frame(masm, StackFrame::INTERNAL);
- __ CallRuntime(Runtime::kPromoteScheduledException, 0);
- }
- __ jmp(&exception_handled);
+ __ TailCallRuntime(Runtime::kPromoteScheduledException, 0, 1);
// HandleScope limit has changed. Delete allocated extensions.
ExternalReference delete_extensions =
« no previous file with comments | « src/frames.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698