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

Unified Diff: runtime/vm/megamorphic_cache_table.h

Issue 1346473002: Move megamorphic cache table into the Dart heap. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: non-x64 Created 5 years, 3 months 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: runtime/vm/megamorphic_cache_table.h
diff --git a/runtime/vm/megamorphic_cache_table.h b/runtime/vm/megamorphic_cache_table.h
index eafb35b12b6ed45d8f656c62668d1518adad1f10..c47d4d89f6e9a89da1b20d7913c339d54d67850f 100644
--- a/runtime/vm/megamorphic_cache_table.h
+++ b/runtime/vm/megamorphic_cache_table.h
@@ -11,6 +11,7 @@ namespace dart {
class Array;
class Function;
+class Isolate;
class ObjectPointerVisitor;
class RawArray;
class RawFunction;
@@ -19,36 +20,24 @@ class RawMegamorphicCache;
class RawString;
class String;
-class MegamorphicCacheTable {
+class MegamorphicCacheTable : public AllStatic {
public:
- MegamorphicCacheTable();
- ~MegamorphicCacheTable();
+ static RawFunction* miss_handler(Isolate* isolate);
+ static void InitMissHandler(Isolate* isolate);
- RawFunction* miss_handler() const { return miss_handler_function_; }
- void InitMissHandler();
+ static RawMegamorphicCache* Lookup(Isolate* isolate,
+ const String& name,
+ const Array& descriptor);
- RawMegamorphicCache* Lookup(const String& name, const Array& descriptor);
-
- void VisitObjectPointers(ObjectPointerVisitor* visitor);
-
- void PrintSizes();
+ static void PrintSizes(Isolate* isolate);
private:
- struct Entry {
- RawString* name;
- RawArray* descriptor;
- RawMegamorphicCache* cache;
+ enum {
+ kEntryNameOffset = 0,
+ kEntryDescriptorOffset,
+ kEntryCacheOffset,
+ kEntrySize
};
-
- static const int kCapacityIncrement = 128;
-
- RawFunction* miss_handler_function_;
- RawCode* miss_handler_code_;
- intptr_t capacity_;
- intptr_t length_;
- Entry* table_;
-
- DISALLOW_COPY_AND_ASSIGN(MegamorphicCacheTable);
};
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698