Revision: 20748
Author:   [email protected]
Date:     Tue Apr 15 07:56:00 2014 UTC
Log:      Remove assertion from callers of TryCall.

[email protected]
BUG=363280
LOG=N

Review URL: https://codereview.chromium.org/238753003
http://code.google.com/p/v8/source/detail?r=20748

Modified:
 /branches/bleeding_edge/src/debug.cc
 /branches/bleeding_edge/src/execution.cc

=======================================
--- /branches/bleeding_edge/src/debug.cc        Tue Apr 15 07:47:33 2014 UTC
+++ /branches/bleeding_edge/src/debug.cc        Tue Apr 15 07:56:00 2014 UTC
@@ -1127,13 +1127,12 @@
   // Call HandleBreakPointx.
   Handle<Object> argv[] = { break_id, break_point_object };
   Handle<Object> result;
-  ASSIGN_RETURN_ON_EXCEPTION_VALUE(
-      isolate_, result,
-      Execution::TryCall(check_break_point,
-                         isolate_->js_builtins_object(),
-                         ARRAY_SIZE(argv),
-                         argv),
-      false);
+  if (!Execution::TryCall(check_break_point,
+                          isolate_->js_builtins_object(),
+                          ARRAY_SIZE(argv),
+                          argv).ToHandle(&result)) {
+    return false;
+  }

   // Return whether the break point is triggered.
   return result->IsTrue();
@@ -2620,8 +2619,7 @@

