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

Unified Diff: runtime/vm/megamorphic_cache_table.h

Issue 11299298: Cache lookups at megamorphic call sites in optimized code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: One change I forgot. Created 8 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 | « 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
new file mode 100644
index 0000000000000000000000000000000000000000..85e046898da0a1c42a1ca53f2d30e873b581fffe
--- /dev/null
+++ b/runtime/vm/megamorphic_cache_table.h
@@ -0,0 +1,55 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef VM_MEGAMORPHIC_CACHE_TABLE_H_
+#define VM_MEGAMORPHIC_CACHE_TABLE_H_
+
+#include "vm/allocation.h"
+
+namespace dart {
+
+class Array;
+class Function;
+class ObjectPointerVisitor;
+class RawArray;
+class RawFunction;
+class RawMegamorphicCache;
+class RawString;
+class String;
+
+class MegamorphicCacheTable {
+ public:
+ MegamorphicCacheTable();
+ ~MegamorphicCacheTable();
+
+ RawFunction* miss_handler() const { return miss_handler_; }
+ 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;
+ };
+
+ static const int kInitialCapacity = 128;
+ static const int kCapacityIncrement = 128;
+
+ RawFunction* miss_handler_;
+ intptr_t capacity_;
+ intptr_t length_;
+ Entry* table_;
+
+ DISALLOW_COPY_AND_ASSIGN(MegamorphicCacheTable);
+};
+
+} // namespace dart
+
+#endif // VM_MEGAMORPHIC_CACHE_TABLE_H_
« 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