Revision: 16858
Author: [email protected]
Date: Fri Sep 20 10:52:20 2013 UTC
Log: remove remaining uses of default isolate in tests
[email protected]
BUG=
Review URL: https://codereview.chromium.org/23929006
http://code.google.com/p/v8/source/detail?r=16858
Modified:
/branches/bleeding_edge/test/cctest/cctest.cc
/branches/bleeding_edge/test/cctest/cctest.h
/branches/bleeding_edge/test/cctest/test-api.cc
/branches/bleeding_edge/test/cctest/test-debug.cc
/branches/bleeding_edge/test/cctest/test-lockers.cc
/branches/bleeding_edge/test/cctest/test-log.cc
/branches/bleeding_edge/test/cctest/test-regexp.cc
/branches/bleeding_edge/test/cctest/test-serialize.cc
/branches/bleeding_edge/test/cctest/test-thread-termination.cc
/branches/bleeding_edge/test/cctest/test-threads.cc
=======================================
--- /branches/bleeding_edge/test/cctest/cctest.cc Thu Sep 19 13:30:47 2013
UTC
+++ /branches/bleeding_edge/test/cctest/cctest.cc Fri Sep 20 10:52:20 2013
UTC
@@ -31,6 +31,7 @@
enum InitializationState {kUnset, kUnintialized, kInitialized};
static InitializationState initialization_state_ = kUnset;
+static bool disable_automatic_dispose_ = false;
CcTest* CcTest::last_ = NULL;
bool CcTest::initialize_called_ = false;
@@ -66,14 +67,10 @@
if (!initialize_) {
CHECK(initialization_state_ != kInitialized);
initialization_state_ = kUnintialized;
- // TODO(dcarney): Remove this when default isolate is gone.
- if (isolate_ == NULL) {
- isolate_ = v8::Isolate::GetCurrent();
- }
+ CHECK(CcTest::isolate_ == NULL);
} else {
CHECK(initialization_state_ != kUnintialized);
initialization_state_ = kInitialized;
- i::Isolate::SetCrashIfDefaultIsolateInitialized();
if (isolate_ == NULL) {
isolate_ = v8::Isolate::New();
}
@@ -99,6 +96,12 @@
CHECK(!context.IsEmpty());
return context;
}
+
+
+void CcTest::DisableAutomaticDispose() {
+ CHECK_EQ(kUnintialized, initialization_state_);
+ disable_automatic_dispose_ = true;
+}
static void PrintTestList(CcTest* current) {
@@ -131,6 +134,7 @@
int main(int argc, char* argv[]) {
v8::V8::InitializeICU();
+ i::Isolate::SetCrashIfDefaultIsolateInitialized();
v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true);
@@ -184,7 +188,7 @@
}
if (print_run_count && tests_run != 1)
printf("Ran %i tests.\n", tests_run);
- v8::V8::Dispose();
+ if (!disable_automatic_dispose_) v8::V8::Dispose();
return 0;
}
=======================================
--- /branches/bleeding_edge/test/cctest/cctest.h Thu Sep 19 13:30:47 2013
UTC
+++ /branches/bleeding_edge/test/cctest/cctest.h Fri Sep 20 10:52:20 2013
UTC
@@ -93,6 +93,7 @@
bool enabled() { return enabled_; }
static v8::Isolate* isolate() {
+ CHECK(isolate_ != NULL);
isolate_used_ = true;
return isolate_;
}
@@ -114,6 +115,9 @@
v8::HandleScope handle_scope(CcTest::isolate());
v8::Context::New(CcTest::isolate())->Enter();
}
+
+ // Only for UNINITIALIZED_TESTs
+ static void DisableAutomaticDispose();
// Helper function to configure a context.
// Must be in a HandleScope.
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc Thu Sep 19 10:31:04
2013 UTC
+++ /branches/bleeding_edge/test/cctest/test-api.cc Fri Sep 20 10:52:20
2013 UTC
@@ -12446,28 +12446,28 @@
// Lets not be needlessly self-referential.
-UNINITIALIZED_TEST(Threading1) {
+TEST(Threading1) {
ApiTestFuzzer::SetUp(ApiTestFuzzer::FIRST_PART);
ApiTestFuzzer::RunAllTests();
ApiTestFuzzer::TearDown();
}
-UNINITIALIZED_TEST(Threading2) {
+TEST(Threading2) {
ApiTestFuzzer::SetUp(ApiTestFuzzer::SECOND_PART);
ApiTestFuzzer::RunAllTests();
ApiTestFuzzer::TearDown();
}
-UNINITIALIZED_TEST(Threading3) {
+TEST(Threading3) {
ApiTestFuzzer::SetUp(ApiTestFuzzer::THIRD_PART);
ApiTestFuzzer::RunAllTests();
ApiTestFuzzer::TearDown();
}
-UNINITIALIZED_TEST(Threading4) {
+TEST(Threading4) {
ApiTestFuzzer::SetUp(ApiTestFuzzer::FOURTH_PART);
ApiTestFuzzer::RunAllTests();
ApiTestFuzzer::TearDown();
@@ -12475,6 +12475,7 @@
void ApiTestFuzzer::CallTest() {
+ v8::Isolate::Scope scope(CcTest::isolate());
if (kLogThreading)
printf("Start test %d\n", test_number_);
CallTestNumber(test_number_);
@@ -14257,6 +14258,7 @@
while (gc_during_regexp_ < kRequiredGCs) {
{
v8::Locker lock(CcTest::isolate());
+ v8::Isolate::Scope isolate_scope(CcTest::isolate());
// TODO(lrn): Perhaps create some garbage before collecting.
CcTest::heap()->CollectAllGarbage(i::Heap::kNoGCFlags);
gc_count_++;
@@ -14315,9 +14317,8 @@
// Test that a regular expression execution can be interrupted and
// survive a garbage collection.
-UNINITIALIZED_TEST(RegExpInterruption) {
+TEST(RegExpInterruption) {
v8::Locker lock(CcTest::isolate());
- v8::V8::Initialize();
v8::HandleScope scope(CcTest::isolate());
Local<Context> local_env;
{
@@ -14379,6 +14380,7 @@
while (gc_during_apply_ < kRequiredGCs) {
{
v8::Locker lock(CcTest::isolate());
+ v8::Isolate::Scope isolate_scope(CcTest::isolate());
CcTest::heap()->CollectAllGarbage(i::Heap::kNoGCFlags);
gc_count_++;
}
@@ -14423,7 +14425,7 @@
// Test that nothing bad happens if we get a preemption just when we were
// about to do an apply().
-UNINITIALIZED_TEST(ApplyInterruption) {
+TEST(ApplyInterruption) {
v8::Locker lock(CcTest::isolate());
v8::V8::Initialize();
v8::HandleScope scope(CcTest::isolate());
@@ -14694,6 +14696,7 @@
morphs_ < kMaxModifications) {
{
v8::Locker lock(CcTest::isolate());
+ v8::Isolate::Scope isolate_scope(CcTest::isolate());
// Swap string between ascii and two-byte representation.
i::String* string = *input_;
MorphAString(string, &ascii_resource_, &uc16_resource_);
@@ -14740,9 +14743,8 @@
// Test that a regular expression execution can be interrupted and
// the string changed without failing.
-UNINITIALIZED_TEST(RegExpStringModification) {
+TEST(RegExpStringModification) {
v8::Locker lock(CcTest::isolate());
- v8::V8::Initialize();
v8::HandleScope scope(CcTest::isolate());
Local<Context> local_env;
{
@@ -19738,7 +19740,9 @@
UNINITIALIZED_TEST(IsolateEmbedderData) {
- v8::Isolate* isolate = CcTest::isolate();
+ CcTest::DisableAutomaticDispose();
+ v8::Isolate* isolate = v8::Isolate::New();
+ isolate->Enter();
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
CHECK_EQ(NULL, isolate->GetData());
CHECK_EQ(NULL, i_isolate->GetData());
=======================================
--- /branches/bleeding_edge/test/cctest/test-debug.cc Thu Sep 19 09:56:09
2013 UTC
+++ /branches/bleeding_edge/test/cctest/test-debug.cc Fri Sep 20 10:52:20
2013 UTC
@@ -5142,7 +5142,7 @@
"\n"
"foo();\n";
- v8::V8::Initialize();
+ v8::Isolate::Scope isolate_scope(CcTest::isolate());
DebugLocalContext env;
v8::HandleScope scope(env->GetIsolate());
v8::Debug::SetMessageHandler2(&ThreadedMessageHandler);
@@ -5179,7 +5179,7 @@
}
-UNINITIALIZED_TEST(ThreadedDebugging) {
+TEST(ThreadedDebugging) {
DebuggerThread debugger_thread;
V8Thread v8_thread;
@@ -5258,9 +5258,10 @@
const char* source_2 = "cat(17);\n"
"cat(19);\n";
- v8::V8::Initialize();
+ v8::Isolate* isolate = CcTest::isolate();
+ v8::Isolate::Scope isolate_scope(isolate);
DebugLocalContext env;
- v8::HandleScope scope(env->GetIsolate());
+ v8::HandleScope scope(isolate);
v8::Debug::SetMessageHandler2(&BreakpointsMessageHandler);
CompileRun(source_1);
@@ -5333,6 +5334,7 @@
v8::Isolate* isolate = CcTest::isolate();
+ v8::Isolate::Scope isolate_scope(isolate);
// v8 thread initializes, runs source_1
breakpoints_barriers->barrier_1.Wait();
// 1:Set breakpoint in cat() (will get id 1).
@@ -5403,12 +5405,12 @@
}
-UNINITIALIZED_TEST(RecursiveBreakpoints) {
+TEST(RecursiveBreakpoints) {
TestRecursiveBreakpointsGeneric(false);
}
-UNINITIALIZED_TEST(RecursiveBreakpointsGlobal) {
+TEST(RecursiveBreakpointsGlobal) {
TestRecursiveBreakpointsGeneric(true);
}
@@ -5789,7 +5791,7 @@
"\n";
const char* source_2 = "cat(17);\n";
- v8::V8::Initialize();
+ v8::Isolate::Scope isolate_scope(CcTest::isolate());
DebugLocalContext env;
v8::HandleScope scope(env->GetIsolate());
@@ -5832,7 +5834,7 @@
}
-UNINITIALIZED_TEST(DebuggerHostDispatch) {
+TEST(DebuggerHostDispatch) {
HostDispatchDebuggerThread host_dispatch_debugger_thread;
HostDispatchV8Thread host_dispatch_v8_thread;
i::FLAG_debugger_auto_break = true;
@@ -5877,7 +5879,7 @@
void DebugMessageDispatchV8Thread::Run() {
- v8::V8::Initialize();
+ v8::Isolate::Scope isolate_scope(CcTest::isolate());
DebugLocalContext env;
v8::HandleScope scope(env->GetIsolate());
@@ -5898,7 +5900,7 @@
}
-UNINITIALIZED_TEST(DebuggerDebugMessageDispatch) {
+TEST(DebuggerDebugMessageDispatch) {
DebugMessageDispatchDebuggerThread
debug_message_dispatch_debugger_thread;
DebugMessageDispatchV8Thread debug_message_dispatch_v8_thread;
@@ -6363,13 +6365,13 @@
// Keep forcing breaks.
if (break_point_hit_count < 20) {
- v8::Debug::DebugBreak();
+ v8::Debug::DebugBreak(CcTest::isolate());
}
}
}
-UNINITIALIZED_TEST(RegExpDebugBreak) {
+TEST(RegExpDebugBreak) {
// This test only applies to native regexps.
DebugLocalContext env;
v8::HandleScope scope(env->GetIsolate());
@@ -6805,7 +6807,7 @@
// Test that if DebugBreak is forced it is ignored when code from
// debug-delay.js is executed.
-UNINITIALIZED_TEST(NoDebugBreakInAfterCompileMessageHandler) {
+TEST(NoDebugBreakInAfterCompileMessageHandler) {
DebugLocalContext env;
v8::HandleScope scope(env->GetIsolate());
@@ -6813,7 +6815,7 @@
v8::Debug::SetMessageHandler2(BreakMessageHandler);
// Set the debug break flag.
- v8::Debug::DebugBreak();
+ v8::Debug::DebugBreak(env->GetIsolate());
// Create a function for testing stepping.
const char* src = "function f() { eval('var x = 10;'); } ";
=======================================
--- /branches/bleeding_edge/test/cctest/test-lockers.cc Thu Sep 19 10:31:04
2013 UTC
+++ /branches/bleeding_edge/test/cctest/test-lockers.cc Fri Sep 20 10:52:20
2013 UTC
@@ -610,6 +610,7 @@
virtual void Run() {
v8::Locker lock1(CcTest::isolate());
{
+ v8::Isolate::Scope isolate_scope(CcTest::isolate());
v8::HandleScope handle_scope(CcTest::isolate());
v8::Local<v8::Context> context =
v8::Local<v8::Context>::New(CcTest::isolate(), context_);
@@ -620,6 +621,7 @@
v8::Unlocker unlock1(CcTest::isolate());
{
v8::Locker lock2(CcTest::isolate());
+ v8::Isolate::Scope isolate_scope(CcTest::isolate());
v8::HandleScope handle_scope(CcTest::isolate());
v8::Local<v8::Context> context =
v8::Local<v8::Context>::New(CcTest::isolate(), context_);
@@ -635,7 +637,7 @@
// Locker inside an Unlocker inside a Locker for default isolate.
-UNINITIALIZED_TEST(LockUnlockLockDefaultIsolateMultithreaded) {
+TEST(LockUnlockLockDefaultIsolateMultithreaded) {
#if V8_TARGET_ARCH_MIPS
const int kNThreads = 50;
#else
@@ -645,6 +647,7 @@
i::List<JoinableThread*> threads(kNThreads);
{
v8::Locker locker_(CcTest::isolate());
+ v8::Isolate::Scope isolate_scope(CcTest::isolate());
v8::HandleScope handle_scope(CcTest::isolate());
context = v8::Context::New(CcTest::isolate());
for (int i = 0; i < kNThreads; i++) {
=======================================
--- /branches/bleeding_edge/test/cctest/test-log.cc Fri Sep 20 08:49:33
2013 UTC
+++ /branches/bleeding_edge/test/cctest/test-log.cc Fri Sep 20 10:52:20
2013 UTC
@@ -326,7 +326,7 @@
}
-UNINITIALIZED_TEST(LogCallbacks) {
+TEST(LogCallbacks) {
ScopedLoggerInitializer initialize_logger;
Logger* logger = initialize_logger.logger();
@@ -375,7 +375,7 @@
}
-UNINITIALIZED_TEST(LogAccessorCallbacks) {
+TEST(LogAccessorCallbacks) {
ScopedLoggerInitializer initialize_logger;
Logger* logger = initialize_logger.logger();
@@ -422,7 +422,7 @@
// Test that logging of code create / move events is equivalent to
traversal of
// a resulting heap.
-UNINITIALIZED_TEST(EquivalenceOfLoggingAndTraversal) {
+TEST(EquivalenceOfLoggingAndTraversal) {
// This test needs to be run on a "clean" V8 to ensure that snapshot log
// is loaded. This is always true when running using tools/test.py
because
// it launches a new cctest instance for every test. To be sure that
launching
=======================================
--- /branches/bleeding_edge/test/cctest/test-regexp.cc Thu Sep 19 09:17:13
2013 UTC
+++ /branches/bleeding_edge/test/cctest/test-regexp.cc Fri Sep 20 10:52:20
2013 UTC
@@ -403,8 +403,7 @@
}
-UNINITIALIZED_TEST(Errors) {
- V8::Initialize(NULL);
+TEST(Errors) {
const char* kEndBackslash = "\\ at end of pattern";
ExpectError("\\", kEndBackslash);
const char* kUnterminatedGroup = "Unterminated group";
=======================================
--- /branches/bleeding_edge/test/cctest/test-serialize.cc Thu Sep 19
12:06:27 2013 UTC
+++ /branches/bleeding_edge/test/cctest/test-serialize.cc Fri Sep 20
10:52:20 2013 UTC
@@ -264,7 +264,7 @@
// Test that the whole heap can be serialized.
-UNINITIALIZED_TEST(Serialize) {
+TEST(Serialize) {
if (!Snapshot::HaveASnapshotToStartFrom()) {
Serializer::Enable(CcTest::i_isolate());
v8::V8::Initialize();
@@ -274,7 +274,7 @@
// Test that heap serialization is non-destructive.
-UNINITIALIZED_TEST(SerializeTwice) {
+TEST(SerializeTwice) {
if (!Snapshot::HaveASnapshotToStartFrom()) {
Serializer::Enable(CcTest::i_isolate());
v8::V8::Initialize();
@@ -372,7 +372,7 @@
}
-UNINITIALIZED_TEST(PartialSerialization) {
+TEST(PartialSerialization) {
if (!Snapshot::HaveASnapshotToStartFrom()) {
Isolate* isolate = CcTest::i_isolate();
Serializer::Enable(isolate);
@@ -523,7 +523,7 @@
}
-UNINITIALIZED_TEST(ContextSerialization) {
+TEST(ContextSerialization) {
if (!Snapshot::HaveASnapshotToStartFrom()) {
Isolate* isolate = CcTest::i_isolate();
Serializer::Enable(isolate);
=======================================
--- /branches/bleeding_edge/test/cctest/test-thread-termination.cc Thu Sep
19 09:17:13 2013 UTC
+++ /branches/bleeding_edge/test/cctest/test-thread-termination.cc Fri Sep
20 10:52:20 2013 UTC
@@ -39,7 +39,7 @@
void TerminateCurrentThread(const v8::FunctionCallbackInfo<v8::Value>&
args) {
- CHECK(!v8::V8::IsExecutionTerminating());
+ CHECK(!v8::V8::IsExecutionTerminating(args.GetIsolate()));
v8::V8::TerminateExecution(args.GetIsolate());
}
@@ -50,18 +50,18 @@
void Loop(const v8::FunctionCallbackInfo<v8::Value>& args) {
- CHECK(!v8::V8::IsExecutionTerminating());
+ CHECK(!v8::V8::IsExecutionTerminating(args.GetIsolate()));
v8::Handle<v8::String> source =
v8::String::New("try { doloop(); fail(); } catch(e) { fail(); }");
v8::Handle<v8::Value> result = v8::Script::Compile(source)->Run();
CHECK(result.IsEmpty());
- CHECK(v8::V8::IsExecutionTerminating());
+ CHECK(v8::V8::IsExecutionTerminating(args.GetIsolate()));
}
void DoLoop(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::TryCatch try_catch;
- CHECK(!v8::V8::IsExecutionTerminating());
+ CHECK(!v8::V8::IsExecutionTerminating(args.GetIsolate()));
v8::Script::Compile(v8::String::New("function f() {"
" var term = true;"
" try {"
@@ -79,13 +79,13 @@
CHECK(try_catch.Exception()->IsNull());
CHECK(try_catch.Message().IsEmpty());
CHECK(!try_catch.CanContinue());
- CHECK(v8::V8::IsExecutionTerminating());
+ CHECK(v8::V8::IsExecutionTerminating(args.GetIsolate()));
}
void DoLoopNoCall(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::TryCatch try_catch;
- CHECK(!v8::V8::IsExecutionTerminating());
+ CHECK(!v8::V8::IsExecutionTerminating(args.GetIsolate()));
v8::Script::Compile(v8::String::New("var term = true;"
"while(true) {"
" if (term) terminate();"
@@ -95,7 +95,7 @@
CHECK(try_catch.Exception()->IsNull());
CHECK(try_catch.Message().IsEmpty());
CHECK(!try_catch.CanContinue());
- CHECK(v8::V8::IsExecutionTerminating());
+ CHECK(v8::V8::IsExecutionTerminating(args.GetIsolate()));
}
@@ -121,13 +121,13 @@
v8::Handle<v8::Context> context =
v8::Context::New(CcTest::isolate(), NULL, global);
v8::Context::Scope context_scope(context);
- CHECK(!v8::V8::IsExecutionTerminating());
+ CHECK(!v8::V8::IsExecutionTerminating(CcTest::isolate()));
// Run a loop that will be infinite if thread termination does not work.
v8::Handle<v8::String> source =
v8::String::New("try { loop(); fail(); } catch(e) { fail(); }");
v8::Script::Compile(source)->Run();
// Test that we can run the code again after thread termination.
- CHECK(!v8::V8::IsExecutionTerminating());
+ CHECK(!v8::V8::IsExecutionTerminating(CcTest::isolate()));
v8::Script::Compile(source)->Run();
}
@@ -141,12 +141,12 @@
v8::Handle<v8::Context> context =
v8::Context::New(CcTest::isolate(), NULL, global);
v8::Context::Scope context_scope(context);
- CHECK(!v8::V8::IsExecutionTerminating());
+ CHECK(!v8::V8::IsExecutionTerminating(CcTest::isolate()));
// Run a loop that will be infinite if thread termination does not work.
v8::Handle<v8::String> source =
v8::String::New("try { loop(); fail(); } catch(e) { fail(); }");
v8::Script::Compile(source)->Run();
- CHECK(!v8::V8::IsExecutionTerminating());
+ CHECK(!v8::V8::IsExecutionTerminating(CcTest::isolate()));
// Test that we can run the code again after thread termination.
v8::Script::Compile(source)->Run();
}
@@ -180,7 +180,7 @@
v8::Handle<v8::Context> context =
v8::Context::New(CcTest::isolate(), NULL, global);
v8::Context::Scope context_scope(context);
- CHECK(!v8::V8::IsExecutionTerminating());
+ CHECK(!v8::V8::IsExecutionTerminating(CcTest::isolate()));
// Run a loop that will be infinite if thread termination does not work.
v8::Handle<v8::String> source =
v8::String::New("try { loop(); fail(); } catch(e) { fail(); }");
@@ -197,8 +197,8 @@
void TerminateOrReturnObject(const v8::FunctionCallbackInfo<v8::Value>&
args) {
if (++call_count == 10) {
- CHECK(!v8::V8::IsExecutionTerminating());
- v8::V8::TerminateExecution();
+ CHECK(!v8::V8::IsExecutionTerminating(args.GetIsolate()));
+ v8::V8::TerminateExecution(args.GetIsolate());
return;
}
v8::Local<v8::Object> result = v8::Object::New();
@@ -209,7 +209,7 @@
void LoopGetProperty(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::TryCatch try_catch;
- CHECK(!v8::V8::IsExecutionTerminating());
+ CHECK(!v8::V8::IsExecutionTerminating(args.GetIsolate()));
v8::Script::Compile(v8::String::New("function f() {"
" try {"
" while(true) {"
@@ -225,13 +225,13 @@
CHECK(try_catch.Exception()->IsNull());
CHECK(try_catch.Message().IsEmpty());
CHECK(!try_catch.CanContinue());
- CHECK(v8::V8::IsExecutionTerminating());
+ CHECK(v8::V8::IsExecutionTerminating(args.GetIsolate()));
}
// Test that we correctly handle termination exceptions if they are
// triggered by the creation of error objects in connection with ICs.
-UNINITIALIZED_TEST(TerminateLoadICException) {
+TEST(TerminateLoadICException) {
v8::HandleScope scope(CcTest::isolate());
v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New();
global->Set(v8::String::New("terminate_or_return_object"),
@@ -243,14 +243,14 @@
v8::Handle<v8::Context> context =
v8::Context::New(CcTest::isolate(), NULL, global);
v8::Context::Scope context_scope(context);
- CHECK(!v8::V8::IsExecutionTerminating());
+ CHECK(!v8::V8::IsExecutionTerminating(CcTest::isolate()));
// Run a loop that will be infinite if thread termination does not work.
v8::Handle<v8::String> source =
v8::String::New("try { loop(); fail(); } catch(e) { fail(); }");
call_count = 0;
v8::Script::Compile(source)->Run();
// Test that we can run the code again after thread termination.
- CHECK(!v8::V8::IsExecutionTerminating());
+ CHECK(!v8::V8::IsExecutionTerminating(CcTest::isolate()));
call_count = 0;
v8::Script::Compile(source)->Run();
}
@@ -258,7 +258,7 @@
void ReenterAfterTermination(const v8::FunctionCallbackInfo<v8::Value>&
args) {
v8::TryCatch try_catch;
- CHECK(!v8::V8::IsExecutionTerminating());
+ CHECK(!v8::V8::IsExecutionTerminating(args.GetIsolate()));
v8::Script::Compile(v8::String::New("function f() {"
" var term = true;"
" try {"
@@ -276,7 +276,7 @@
CHECK(try_catch.Exception()->IsNull());
CHECK(try_catch.Message().IsEmpty());
CHECK(!try_catch.CanContinue());
- CHECK(v8::V8::IsExecutionTerminating());
+ CHECK(v8::V8::IsExecutionTerminating(args.GetIsolate()));
v8::Script::Compile(v8::String::New("function f() { fail(); }
f()"))->Run();
}
@@ -294,7 +294,7 @@
v8::Handle<v8::String> source =
v8::String::New("try { loop(); fail(); } catch(e) { fail(); }");
v8::Script::Compile(source)->Run();
- CHECK(!v8::V8::IsExecutionTerminating());
+ CHECK(!v8::V8::IsExecutionTerminating(CcTest::isolate()));
// Check we can run JS again after termination.
CHECK(v8::Script::Compile(v8::String::New("function f() { return true; }"
"f()"))->Run()->IsTrue());
@@ -330,7 +330,7 @@
CreateGlobalTemplate(TerminateCurrentThread, DoLoopCancelTerminate);
v8::Handle<v8::Context> context = v8::Context::New(isolate, NULL,
global);
v8::Context::Scope context_scope(context);
- CHECK(!v8::V8::IsExecutionTerminating());
+ CHECK(!v8::V8::IsExecutionTerminating(CcTest::isolate()));
v8::Handle<v8::String> source =
v8::String::New("try { doloop(); } catch(e) { fail();
} 'completed';");
// Check that execution completed with correct return value.
=======================================
--- /branches/bleeding_edge/test/cctest/test-threads.cc Thu Sep 19 09:56:09
2013 UTC
+++ /branches/bleeding_edge/test/cctest/test-threads.cc Fri Sep 20 10:52:20
2013 UTC
@@ -71,6 +71,7 @@
void Run() {
v8::Isolate* isolate = CcTest::isolate();
v8::Locker locker(isolate);
+ v8::Isolate::Scope isolate_scope(isolate);
v8::HandleScope scope(isolate);
v8::Handle<v8::Context> context = v8::Context::New(isolate);
v8::Context::Scope context_scope(context);
@@ -111,6 +112,7 @@
{
v8::Isolate* isolate = CcTest::isolate();
v8::Locker locker(isolate);
+ v8::Isolate::Scope isolate_scope(isolate);
if (turn == CLEAN_CACHE) {
v8::HandleScope scope(isolate);
v8::Handle<v8::Context> context = v8::Context::New(isolate);
@@ -129,9 +131,7 @@
};
-UNINITIALIZED_TEST(JSFunctionResultCachesInTwoThreads) {
- v8::V8::Initialize();
-
+TEST(JSFunctionResultCachesInTwoThreads) {
ThreadA threadA;
ThreadB threadB;
--
--
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/groups/opt_out.