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

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: 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..aaf3adc44eeb39bf658009d05c263bf595bfca10 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;
@@ -21,32 +22,25 @@ class String;
class MegamorphicCacheTable {
public:
- MegamorphicCacheTable();
- ~MegamorphicCacheTable();
+ explicit MegamorphicCacheTable(Isolate* isolate) : isolate_(isolate) {}
+ ~MegamorphicCacheTable() {}
- RawFunction* miss_handler() const { return miss_handler_function_; }
+ RawFunction* miss_handler() const;
void InitMissHandler();
RawMegamorphicCache* Lookup(const String& name, const Array& descriptor);
- void VisitObjectPointers(ObjectPointerVisitor* visitor);
-
void PrintSizes();
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_;
+ Isolate* isolate_;
DISALLOW_COPY_AND_ASSIGN(MegamorphicCacheTable);
};

Powered by Google App Engine
This is Rietveld 408576698