MaybeHandle<Object> Debugger::MakeBreakEvent(Handle<Object> break_points_hit) {
   Handle<Object> exec_state;
-  ASSIGN_RETURN_ON_EXCEPTION(
-      isolate_, exec_state, MakeExecutionState(), Object);
+ if (!MakeExecutionState().ToHandle(&exec_state)) return MaybeHandle<Object>();
   // Create the new break event object.
   Handle<Object> argv[] = { exec_state, break_points_hit };
return MakeJSObject(CStrVector("MakeBreakEvent"), ARRAY_SIZE(argv), argv);
@@ -2631,8 +2629,7 @@
 MaybeHandle<Object> Debugger::MakeExceptionEvent(Handle<Object> exception,
                                                  bool uncaught) {
   Handle<Object> exec_state;
-  ASSIGN_RETURN_ON_EXCEPTION(
-      isolate_, exec_state, MakeExecutionState(), Object);
+ if (!MakeExecutionState().ToHandle(&exec_state)) return MaybeHandle<Object>();
   // Create the new exception event object.
   Handle<Object> argv[] = { exec_state,
                             exception,
@@ -2643,24 +2640,21 @@

 MaybeHandle<Object> Debugger::MakeCompileEvent(Handle<Script> script,
                                                bool before) {
-  Factory* factory = isolate_->factory();
+  Handle<Object> exec_state;
+ if (!MakeExecutionState().ToHandle(&exec_state)) return MaybeHandle<Object>();
   // Create the compile event object.
-  Handle<Object> exec_state;
-  ASSIGN_RETURN_ON_EXCEPTION(
-      isolate_, exec_state, MakeExecutionState(), Object);
   Handle<Object> script_wrapper = GetScriptWrapper(script);
   Handle<Object> argv[] = { exec_state,
                             script_wrapper,
-                            factory->ToBoolean(before) };
+                            isolate_->factory()->ToBoolean(before) };
return MakeJSObject(CStrVector("MakeCompileEvent"), ARRAY_SIZE(argv), argv);
 }


 MaybeHandle<Object> Debugger::MakeScriptCollectedEvent(int id) {
+  Handle<Object> exec_state;
+ if (!MakeExecutionState().ToHandle(&exec_state)) return MaybeHandle<Object>();
   // Create the script collected event object.
-  Handle<Object> exec_state;
-  ASSIGN_RETURN_ON_EXCEPTION(
-      isolate_, exec_state, MakeExecutionState(), Object);
   Handle<Object> id_object = Handle<Smi>(Smi::FromInt(id), isolate_);
   Handle<Object> argv[] = { exec_state, id_object };

@@ -2696,9 +2690,7 @@
   // Create the event data object.
   Handle<Object> event_data;
   // Bail out and don't call debugger if exception.
-  ASSIGN_RETURN_ON_EXCEPTION_VALUE(
-      isolate_, event_data, MakeExceptionEvent(exception, uncaught),
-      /* void */ ;);
+ if (!MakeExceptionEvent(exception, uncaught).ToHandle(&event_data)) return;

   // Process debug event.
ProcessDebugEvent(v8::Exception, Handle<JSObject>::cast(event_data), false);
@@ -2722,8 +2714,7 @@
   // Create the event data object.
   Handle<Object> event_data;
   // Bail out and don't call debugger if exception.
-  ASSIGN_RETURN_ON_EXCEPTION_VALUE(
- isolate_, event_data, MakeBreakEvent(break_points_hit), /* void */ ;);
+  if (!MakeBreakEvent(break_points_hit).ToHandle(&event_data)) return;

   // Process debug event.
   ProcessDebugEvent(v8::Break,
@@ -2747,8 +2738,7 @@
   // Create the event data object.
   Handle<Object> event_data;
   // Bail out and don't call debugger if exception.
-  ASSIGN_RETURN_ON_EXCEPTION_VALUE(
-      isolate_, event_data, MakeCompileEvent(script, true), /* void */ ;);
+  if (!MakeCompileEvent(script, true).ToHandle(&event_data)) return;

   // Process debug event.
   ProcessDebugEvent(v8::BeforeCompile,
@@ -2814,8 +2804,7 @@
   // Create the compile state object.
   Handle<Object> event_data;
   // Bail out and don't call debugger if exception.
-  ASSIGN_RETURN_ON_EXCEPTION_VALUE(
-      isolate_, event_data, MakeCompileEvent(script, false), /* void */ ;);
+  if (!MakeCompileEvent(script, false).ToHandle(&event_data)) return;

   // Process debug event.
ProcessDebugEvent(v8::AfterCompile, Handle<JSObject>::cast(event_data), true);
@@ -2837,8 +2826,7 @@
   // Create the script collected state object.
   Handle<Object> event_data;
   // Bail out and don't call debugger if exception.
-  ASSIGN_RETURN_ON_EXCEPTION_VALUE(
-      isolate_, event_data, MakeScriptCollectedEvent(id), /* void */ ;);
+  if (!MakeScriptCollectedEvent(id).ToHandle(&event_data)) return;

   // Process debug event.
   ProcessDebugEvent(v8::ScriptCollected,
@@ -2860,8 +2848,8 @@
   // Create the execution state.
   Handle<Object> exec_state;
   // Bail out and don't call debugger if exception.
-  ASSIGN_RETURN_ON_EXCEPTION_VALUE(
-      isolate_, exec_state, MakeExecutionState(), /* void */ ;);
+  if (!MakeExecutionState().ToHandle(&exec_state)) return;
+
   // First notify the message handler if any.
   if (message_handler_ != NULL) {
     NotifyMessageHandler(event,
@@ -3302,10 +3290,9 @@

   // Create the execution state.
   Handle<Object> exec_state;
-  ASSIGN_RETURN_ON_EXCEPTION_VALUE(
-      isolate_, exec_state,
-      MakeExecutionState(),
-      isolate_->factory()->undefined_value());
+  if (!MakeExecutionState().ToHandle(&exec_state)) {
+    return isolate_->factory()->undefined_value();
+  }

   Handle<Object> argv[] = { exec_state, data };
   return Execution::Call(
=======================================
--- /branches/bleeding_edge/src/execution.cc    Fri Apr 11 12:47:34 2014 UTC
+++ /branches/bleeding_edge/src/execution.cc    Tue Apr 15 07:56:00 2014 UTC
@@ -740,13 +740,12 @@
   Handle<Object> index_object = factory->NewNumberFromInt(int_index);
   Handle<Object> index_arg[] = { index_object };
   Handle<Object> result;
-  ASSIGN_RETURN_ON_EXCEPTION_VALUE(
-      isolate, result,
-      TryCall(Handle<JSFunction>::cast(char_at),
-              string,
-              ARRAY_SIZE(index_arg),
-              index_arg),
-      factory->undefined_value());
+  if (!TryCall(Handle<JSFunction>::cast(char_at),
+               string,
+               ARRAY_SIZE(index_arg),
+               index_arg).ToHandle(&result)) {
+    return factory->undefined_value();
+  }
   return result;
 }

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to