Revision: 12195
Author:   [email protected]
Date:     Wed Jul 25 09:33:32 2012
Log:      Improve API calls that return empty handles.

[email protected]
BUG=v8:2245

Review URL: https://chromiumcodereview.appspot.com/10820014
http://code.google.com/p/v8/source/detail?r=12195

Modified:
 /branches/bleeding_edge/src/ia32/macro-assembler-ia32.cc
 /branches/bleeding_edge/src/x64/macro-assembler-x64.cc

=======================================
--- /branches/bleeding_edge/src/ia32/macro-assembler-ia32.cc Thu Jul 19 07:45:19 2012 +++ /branches/bleeding_edge/src/ia32/macro-assembler-ia32.cc Wed Jul 25 09:33:32 2012
@@ -1924,14 +1924,15 @@
   j(not_equal, &promote_scheduled_exception);
   LeaveApiExitFrame();
   ret(stack_space * kPointerSize);
-  bind(&promote_scheduled_exception);
-  TailCallRuntime(Runtime::kPromoteScheduledException, 0, 1);

   bind(&empty_handle);
   // It was zero; the result is undefined.
   mov(eax, isolate()->factory()->undefined_value());
   jmp(&prologue);

+  bind(&promote_scheduled_exception);
+  TailCallRuntime(Runtime::kPromoteScheduledException, 0, 1);
+
   // HandleScope limit has changed. Delete allocated extensions.
   ExternalReference delete_extensions =
       ExternalReference::delete_handle_scope_extensions(isolate());
=======================================
--- /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Thu Jul 19 07:45:19 2012 +++ /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Wed Jul 25 09:33:32 2012
@@ -746,14 +746,14 @@
   LeaveApiExitFrame();
   ret(stack_space * kPointerSize);

-  bind(&promote_scheduled_exception);
-  TailCallRuntime(Runtime::kPromoteScheduledException, 0, 1);
-
   bind(&empty_result);
   // It was zero; the result is undefined.
-  Move(rax, factory->undefined_value());
+  LoadRoot(rax, Heap::kUndefinedValueRootIndex);
   jmp(&prologue);

+  bind(&promote_scheduled_exception);
+  TailCallRuntime(Runtime::kPromoteScheduledException, 0, 1);
+
   // HandleScope limit has changed. Delete allocated extensions.
   bind(&delete_allocated_handles);
   movq(Operand(base_reg, kLimitOffset), prev_limit_reg);

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to