Revision: 4771
Author: lukezarko
Date: Tue Jun 1 08:39:14 2010
Log: - Add a pointer to Bootstrapper from Isolate.
- Remove AllStatic parent from Bootstrapper.
- Add empty constructor to Boostrapper.
- Mark Bootstrapper as forbidden to copy/assign.
Review URL: http://codereview.chromium.org/2469002
http://code.google.com/p/v8/source/detail?r=4771
Modified:
/branches/experimental/isolates/src/bootstrapper.cc
/branches/experimental/isolates/src/bootstrapper.h
/branches/experimental/isolates/src/isolate.cc
/branches/experimental/isolates/src/isolate.h
=======================================
--- /branches/experimental/isolates/src/bootstrapper.cc Tue Jun 1 03:51:42
2010
+++ /branches/experimental/isolates/src/bootstrapper.cc Tue Jun 1 08:39:14
2010
@@ -109,6 +109,10 @@
delete_these_non_arrays_on_tear_down->
Add(reinterpret_cast<char*>(this));
}
+
+
+Bootstrapper::Bootstrapper() {
+}
Handle<String> Bootstrapper::NativesSourceLookup(int index) {
=======================================
--- /branches/experimental/isolates/src/bootstrapper.h Thu May 6 06:35:30
2010
+++ /branches/experimental/isolates/src/bootstrapper.h Tue Jun 1 08:39:14
2010
@@ -52,7 +52,7 @@
// The Boostrapper is the public interface for creating a JavaScript global
// context.
-class Bootstrapper : public AllStatic {
+class Bootstrapper {
public:
// Requires: Heap::Setup has been called.
static void Initialize(bool create_heap_objects);
@@ -93,6 +93,12 @@
// Used for new context creation.
static bool InstallExtensions(Handle<Context> global_context,
v8::ExtensionConfiguration* extensions);
+
+ private:
+ friend class Isolate;
+ Bootstrapper();
+
+ DISALLOW_COPY_AND_ASSIGN(Bootstrapper);
};
=======================================
--- /branches/experimental/isolates/src/isolate.cc Tue Jun 1 06:31:05 2010
+++ /branches/experimental/isolates/src/isolate.cc Tue Jun 1 08:39:14 2010
@@ -65,19 +65,22 @@
Isolate::Isolate()
- : stub_cache_(NULL) {
+ : bootstrapper_(NULL),
+ stub_cache_(NULL) {
}
Isolate::~Isolate() {
delete stub_cache_;
stub_cache_ = NULL;
+ delete bootstrapper_;
+ bootstrapper_ = NULL;
}
bool Isolate::Init(Deserializer* des) {
ASSERT(global_isolate == this);
-
+
bool create_heap_objects = des == NULL;
#ifdef DEBUG
@@ -85,6 +88,9 @@
DisallowAllocationFailure disallow_allocation_failure;
#endif
+ // Allocate per-isolate globals early.
+ bootstrapper_ = new Bootstrapper();
+
// Enable logging before setting up the heap
Logger::Setup();
=======================================
--- /branches/experimental/isolates/src/isolate.h Tue Jun 1 06:31:05 2010
+++ /branches/experimental/isolates/src/isolate.h Tue Jun 1 08:39:14 2010
@@ -33,6 +33,7 @@
namespace v8 {
namespace internal {
+class Bootstrapper;
class Deserializer;
class StubCache;
@@ -54,6 +55,7 @@
~Isolate();
// Accessors.
+ Bootstrapper* bootstrapper() { return bootstrapper_; }
Heap* heap() { return &heap_; }
StubCache* stub_cache() { return stub_cache_; }
@@ -64,6 +66,7 @@
bool Init(Deserializer* des);
+ Bootstrapper* bootstrapper_;
Heap heap_;
StubCache* stub_cache_;
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev