Reviewers: Dmitry Lomov (chromium),
Description:
Make sure we register extensions only once. Removed unused member variable.
V8::Initialize() can be called from various threads simultaneously, so
everything should be done only once per process or within the Isolate. For
registering extensions, we do the former now.
Please review this at https://chromiumcodereview.appspot.com/15564002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/api.h
M src/bootstrapper.h
M src/bootstrapper.cc
M src/v8.cc
Index: src/api.h
diff --git a/src/api.h b/src/api.h
index
686abf75c4af0e2108da34f28a48987e5f510eec..12d6e3d08229343644b3f571933c15543b90c19b
100644
--- a/src/api.h
+++ b/src/api.h
@@ -149,12 +149,10 @@ class RegisteredExtension {
static void UnregisterAll();
Extension* extension() { return extension_; }
RegisteredExtension* next() { return next_; }
- RegisteredExtension* next_auto() { return next_auto_; }
static RegisteredExtension* first_extension() { return first_extension_;
}
private:
Extension* extension_;
RegisteredExtension* next_;
- RegisteredExtension* next_auto_;
static RegisteredExtension* first_extension_;
};
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index
85812ca28cc8679cd9a9504967dc4405554f1dfa..7c9e4366ed7847641fbb3b6042cff7f2d5e31783
100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -95,6 +95,10 @@ Handle<String> Bootstrapper::NativesSourceLookup(int
index) {
void Bootstrapper::Initialize(bool create_heap_objects) {
extensions_cache_.Initialize(create_heap_objects);
+}
+
+
+void Bootstrapper::InitializeOncePerProcess() {
GCExtension::Register();
ExternalizeStringExtension::Register();
StatisticsExtension::Register();
Index: src/bootstrapper.h
diff --git a/src/bootstrapper.h b/src/bootstrapper.h
index
e33415eeb9ca5f9e5157f0bf23a8b93cff8af286..476ac12e1491e70431ad9059463ed13fa75c11c7
100644
--- a/src/bootstrapper.h
+++ b/src/bootstrapper.h
@@ -88,6 +88,8 @@ class SourceCodeCache BASE_EMBEDDED {
// context.
class Bootstrapper {
public:
+ static void InitializeOncePerProcess();
+
// Requires: Heap::SetUp has been called.
void Initialize(bool create_heap_objects);
void TearDown();
Index: src/v8.cc
diff --git a/src/v8.cc b/src/v8.cc
index
274128ed4c4b66f4d9f3163e980e9f4a1f7c80ab..e21c815ff51743a80626c23add4f8e4f1b689e0f
100644
--- a/src/v8.cc
+++ b/src/v8.cc
@@ -281,6 +281,7 @@ void V8::InitializeOncePerProcessImpl() {
LOperand::SetUpCaches();
SetUpJSCallerSavedCodeData();
ExternalReference::SetUp();
+ Bootstrapper::InitializeOncePerProcess();
}
void V8::InitializeOncePerProcess() {
--
--
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.