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

Unified Diff: runtime/vm/megamorphic_cache_table.h

Issue 1334283004: Revert "Move megamorphic cache table into the Dart heap." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/megamorphic_cache_table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/megamorphic_cache_table.h
diff --git a/runtime/vm/megamorphic_cache_table.h b/runtime/vm/megamorphic_cache_table.h
index c47d4d89f6e9a89da1b20d7913c339d54d67850f..eafb35b12b6ed45d8f656c62668d1518adad1f10 100644
--- a/runtime/vm/megamorphic_cache_table.h
+++ b/runtime/vm/megamorphic_cache_table.h
@@ -11,7 +11,6 @@ namespace dart {
class Array;
class Function;
-class Isolate;
class ObjectPointerVisitor;
class RawArray;
class RawFunction;
@@ -20,24 +19,36 @@ class RawMegamorphicCache;
class RawString;
class String;
-class MegamorphicCacheTable : public AllStatic {
+class MegamorphicCacheTable {
public:
- static RawFunction* miss_handler(Isolate* isolate);
- static void InitMissHandler(Isolate* isolate);
+ MegamorphicCacheTable();
+ ~MegamorphicCacheTable();
- static RawMegamorphicCache* Lookup(Isolate* isolate,
- const String& name,
- const Array& descriptor);
+ RawFunction* miss_handler() const { return miss_handler_function_; }
+ void InitMissHandler();
- static void PrintSizes(Isolate* isolate);
+ RawMegamorphicCache* Lookup(const String& name, const Array& descriptor);
+
+ void VisitObjectPointers(ObjectPointerVisitor* visitor);
+
+ void PrintSizes();
private:
- enum {
- kEntryNameOffset = 0,
- kEntryDescriptorOffset,
- kEntryCacheOffset,
- kEntrySize
+ struct Entry {
+ RawString* name;
+ RawArray* descriptor;
+ RawMegamorphicCache* cache;
};
+
+ 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
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/megamorphic_cache_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698