Remove assertion from callers of TryCall.

R=ishell@chromium.org
BUG=363280
LOG=N

Review URL: https://codereview.chromium.org/238753003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20748 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
yangguo@chromium.org 2014-04-15 07:56:00 +00:00
parent cd89f90bd1
commit cf7c8181f0
2 changed files with 29 additions and 43 deletions

View File

@ -1127,13 +1127,12 @@ bool Debug::CheckBreakPoint(Handle<Object> break_point_object) {
// Call HandleBreakPointx. // Call HandleBreakPointx.
Handle<Object> argv[] = { break_id, break_point_object }; Handle<Object> argv[] = { break_id, break_point_object };
Handle<Object> result; Handle<Object> result;
ASSIGN_RETURN_ON_EXCEPTION_VALUE( if (!Execution::TryCall(check_break_point,
isolate_, result, isolate_->js_builtins_object(),
Execution::TryCall(check_break_point, ARRAY_SIZE(argv),
isolate_->js_builtins_object(), argv).ToHandle(&result)) {
ARRAY_SIZE(argv), return false;
argv), }
false);
// Return whether the break point is triggered. // Return whether the break point is triggered.
return result->IsTrue(); return result->IsTrue();
@ -2620,8 +2619,7 @@ MaybeHandle<Object> Debugger::MakeExecutionState() {
MaybeHandle<Object> Debugger::MakeBreakEvent(Handle<Object> break_points_hit) { MaybeHandle<Object> Debugger::MakeBreakEvent(Handle<Object> break_points_hit) {
Handle<Object> exec_state; Handle<Object> exec_state;
ASSIGN_RETURN_ON_EXCEPTION( if (!MakeExecutionState().ToHandle(&exec_state)) return MaybeHandle<Object>();
isolate_, exec_state, MakeExecutionState(), Object);
// Create the new break event object. // Create the new break event object.
Handle<Object> argv[] = { exec_state, break_points_hit }; Handle<Object> argv[] = { exec_state, break_points_hit };
return MakeJSObject(CStrVector("MakeBreakEvent"), ARRAY_SIZE(argv), argv); return MakeJSObject(CStrVector("MakeBreakEvent"), ARRAY_SIZE(argv), argv);
@ -2631,8 +2629,7 @@ MaybeHandle<Object> Debugger::MakeBreakEvent(Handle<Object> break_points_hit) {
MaybeHandle<Object> Debugger::MakeExceptionEvent(Handle<Object> exception, MaybeHandle<Object> Debugger::MakeExceptionEvent(Handle<Object> exception,
bool uncaught) { bool uncaught) {
Handle<Object> exec_state; Handle<Object> exec_state;
ASSIGN_RETURN_ON_EXCEPTION( if (!MakeExecutionState().ToHandle(&exec_state)) return MaybeHandle<Object>();
isolate_, exec_state, MakeExecutionState(), Object);
// Create the new exception event object. // Create the new exception event object.
Handle<Object> argv[] = { exec_state, Handle<Object> argv[] = { exec_state,
exception, exception,
@ -2643,24 +2640,21 @@ MaybeHandle<Object> Debugger::MakeExceptionEvent(Handle<Object> exception,
MaybeHandle<Object> Debugger::MakeCompileEvent(Handle<Script> script, MaybeHandle<Object> Debugger::MakeCompileEvent(Handle<Script> script,
bool before) { bool before) {
Factory* factory = isolate_->factory();
// Create the compile event object.
Handle<Object> exec_state; Handle<Object> exec_state;
ASSIGN_RETURN_ON_EXCEPTION( if (!MakeExecutionState().ToHandle(&exec_state)) return MaybeHandle<Object>();
isolate_, exec_state, MakeExecutionState(), Object); // Create the compile event object.
Handle<Object> script_wrapper = GetScriptWrapper(script); Handle<Object> script_wrapper = GetScriptWrapper(script);
Handle<Object> argv[] = { exec_state, Handle<Object> argv[] = { exec_state,
script_wrapper, script_wrapper,
factory->ToBoolean(before) }; isolate_->factory()->ToBoolean(before) };
return MakeJSObject(CStrVector("MakeCompileEvent"), ARRAY_SIZE(argv), argv); return MakeJSObject(CStrVector("MakeCompileEvent"), ARRAY_SIZE(argv), argv);
} }
MaybeHandle<Object> Debugger::MakeScriptCollectedEvent(int id) { MaybeHandle<Object> Debugger::MakeScriptCollectedEvent(int id) {
// Create the script collected event object.
Handle<Object> exec_state; Handle<Object> exec_state;
ASSIGN_RETURN_ON_EXCEPTION( if (!MakeExecutionState().ToHandle(&exec_state)) return MaybeHandle<Object>();
isolate_, exec_state, MakeExecutionState(), Object); // Create the script collected event object.
Handle<Object> id_object = Handle<Smi>(Smi::FromInt(id), isolate_); Handle<Object> id_object = Handle<Smi>(Smi::FromInt(id), isolate_);
Handle<Object> argv[] = { exec_state, id_object }; Handle<Object> argv[] = { exec_state, id_object };
@ -2696,9 +2690,7 @@ void Debugger::OnException(Handle<Object> exception, bool uncaught) {
// Create the event data object. // Create the event data object.
Handle<Object> event_data; Handle<Object> event_data;
// Bail out and don't call debugger if exception. // Bail out and don't call debugger if exception.
ASSIGN_RETURN_ON_EXCEPTION_VALUE( if (!MakeExceptionEvent(exception, uncaught).ToHandle(&event_data)) return;
isolate_, event_data, MakeExceptionEvent(exception, uncaught),
/* void */ ;);
// Process debug event. // Process debug event.
ProcessDebugEvent(v8::Exception, Handle<JSObject>::cast(event_data), false); ProcessDebugEvent(v8::Exception, Handle<JSObject>::cast(event_data), false);
@ -2722,8 +2714,7 @@ void Debugger::OnDebugBreak(Handle<Object> break_points_hit,
// Create the event data object. // Create the event data object.
Handle<Object> event_data; Handle<Object> event_data;
// Bail out and don't call debugger if exception. // Bail out and don't call debugger if exception.
ASSIGN_RETURN_ON_EXCEPTION_VALUE( if (!MakeBreakEvent(break_points_hit).ToHandle(&event_data)) return;
isolate_, event_data, MakeBreakEvent(break_points_hit), /* void */ ;);
// Process debug event. // Process debug event.
ProcessDebugEvent(v8::Break, ProcessDebugEvent(v8::Break,
@ -2747,8 +2738,7 @@ void Debugger::OnBeforeCompile(Handle<Script> script) {
// Create the event data object. // Create the event data object.
Handle<Object> event_data; Handle<Object> event_data;
// Bail out and don't call debugger if exception. // Bail out and don't call debugger if exception.
ASSIGN_RETURN_ON_EXCEPTION_VALUE( if (!MakeCompileEvent(script, true).ToHandle(&event_data)) return;
isolate_, event_data, MakeCompileEvent(script, true), /* void */ ;);
// Process debug event. // Process debug event.
ProcessDebugEvent(v8::BeforeCompile, ProcessDebugEvent(v8::BeforeCompile,
@ -2814,8 +2804,7 @@ void Debugger::OnAfterCompile(Handle<Script> script,
// Create the compile state object. // Create the compile state object.
Handle<Object> event_data; Handle<Object> event_data;
// Bail out and don't call debugger if exception. // Bail out and don't call debugger if exception.
ASSIGN_RETURN_ON_EXCEPTION_VALUE( if (!MakeCompileEvent(script, false).ToHandle(&event_data)) return;
isolate_, event_data, MakeCompileEvent(script, false), /* void */ ;);
// Process debug event. // Process debug event.
ProcessDebugEvent(v8::AfterCompile, Handle<JSObject>::cast(event_data), true); ProcessDebugEvent(v8::AfterCompile, Handle<JSObject>::cast(event_data), true);
@ -2837,8 +2826,7 @@ void Debugger::OnScriptCollected(int id) {
// Create the script collected state object. // Create the script collected state object.
Handle<Object> event_data; Handle<Object> event_data;
// Bail out and don't call debugger if exception. // Bail out and don't call debugger if exception.
ASSIGN_RETURN_ON_EXCEPTION_VALUE( if (!MakeScriptCollectedEvent(id).ToHandle(&event_data)) return;
isolate_, event_data, MakeScriptCollectedEvent(id), /* void */ ;);
// Process debug event. // Process debug event.
ProcessDebugEvent(v8::ScriptCollected, ProcessDebugEvent(v8::ScriptCollected,
@ -2860,8 +2848,8 @@ void Debugger::ProcessDebugEvent(v8::DebugEvent event,
// Create the execution state. // Create the execution state.
Handle<Object> exec_state; Handle<Object> exec_state;
// Bail out and don't call debugger if exception. // Bail out and don't call debugger if exception.
ASSIGN_RETURN_ON_EXCEPTION_VALUE( if (!MakeExecutionState().ToHandle(&exec_state)) return;
isolate_, exec_state, MakeExecutionState(), /* void */ ;);
// First notify the message handler if any. // First notify the message handler if any.
if (message_handler_ != NULL) { if (message_handler_ != NULL) {
NotifyMessageHandler(event, NotifyMessageHandler(event,
@ -3302,10 +3290,9 @@ MaybeHandle<Object> Debugger::Call(Handle<JSFunction> fun,
// Create the execution state. // Create the execution state.
Handle<Object> exec_state; Handle<Object> exec_state;
ASSIGN_RETURN_ON_EXCEPTION_VALUE( if (!MakeExecutionState().ToHandle(&exec_state)) {
isolate_, exec_state, return isolate_->factory()->undefined_value();
MakeExecutionState(), }
isolate_->factory()->undefined_value());
Handle<Object> argv[] = { exec_state, data }; Handle<Object> argv[] = { exec_state, data };
return Execution::Call( return Execution::Call(

View File

@ -740,13 +740,12 @@ Handle<Object> Execution::CharAt(Handle<String> string, uint32_t index) {
Handle<Object> index_object = factory->NewNumberFromInt(int_index); Handle<Object> index_object = factory->NewNumberFromInt(int_index);
Handle<Object> index_arg[] = { index_object }; Handle<Object> index_arg[] = { index_object };
Handle<Object> result; Handle<Object> result;
ASSIGN_RETURN_ON_EXCEPTION_VALUE( if (!TryCall(Handle<JSFunction>::cast(char_at),
isolate, result, string,
TryCall(Handle<JSFunction>::cast(char_at), ARRAY_SIZE(index_arg),
string, index_arg).ToHandle(&result)) {
ARRAY_SIZE(index_arg), return factory->undefined_value();
index_arg), }
factory->undefined_value());
return result; return result;
} }