OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_TYPE_INFO_H_ | 5 #ifndef V8_TYPE_INFO_H_ |
6 #define V8_TYPE_INFO_H_ | 6 #define V8_TYPE_INFO_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/globals.h" | 9 #include "src/globals.h" |
10 #include "src/types.h" | 10 #include "src/types.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // to various cycles in our headers. | 35 // to various cycles in our headers. |
36 // TODO(rossberg): once all oracle access is removed from ast.cc, it should | 36 // TODO(rossberg): once all oracle access is removed from ast.cc, it should |
37 // be possible. | 37 // be possible. |
38 byte ForInType(FeedbackVectorSlot feedback_vector_slot); | 38 byte ForInType(FeedbackVectorSlot feedback_vector_slot); |
39 | 39 |
40 void GetStoreModeAndKeyType(TypeFeedbackId id, | 40 void GetStoreModeAndKeyType(TypeFeedbackId id, |
41 KeyedAccessStoreMode* store_mode, | 41 KeyedAccessStoreMode* store_mode, |
42 IcCheckType* key_type); | 42 IcCheckType* key_type); |
43 void GetLoadKeyType(TypeFeedbackId id, IcCheckType* key_type); | 43 void GetLoadKeyType(TypeFeedbackId id, IcCheckType* key_type); |
44 | 44 |
45 void PropertyReceiverTypes(TypeFeedbackId id, Handle<String> name, | 45 void PropertyReceiverTypes(TypeFeedbackId id, Handle<Name> name, |
46 SmallMapList* receiver_types); | 46 SmallMapList* receiver_types); |
47 void PropertyReceiverTypes(FeedbackVectorICSlot slot, Handle<String> name, | 47 void PropertyReceiverTypes(FeedbackVectorICSlot slot, Handle<Name> name, |
48 SmallMapList* receiver_types); | 48 SmallMapList* receiver_types); |
49 void KeyedPropertyReceiverTypes(TypeFeedbackId id, | 49 void KeyedPropertyReceiverTypes(TypeFeedbackId id, |
50 SmallMapList* receiver_types, | 50 SmallMapList* receiver_types, |
51 bool* is_string, | 51 bool* is_string, |
52 IcCheckType* key_type); | 52 IcCheckType* key_type); |
53 void KeyedPropertyReceiverTypes(FeedbackVectorICSlot slot, | 53 void KeyedPropertyReceiverTypes(FeedbackVectorICSlot slot, |
54 SmallMapList* receiver_types, bool* is_string, | 54 SmallMapList* receiver_types, bool* is_string, |
55 IcCheckType* key_type); | 55 IcCheckType* key_type); |
56 void AssignmentReceiverTypes(TypeFeedbackId id, | 56 void AssignmentReceiverTypes(TypeFeedbackId id, Handle<Name> name, |
57 Handle<String> name, | |
58 SmallMapList* receiver_types); | 57 SmallMapList* receiver_types); |
59 void KeyedAssignmentReceiverTypes(TypeFeedbackId id, | 58 void KeyedAssignmentReceiverTypes(TypeFeedbackId id, |
60 SmallMapList* receiver_types, | 59 SmallMapList* receiver_types, |
61 KeyedAccessStoreMode* store_mode, | 60 KeyedAccessStoreMode* store_mode, |
62 IcCheckType* key_type); | 61 IcCheckType* key_type); |
63 void CountReceiverTypes(TypeFeedbackId id, | 62 void CountReceiverTypes(TypeFeedbackId id, |
64 SmallMapList* receiver_types); | 63 SmallMapList* receiver_types); |
65 | 64 |
66 void CollectReceiverTypes(TypeFeedbackId id, | 65 void CollectReceiverTypes(TypeFeedbackId id, |
67 SmallMapList* types); | 66 SmallMapList* types); |
(...skipping 29 matching lines...) Expand all Loading... |
97 Type** left, | 96 Type** left, |
98 Type** right, | 97 Type** right, |
99 Type** combined); | 98 Type** combined); |
100 | 99 |
101 Type* CountType(TypeFeedbackId id); | 100 Type* CountType(TypeFeedbackId id); |
102 | 101 |
103 Zone* zone() const { return zone_; } | 102 Zone* zone() const { return zone_; } |
104 Isolate* isolate() const { return isolate_; } | 103 Isolate* isolate() const { return isolate_; } |
105 | 104 |
106 private: | 105 private: |
107 void CollectReceiverTypes(TypeFeedbackId id, | 106 void CollectReceiverTypes(TypeFeedbackId id, Handle<Name> name, |
108 Handle<String> name, | 107 Code::Flags flags, SmallMapList* types); |
109 Code::Flags flags, | |
110 SmallMapList* types); | |
111 template <class T> | 108 template <class T> |
112 void CollectReceiverTypes(T* obj, Handle<String> name, Code::Flags flags, | 109 void CollectReceiverTypes(T* obj, Handle<Name> name, Code::Flags flags, |
113 SmallMapList* types); | 110 SmallMapList* types); |
114 | 111 |
115 // Returns true if there is at least one string map and if | 112 // Returns true if there is at least one string map and if |
116 // all maps are string maps. | 113 // all maps are string maps. |
117 bool HasOnlyStringMaps(SmallMapList* receiver_types); | 114 bool HasOnlyStringMaps(SmallMapList* receiver_types); |
118 | 115 |
119 void SetInfo(TypeFeedbackId id, Object* target); | 116 void SetInfo(TypeFeedbackId id, Object* target); |
120 | 117 |
121 void BuildDictionary(Handle<Code> code); | 118 void BuildDictionary(Handle<Code> code); |
122 void GetRelocInfos(Handle<Code> code, ZoneList<RelocInfo>* infos); | 119 void GetRelocInfos(Handle<Code> code, ZoneList<RelocInfo>* infos); |
(...skipping 18 matching lines...) Expand all Loading... |
141 Zone* zone_; | 138 Zone* zone_; |
142 Handle<UnseededNumberDictionary> dictionary_; | 139 Handle<UnseededNumberDictionary> dictionary_; |
143 Handle<TypeFeedbackVector> feedback_vector_; | 140 Handle<TypeFeedbackVector> feedback_vector_; |
144 | 141 |
145 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); | 142 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); |
146 }; | 143 }; |
147 | 144 |
148 } } // namespace v8::internal | 145 } } // namespace v8::internal |
149 | 146 |
150 #endif // V8_TYPE_INFO_H_ | 147 #endif // V8_TYPE_INFO_H_ |
OLD | NEW |