Reviewers: Jakob, Yang, hablich,
Message:
PTAL
Description:
Version 4.2.77.1
Revert "Correctly propagate terminate exception in TryCall."
This reverts commit a49b55b78844557b65a98e7a77dd26078157ed7f.
[email protected], [email protected], [email protected]
BUG=v8:3892
LOG=n
Please review this at https://codereview.chromium.org/945243002/
Base URL: https://chromium.googlesource.com/v8/[email protected]
Affected files (+8, -37 lines):
M src/execution.cc
M src/version.cc
M test/cctest/test-thread-termination.cc
Index: src/execution.cc
diff --git a/src/execution.cc b/src/execution.cc
index
facd3add5fe6b52aa5e7504caff784afdf421e98..9dfef372bc3db56213264f5d1f64be3fa4e76903
100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -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;
Index: src/version.cc
diff --git a/src/version.cc b/src/version.cc
index
4cc30dfac58c9ce1567ee2f3c1d11a945ea9a32c..a2889bf85d8a9be393f96836cbb2f606f1eb1348
100644
--- a/src/version.cc
+++ b/src/version.cc
@@ -12,7 +12,7 @@
#define MAJOR_VERSION 4
#define MINOR_VERSION 2
#define BUILD_NUMBER 77
-#define PATCH_LEVEL 0
+#define PATCH_LEVEL 1
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
#define IS_CANDIDATE_VERSION 0
Index: test/cctest/test-thread-termination.cc
diff --git a/test/cctest/test-thread-termination.cc
b/test/cctest/test-thread-termination.cc
index
3095b83bdac9592e198781245588d2b3b9320c6a..d31b4131dfcd2e4cf789469416c187ca7c3739a5
100644
--- a/test/cctest/test-thread-termination.cc
+++ b/test/cctest/test-thread-termination.cc
@@ -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());
-}
--
--
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.