Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 : public ValueObject { | |
|
srdjan
2012/12/03 19:10:46
Don't make it a ValueObject as this indicates to m
Kevin Millikin (Google)
2012/12/06 14:03:11
Done.
| |
| 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_; | |
|
srdjan
2012/12/03 19:10:46
DISALLOW_YADYADA...
Kevin Millikin (Google)
2012/12/06 14:03:11
Done.
| |
| 49 }; | |
|
srdjan
2012/12/03 19:10:46
You can use RawGrowableObjectArray* table_, then y
Kevin Millikin (Google)
2012/12/06 14:03:11
Thanks for the good idea. I'll hold that off for
| |
| 50 | |
| 51 } // namespace dart | |
| 52 | |
| 53 #endif // VM_MEGAMORPHIC_CACHE_TABLE_H_ | |
| OLD | NEW |