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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/megamorphic_cache_table.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #ifndef VM_MEGAMORPHIC_CACHE_TABLE_H_
6 #define VM_MEGAMORPHIC_CACHE_TABLE_H_
7
8 #include "vm/allocation.h"
9
10 namespace dart {
11
12 class Array;
13 class Function;
14 class ObjectPointerVisitor;
15 class RawArray;
16 class RawFunction;
17 class RawMegamorphicCache;
18 class RawString;
19 class String;
20
21 class MegamorphicCacheTable {
22 public:
23 MegamorphicCacheTable();
24 ~MegamorphicCacheTable();
25
26 RawFunction* miss_handler() const { return miss_handler_; }
27 void InitMissHandler();
28
29 RawMegamorphicCache* Lookup(const String& name, const Array& descriptor);
30
31 void VisitObjectPointers(ObjectPointerVisitor* visitor);
32
33 void PrintSizes();
34
35 private:
36 struct Entry {
37 RawString* name;
38 RawArray* descriptor;
39 RawMegamorphicCache* cache;
40 };
41
42 static const int kInitialCapacity = 128;
43 static const int kCapacityIncrement = 128;
44
45 RawFunction* miss_handler_;
46 intptr_t capacity_;
47 intptr_t length_;
48 Entry* table_;
49
50 DISALLOW_COPY_AND_ASSIGN(MegamorphicCacheTable);
51 };
52
53 } // namespace dart
54
55 #endif // VM_MEGAMORPHIC_CACHE_TABLE_H_
OLDNEW
« 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