bool V8::Dispose() { Isolate *isolate = Isolate::Current(); if (isolate != NULL && isolate->IsDefaultIsolate()) { fprintf(stderr, "Use v8::Isolate::Dispose() for a non-default isolate.\n"); return false; } V8::TearDown(); return true; }
void V8::TearDown() { Isolate *isolate = Isolate::Current(); ASSERT(isolate->IsDefaultIsolate()); if (!has_been_set_up_ || has_been_disposed_) 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; is_running_ = false; has_been_disposed_ = true; }