Revision: 4765
Author: lukezarko
Date: Tue Jun 1 06:31:05 2010
Log: - Add a pointer to StubCache from Isolate.
- Remove AllStatic parent from StubCache.
- Add empty constructor to StubCache.
Review URL: http://codereview.chromium.org/2463002
http://code.google.com/p/v8/source/detail?r=4765
Modified:
/branches/experimental/isolates/src/isolate.cc
/branches/experimental/isolates/src/isolate.h
/branches/experimental/isolates/src/stub-cache.cc
/branches/experimental/isolates/src/stub-cache.h
=======================================
--- /branches/experimental/isolates/src/isolate.cc Tue Jun 1 03:51:42 2010
+++ /branches/experimental/isolates/src/isolate.cc Tue Jun 1 06:31:05 2010
@@ -64,11 +64,14 @@
}
-Isolate::Isolate() {
+Isolate::Isolate()
+ : stub_cache_(NULL) {
}
Isolate::~Isolate() {
+ delete stub_cache_;
+ stub_cache_ = NULL;
}
@@ -122,6 +125,7 @@
#ifdef ENABLE_DEBUGGER_SUPPORT
Debug::Setup(create_heap_objects);
#endif
+ stub_cache_ = new StubCache();
StubCache::Initialize(create_heap_objects);
// If we are deserializing, read the state into the now-empty heap.
=======================================
--- /branches/experimental/isolates/src/isolate.h Tue Jun 1 03:51:42 2010
+++ /branches/experimental/isolates/src/isolate.h Tue Jun 1 06:31:05 2010
@@ -34,6 +34,7 @@
namespace internal {
class Deserializer;
+class StubCache;
class Isolate {
public:
@@ -54,6 +55,7 @@
// Accessors.
Heap* heap() { return &heap_; }
+ StubCache* stub_cache() { return stub_cache_; }
private:
Isolate();
@@ -63,6 +65,7 @@
bool Init(Deserializer* des);
Heap heap_;
+ StubCache* stub_cache_;
DISALLOW_COPY_AND_ASSIGN(Isolate);
};
=======================================
--- /branches/experimental/isolates/src/stub-cache.cc Tue Jun 1 03:51:42
2010
+++ /branches/experimental/isolates/src/stub-cache.cc Tue Jun 1 06:31:05
2010
@@ -42,6 +42,10 @@
StubCache::Entry StubCache::primary_[StubCache::kPrimaryTableSize];
StubCache::Entry StubCache::secondary_[StubCache::kSecondaryTableSize];
+StubCache::StubCache() {
+}
+
+
void StubCache::Initialize(bool create_heap_objects) {
ASSERT(IsPowerOf2(kPrimaryTableSize));
ASSERT(IsPowerOf2(kSecondaryTableSize));
=======================================
--- /branches/experimental/isolates/src/stub-cache.h Wed May 26 07:23:19
2010
+++ /branches/experimental/isolates/src/stub-cache.h Tue Jun 1 06:31:05
2010
@@ -44,7 +44,7 @@
class SCTableReference;
-class StubCache : public AllStatic {
+class StubCache {
public:
struct Entry {
String* key;
@@ -215,6 +215,9 @@
};
private:
+ StubCache();
+
+ friend class Isolate;
friend class SCTableReference;
static const int kPrimaryTableSize = 2048;
static const int kSecondaryTableSize = 512;
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev