Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: src/bootstrapper.cc

Issue 8536042: Extension state made per-siolate in genesis (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 6735ff454933f0933f4b3a3b15e4b035625be565..f3898050d03dc3e2e7b8e33c5def2925168a9c31 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1943,9 +1943,10 @@ bool Genesis::InstallExtensions(Handle<Context> global_context,
// we can break the interface?)
// Clear coloring of extension list
+ i::Isolate* isolate = i::Isolate::Current();
v8::RegisteredExtension* current = v8::RegisteredExtension::first_extension();
while (current != NULL) {
- current->set_state(v8::UNVISITED);
+ isolate->extension_states()->set_state(current, i::UNVISITED);
current = current->next();
}
// Install auto extensions.
@@ -1994,16 +1995,17 @@ bool Genesis::InstallExtension(const char* name) {
bool Genesis::InstallExtension(v8::RegisteredExtension* current) {
HandleScope scope;
- if (current->state() == v8::INSTALLED) return true;
+ ExtensionStates* extension_states = Isolate::Current()->extension_states();
+ if (extension_states->get_state(current) == INSTALLED) return true;
// The current node has already been visited so there must be a
// cycle in the dependency graph; fail.
- if (current->state() == v8::VISITED) {
+ if (extension_states->get_state(current) == VISITED) {
v8::Utils::ReportApiFailure(
"v8::Context::New()", "Circular extension dependency");
return false;
}
- ASSERT(current->state() == v8::UNVISITED);
- current->set_state(v8::VISITED);
+ ASSERT(extension_states->get_state(current) == UNVISITED);
+ extension_states->set_state(current, VISITED);
v8::Extension* extension = current->extension();
// Install the extension's dependencies
for (int i = 0; i < extension->dependency_count(); i++) {
@@ -2029,7 +2031,7 @@ bool Genesis::InstallExtension(v8::RegisteredExtension* current) {
current->extension()->name());
isolate->clear_pending_exception();
}
- current->set_state(v8::INSTALLED);
+ extension_states->set_state(current, INSTALLED);
return result;
}

Powered by Google App Engine
This is Rietveld 408576698