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

Unified Diff: src/stub-cache.h

Issue 435003: Patch for allowing several V8 instances in process:... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years 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
« no previous file with comments | « src/spaces-inl.h ('k') | src/stub-cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache.h
===================================================================
--- src/stub-cache.h (revision 3427)
+++ src/stub-cache.h (working copy)
@@ -43,15 +43,32 @@
// validates the map chain as in the mono-morphic case.
class SCTableReference;
-
-class StubCache : public AllStatic {
+class StubCacheTypes {
public:
struct Entry {
String* key;
Code* value;
};
+ static const int kPrimaryTableSize = 2048;
+ static const int kSecondaryTableSize = 512;
+};
+class StubCacheData:public StubCacheTypes {
+ Entry primary_[kPrimaryTableSize];
+ Entry secondary_[kSecondaryTableSize];
+
+ StubCacheData();
+
+ friend class StubCache;
+ friend class V8Context;
+ friend class SCTableReference;
+
+ DISALLOW_COPY_AND_ASSIGN(StubCacheData);
+};
+
+class StubCache : public AllStatic, public StubCacheTypes {
+ public:
static void Initialize(bool create_heap_objects);
// Computes the right stub matching. Inserts the result in the
@@ -213,12 +230,6 @@
};
private:
- friend class SCTableReference;
- static const int kPrimaryTableSize = 2048;
- static const int kSecondaryTableSize = 512;
- static Entry primary_[];
- static Entry secondary_[];
-
// Computes the hashed offsets for primary and secondary caches.
static int PrimaryOffset(String* name, Code::Flags flags, Map* map) {
// This works well because the heap object tag size and the hash
@@ -288,8 +299,10 @@
static StubCache::Entry* first_entry(StubCache::Table table) {
switch (table) {
- case StubCache::kPrimary: return StubCache::primary_;
- case StubCache::kSecondary: return StubCache::secondary_;
+ case StubCache::kPrimary:
+ return v8_context()->stub_cache_data_.primary_;
+ case StubCache::kSecondary:
+ return v8_context()->stub_cache_data_.secondary_;
}
UNREACHABLE();
return NULL;
« no previous file with comments | « src/spaces-inl.h ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698