OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // Forward declarations. | 39 // Forward declarations. |
40 class ICStub; | 40 class ICStub; |
41 class SmallMapList; | 41 class SmallMapList; |
42 | 42 |
43 | 43 |
44 class TypeFeedbackOracle: public ZoneObject { | 44 class TypeFeedbackOracle: public ZoneObject { |
45 public: | 45 public: |
46 TypeFeedbackOracle(Handle<Code> code, | 46 TypeFeedbackOracle(Handle<Code> code, |
47 Handle<Context> native_context, | 47 Handle<Context> native_context, |
48 Isolate* isolate, | |
49 Zone* zone); | 48 Zone* zone); |
50 | 49 |
51 bool LoadIsUninitialized(TypeFeedbackId id); | 50 bool LoadIsUninitialized(TypeFeedbackId id); |
52 bool LoadIsPreMonomorphic(TypeFeedbackId id); | 51 bool LoadIsPreMonomorphic(TypeFeedbackId id); |
53 bool StoreIsUninitialized(TypeFeedbackId id); | 52 bool StoreIsUninitialized(TypeFeedbackId id); |
54 bool StoreIsPreMonomorphic(TypeFeedbackId id); | 53 bool StoreIsPreMonomorphic(TypeFeedbackId id); |
55 bool StoreIsKeyedPolymorphic(TypeFeedbackId id); | 54 bool StoreIsKeyedPolymorphic(TypeFeedbackId id); |
56 bool CallIsMonomorphic(TypeFeedbackId aid); | 55 bool CallIsMonomorphic(TypeFeedbackId aid); |
57 bool KeyedArrayCallIsHoley(TypeFeedbackId id); | 56 bool KeyedArrayCallIsHoley(TypeFeedbackId id); |
58 bool CallNewIsMonomorphic(TypeFeedbackId id); | 57 bool CallNewIsMonomorphic(TypeFeedbackId id); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id); | 100 bool LoadIsBuiltin(TypeFeedbackId id, Builtins::Name builtin_id); |
102 bool LoadIsStub(TypeFeedbackId id, ICStub* stub); | 101 bool LoadIsStub(TypeFeedbackId id, ICStub* stub); |
103 | 102 |
104 // TODO(1571) We can't use ToBooleanStub::Types as the return value because | 103 // TODO(1571) We can't use ToBooleanStub::Types as the return value because |
105 // of various cycles in our headers. Death to tons of implementations in | 104 // of various cycles in our headers. Death to tons of implementations in |
106 // headers!! :-P | 105 // headers!! :-P |
107 byte ToBooleanTypes(TypeFeedbackId id); | 106 byte ToBooleanTypes(TypeFeedbackId id); |
108 | 107 |
109 // Get type information for arithmetic operations and compares. | 108 // Get type information for arithmetic operations and compares. |
110 void BinaryType(TypeFeedbackId id, | 109 void BinaryType(TypeFeedbackId id, |
111 Handle<Type>* left, | 110 Type** left, |
112 Handle<Type>* right, | 111 Type** right, |
113 Handle<Type>* result, | 112 Type** result, |
114 Maybe<int>* fixed_right_arg, | 113 Maybe<int>* fixed_right_arg, |
115 Token::Value operation); | 114 Token::Value operation); |
116 | 115 |
117 void CompareType(TypeFeedbackId id, | 116 void CompareType(TypeFeedbackId id, |
118 Handle<Type>* left, | 117 Type** left, |
119 Handle<Type>* right, | 118 Type** right, |
120 Handle<Type>* combined); | 119 Type** combined); |
121 | 120 |
122 Handle<Type> CountType(TypeFeedbackId id); | 121 Type* CountType(TypeFeedbackId id); |
123 | 122 |
124 Zone* zone() const { return zone_; } | 123 Zone* zone() const { return zone_; } |
125 Isolate* isolate() const { return isolate_; } | 124 Isolate* isolate() const { return zone_->isolate(); } |
126 | 125 |
127 private: | 126 private: |
128 void CollectReceiverTypes(TypeFeedbackId id, | 127 void CollectReceiverTypes(TypeFeedbackId id, |
129 Handle<String> name, | 128 Handle<String> name, |
130 Code::Flags flags, | 129 Code::Flags flags, |
131 SmallMapList* types); | 130 SmallMapList* types); |
132 | 131 |
133 void SetInfo(TypeFeedbackId id, Object* target); | 132 void SetInfo(TypeFeedbackId id, Object* target); |
134 | 133 |
135 void BuildDictionary(Handle<Code> code); | 134 void BuildDictionary(Handle<Code> code); |
136 void GetRelocInfos(Handle<Code> code, ZoneList<RelocInfo>* infos); | 135 void GetRelocInfos(Handle<Code> code, ZoneList<RelocInfo>* infos); |
137 void CreateDictionary(Handle<Code> code, ZoneList<RelocInfo>* infos); | 136 void CreateDictionary(Handle<Code> code, ZoneList<RelocInfo>* infos); |
138 void RelocateRelocInfos(ZoneList<RelocInfo>* infos, | 137 void RelocateRelocInfos(ZoneList<RelocInfo>* infos, |
139 byte* old_start, | 138 byte* old_start, |
140 byte* new_start); | 139 byte* new_start); |
141 void ProcessRelocInfos(ZoneList<RelocInfo>* infos); | 140 void ProcessRelocInfos(ZoneList<RelocInfo>* infos); |
142 void ProcessTypeFeedbackCells(Handle<Code> code); | 141 void ProcessTypeFeedbackCells(Handle<Code> code); |
143 | 142 |
144 // Returns an element from the backing store. Returns undefined if | 143 // Returns an element from the backing store. Returns undefined if |
145 // there is no information. | 144 // there is no information. |
146 Handle<Object> GetInfo(TypeFeedbackId id); | 145 Handle<Object> GetInfo(TypeFeedbackId id); |
147 | 146 |
148 // Return the cell that contains type feedback. | 147 // Return the cell that contains type feedback. |
149 Handle<Cell> GetInfoCell(TypeFeedbackId id); | 148 Handle<Cell> GetInfoCell(TypeFeedbackId id); |
150 | 149 |
151 private: | 150 private: |
152 Handle<Context> native_context_; | 151 Handle<Context> native_context_; |
153 Isolate* isolate_; | |
154 Zone* zone_; | 152 Zone* zone_; |
155 Handle<UnseededNumberDictionary> dictionary_; | 153 Handle<UnseededNumberDictionary> dictionary_; |
156 | 154 |
157 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); | 155 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); |
158 }; | 156 }; |
159 | 157 |
160 } } // namespace v8::internal | 158 } } // namespace v8::internal |
161 | 159 |
162 #endif // V8_TYPE_INFO_H_ | 160 #endif // V8_TYPE_INFO_H_ |
OLD | NEW |