Revision: 20879
Author: [email protected]
Date: Tue Apr 22 10:45:43 2014 UTC
Log: Revert "Simplify v8/Isolate teardown."
This reverts commit r20876, it broke non-snapshot tests.
[email protected]
http://code.google.com/p/v8/source/detail?r=20879
Modified:
/branches/bleeding_edge/samples/lineprocessor.cc
/branches/bleeding_edge/samples/process.cc
/branches/bleeding_edge/samples/shell.cc
/branches/bleeding_edge/src/api.cc
/branches/bleeding_edge/src/d8.cc
/branches/bleeding_edge/src/isolate.cc
/branches/bleeding_edge/src/mksnapshot.cc
/branches/bleeding_edge/src/serialize.cc
/branches/bleeding_edge/src/v8.cc
/branches/bleeding_edge/test/cctest/cctest.cc
/branches/bleeding_edge/test/cctest/test-api.cc
/branches/bleeding_edge/test/cctest/test-microtask-delivery.cc
/branches/bleeding_edge/tools/lexer-shell.cc
/branches/bleeding_edge/tools/parser-shell.cc
=======================================
--- /branches/bleeding_edge/samples/lineprocessor.cc Tue Apr 22 09:24:56
2014 UTC
+++ /branches/bleeding_edge/samples/lineprocessor.cc Tue Apr 22 10:45:43
2014 UTC
@@ -328,7 +328,6 @@
int main(int argc, char* argv[]) {
v8::V8::InitializeICU();
- v8::V8::Initialize();
int result = RunMain(argc, argv);
v8::V8::Dispose();
return result;
=======================================
--- /branches/bleeding_edge/samples/process.cc Tue Apr 22 09:24:56 2014 UTC
+++ /branches/bleeding_edge/samples/process.cc Tue Apr 22 10:45:43 2014 UTC
@@ -644,7 +644,6 @@
int main(int argc, char* argv[]) {
v8::V8::InitializeICU();
- v8::V8::Initialize();
map<string, string> options;
string file;
ParseOptions(argc, argv, options, &file);
=======================================
--- /branches/bleeding_edge/samples/shell.cc Tue Apr 22 09:24:56 2014 UTC
+++ /branches/bleeding_edge/samples/shell.cc Tue Apr 22 10:45:43 2014 UTC
@@ -67,7 +67,6 @@
int main(int argc, char* argv[]) {
v8::V8::InitializeICU();
- v8::V8::Initialize();
v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
v8::Isolate* isolate = v8::Isolate::GetCurrent();
run_shell = (argc == 1);
=======================================
--- /branches/bleeding_edge/src/api.cc Tue Apr 22 09:32:42 2014 UTC
+++ /branches/bleeding_edge/src/api.cc Tue Apr 22 10:45:43 2014 UTC
@@ -4996,6 +4996,12 @@
bool v8::V8::Dispose() {
+ i::Isolate* isolate = i::Isolate::Current();
+ if (!Utils::ApiCheck(isolate != NULL && isolate->IsDefaultIsolate(),
+ "v8::V8::Dispose()",
+ "Use v8::Isolate::Dispose() for non-default
isolate.")) {
+ return false;
+ }
i::V8::TearDown();
return true;
}
=======================================
--- /branches/bleeding_edge/src/d8.cc Tue Apr 22 09:24:56 2014 UTC
+++ /branches/bleeding_edge/src/d8.cc Tue Apr 22 10:45:43 2014 UTC
@@ -1678,7 +1678,6 @@
int Shell::Main(int argc, char* argv[]) {
if (!SetOptions(argc, argv)) return 1;
v8::V8::InitializeICU(options.icu_data_file);
- v8::V8::Initialize();
#ifndef V8_SHARED
i::FLAG_trace_hydrogen_file = "hydrogen.cfg";
i::FLAG_redirect_code_traces_to = "code.asm";
@@ -1693,7 +1692,7 @@
v8::V8::SetArrayBufferAllocator(&array_buffer_allocator);
}
int result = 0;
- Isolate* isolate = Isolate::New();
+ Isolate* isolate = Isolate::GetCurrent();
#ifndef V8_SHARED
v8::ResourceConstraints constraints;
constraints.ConfigureDefaults(i::OS::TotalPhysicalMemory(),
@@ -1704,7 +1703,6 @@
DumbLineEditor dumb_line_editor(isolate);
{
Initialize(isolate);
- Isolate::Scope isolate_scope(isolate);
#ifdef ENABLE_VTUNE_JIT_INTERFACE
vTune::InitializeVtuneForV8();
#endif
@@ -1767,7 +1765,6 @@
RunShell(isolate);
}
}
- isolate->Dispose();
V8::Dispose();
OnExit();
=======================================
--- /branches/bleeding_edge/src/isolate.cc Tue Apr 22 09:24:56 2014 UTC
+++ /branches/bleeding_edge/src/isolate.cc Tue Apr 22 10:45:43 2014 UTC
@@ -1551,7 +1551,9 @@
serialize_partial_snapshot_cache_ = NULL;
}
- delete this;
+ if (!IsDefaultIsolate()) {
+ delete this;
+ }
// Restore the previous current isolate.
SetIsolateThreadLocals(saved_isolate, saved_data);
=======================================
--- /branches/bleeding_edge/src/mksnapshot.cc Tue Apr 22 09:24:56 2014 UTC
+++ /branches/bleeding_edge/src/mksnapshot.cc Tue Apr 22 10:45:43 2014 UTC
@@ -271,8 +271,6 @@
int main(int argc, char** argv) {
V8::InitializeICU();
- // TODO(svenpanne) We can't do this here currently, although we should!
- // v8::V8::Initialize();
i::Isolate::SetCrashIfDefaultIsolateInitialized();
// By default, log code create information in the snapshot.
@@ -412,7 +410,6 @@
ser.CurrentAllocationAddress(i::CELL_SPACE),
ser.CurrentAllocationAddress(i::PROPERTY_CELL_SPACE));
isolate->Exit();
- i::Serializer::TearDown();
isolate->Dispose();
V8::Dispose();
return 0;
=======================================
--- /branches/bleeding_edge/src/serialize.cc Tue Apr 22 09:24:56 2014 UTC
+++ /branches/bleeding_edge/src/serialize.cc Tue Apr 22 10:45:43 2014 UTC
@@ -785,6 +785,9 @@
void Serializer::TearDown() {
+ // TearDown is called by V8::TearDown() for the default isolate. It's
safe
+ // to shut down the serializer by that point. Just to be safe, we restore
+ // serialization_state_ to uninitialized.
ASSERT(NoBarrier_Load(&serialization_state_) !=
SERIALIZER_STATE_UNINITIALIZED);
if (code_address_map_) {
=======================================
--- /branches/bleeding_edge/src/v8.cc Tue Apr 22 09:24:56 2014 UTC
+++ /branches/bleeding_edge/src/v8.cc Tue Apr 22 10:45:43 2014 UTC
@@ -77,6 +77,16 @@
void V8::TearDown() {
+ Isolate* isolate = Isolate::Current();
+ ASSERT(isolate->IsDefaultIsolate());
+ if (!isolate->IsInitialized()) return;
+
+ // The isolate has to be torn down before clearing the LOperand
+ // caches so that the optimizing compiler thread (if running)
+ // doesn't see an inconsistent view of the lithium instructions.
+ isolate->TearDown();
+ delete isolate;
+
Bootstrapper::TearDownExtensions();
ElementsAccessor::TearDown();
LOperand::TearDownCaches();
@@ -88,6 +98,7 @@
call_completed_callbacks_ = NULL;
Sampler::TearDown();
+ Serializer::TearDown();
#ifdef V8_USE_DEFAULT_PLATFORM
DefaultPlatform* platform = static_cast<DefaultPlatform*>(platform_);
=======================================
--- /branches/bleeding_edge/test/cctest/cctest.cc Tue Apr 22 09:24:56 2014
UTC
+++ /branches/bleeding_edge/test/cctest/cctest.cc Tue Apr 22 10:45:43 2014
UTC
@@ -138,7 +138,6 @@
int main(int argc, char* argv[]) {
v8::V8::InitializeICU();
- v8::V8::Initialize();
i::Isolate::SetCrashIfDefaultIsolateInitialized();
v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true);
=======================================
--- /branches/bleeding_edge/test/cctest/test-api.cc Tue Apr 22 09:24:56
2014 UTC
+++ /branches/bleeding_edge/test/cctest/test-api.cc Tue Apr 22 10:45:43
2014 UTC
@@ -22313,7 +22313,6 @@
TEST(Promises) {
i::FLAG_harmony_promises = true;
- i::FlagList::EnforceFlagImplications();
LocalContext context;
v8::Isolate* isolate = context->GetIsolate();
=======================================
--- /branches/bleeding_edge/test/cctest/test-microtask-delivery.cc Tue Apr
22 09:24:56 2014 UTC
+++ /branches/bleeding_edge/test/cctest/test-microtask-delivery.cc Tue Apr
22 10:45:43 2014 UTC
@@ -37,7 +37,6 @@
public:
HarmonyIsolate() {
i::FLAG_harmony_promises = true;
- i::FlagList::EnforceFlagImplications();
isolate_ = Isolate::New();
isolate_->Enter();
}
=======================================
--- /branches/bleeding_edge/tools/lexer-shell.cc Tue Apr 22 09:24:56 2014
UTC
+++ /branches/bleeding_edge/tools/lexer-shell.cc Tue Apr 22 10:45:43 2014
UTC
@@ -182,7 +182,6 @@
int main(int argc, char* argv[]) {
v8::V8::InitializeICU();
- v8::V8::Initialize();
v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
Encoding encoding = LATIN1;
bool print_tokens = false;
=======================================
--- /branches/bleeding_edge/tools/parser-shell.cc Tue Apr 22 09:24:56 2014
UTC
+++ /branches/bleeding_edge/tools/parser-shell.cc Tue Apr 22 10:45:43 2014
UTC
@@ -107,7 +107,6 @@
int main(int argc, char* argv[]) {
v8::V8::InitializeICU();
- v8::V8::Initialize();
v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
Encoding encoding = LATIN1;
std::vector<std::string> fnames;
--
--
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.