Index: src/v8.cc |
diff --git a/src/v8.cc b/src/v8.cc |
index 9cca201972bdb9c1f1c6d6e51e42f290083c2dbe..f8156ecbd7123d0c5415f8b7e0e821228e37ac40 100644 |
--- a/src/v8.cc |
+++ b/src/v8.cc |
@@ -53,6 +53,16 @@ bool V8::Initialize(Deserializer* des) { |
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(); |