Commit 035b144b authored by machenbach's avatar machenbach Committed by Commit bot

Revert of Correctly propagate terminate exception in TryCall. (patchset #2...

Revert of Correctly propagate terminate exception in TryCall. (patchset #2 id:20001 of https://codereview.chromium.org/928193002/)

Reason for revert:
See crbug.com/460412 and crbug.com/460356. Reverting on master in order to roll from master again soon.

Original issue's description:
> Correctly propagate terminate exception in TryCall.
>
> BUG=v8:3892
> LOG=Y
>
> Committed: https://crrev.com/a49b55b78844557b65a98e7a77dd26078157ed7f
> Cr-Commit-Position: refs/heads/master@{#26685}

TBR=ishell@chromium.org,yangguo@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:3892

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

Cr-Commit-Position: refs/heads/master@{#26792}
parent 61ac4613
......@@ -210,18 +210,19 @@ MaybeHandle<Object> Execution::TryCall(Handle<JSFunction> func,
DCHECK(catcher.HasCaught());
DCHECK(isolate->has_pending_exception());
DCHECK(isolate->external_caught_exception());
if (isolate->pending_exception() ==
isolate->heap()->termination_exception()) {
is_termination = true;
} else {
if (exception_out != NULL) {
if (exception_out != NULL) {
if (isolate->pending_exception() ==
isolate->heap()->termination_exception()) {
is_termination = true;
} else {
*exception_out = v8::Utils::OpenHandle(*catcher.Exception());
}
}
isolate->OptionalRescheduleException(false);
isolate->OptionalRescheduleException(true);
}
DCHECK(!isolate->has_pending_exception());
DCHECK(!isolate->external_caught_exception());
}
if (is_termination) isolate->TerminateExecution();
return maybe_result;
......
......@@ -474,33 +474,3 @@ TEST(ErrorObjectAfterTermination) {
// TODO(yangguo): crbug/403509. Check for empty handle instead.
CHECK(error->IsUndefined());
}
void InnerTryCallTerminate(const v8::FunctionCallbackInfo<v8::Value>& args) {
CHECK(!v8::V8::IsExecutionTerminating(args.GetIsolate()));
v8::Handle<v8::Object> global = CcTest::global();
v8::Handle<v8::Function> loop =
v8::Handle<v8::Function>::Cast(global->Get(v8_str("loop")));
i::MaybeHandle<i::Object> result =
i::Execution::TryCall(v8::Utils::OpenHandle((*loop)),
v8::Utils::OpenHandle((*global)), 0, NULL, NULL);
CHECK(result.is_null());
CHECK(v8::V8::IsExecutionTerminating(CcTest::isolate()));
}
TEST(TerminationInInnerTryCall) {
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope scope(isolate);
v8::Handle<v8::ObjectTemplate> global_template = CreateGlobalTemplate(
CcTest::isolate(), TerminateCurrentThread, DoLoopNoCall);
global_template->Set(
v8_str("inner_try_call_terminate"),
v8::FunctionTemplate::New(isolate, InnerTryCallTerminate));
v8::Handle<v8::Context> context =
v8::Context::New(CcTest::isolate(), NULL, global_template);
v8::Context::Scope context_scope(context);
v8::TryCatch try_catch;
CompileRun("inner_try_call_terminate()");
CHECK(try_catch.HasTerminated());
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment