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

Side by Side Diff: runtime/vm/raw_object.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/object.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/token.h" 10 #include "vm/token.h"
(...skipping 22 matching lines...) Expand all
33 V(Code) \ 33 V(Code) \
34 V(Instructions) \ 34 V(Instructions) \
35 V(PcDescriptors) \ 35 V(PcDescriptors) \
36 V(Stackmap) \ 36 V(Stackmap) \
37 V(LocalVarDescriptors) \ 37 V(LocalVarDescriptors) \
38 V(ExceptionHandlers) \ 38 V(ExceptionHandlers) \
39 V(DeoptInfo) \ 39 V(DeoptInfo) \
40 V(Context) \ 40 V(Context) \
41 V(ContextScope) \ 41 V(ContextScope) \
42 V(ICData) \ 42 V(ICData) \
43 V(MegamorphicCache) \
43 V(SubtypeTestCache) \ 44 V(SubtypeTestCache) \
44 V(Error) \ 45 V(Error) \
45 V(ApiError) \ 46 V(ApiError) \
46 V(LanguageError) \ 47 V(LanguageError) \
47 V(UnhandledException) \ 48 V(UnhandledException) \
48 V(UnwindError) \ 49 V(UnwindError) \
49 V(Instance) \ 50 V(Instance) \
50 V(AbstractType) \ 51 V(AbstractType) \
51 V(Type) \ 52 V(Type) \
52 V(TypeParameter) \ 53 V(TypeParameter) \
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 RawObject** to() { 928 RawObject** to() {
928 return reinterpret_cast<RawObject**>(&ptr()->ic_data_); 929 return reinterpret_cast<RawObject**>(&ptr()->ic_data_);
929 } 930 }
930 intptr_t deopt_id_; // Deoptimization id corresponding to this IC. 931 intptr_t deopt_id_; // Deoptimization id corresponding to this IC.
931 intptr_t num_args_tested_; // Number of arguments tested in IC. 932 intptr_t num_args_tested_; // Number of arguments tested in IC.
932 uint8_t deopt_reason_; // Last deoptimization reason. 933 uint8_t deopt_reason_; // Last deoptimization reason.
933 uint8_t is_closure_call_; // 0 or 1. 934 uint8_t is_closure_call_; // 0 or 1.
934 }; 935 };
935 936
936 937
938 class RawMegamorphicCache : public RawObject {
939 RAW_HEAP_OBJECT_IMPLEMENTATION(MegamorphicCache);
940
941 RawObject** from() {
942 return reinterpret_cast<RawObject**>(&ptr()->buckets_);
943 }
944 RawArray* buckets_;
945 RawSmi* mask_;
946 RawObject** to() {
947 return reinterpret_cast<RawObject**>(&ptr()->mask_);
948 }
949
950 intptr_t filled_entry_count_;
951 };
952
953
937 class RawSubtypeTestCache : public RawObject { 954 class RawSubtypeTestCache : public RawObject {
938 RAW_HEAP_OBJECT_IMPLEMENTATION(SubtypeTestCache); 955 RAW_HEAP_OBJECT_IMPLEMENTATION(SubtypeTestCache);
939 RawArray* cache_; 956 RawArray* cache_;
940 }; 957 };
941 958
942 959
943 class RawError : public RawObject { 960 class RawError : public RawObject {
944 RAW_HEAP_OBJECT_IMPLEMENTATION(Error); 961 RAW_HEAP_OBJECT_IMPLEMENTATION(Error);
945 }; 962 };
946 963
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 7 && 1654 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 7 &&
1638 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 8 && 1655 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 8 &&
1639 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 9 && 1656 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 9 &&
1640 kStacktraceCid == kExternalInt8ArrayCid + 10); 1657 kStacktraceCid == kExternalInt8ArrayCid + 10);
1641 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid); 1658 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid);
1642 } 1659 }
1643 1660
1644 } // namespace dart 1661 } // namespace dart
1645 1662
1646 #endif // VM_RAW_OBJECT_H_ 1663 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698