OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 class CaseClause; | 229 class CaseClause; |
230 | 230 |
231 class TypeFeedbackOracle BASE_EMBEDDED { | 231 class TypeFeedbackOracle BASE_EMBEDDED { |
232 public: | 232 public: |
233 enum Side { | 233 enum Side { |
234 LEFT, | 234 LEFT, |
235 RIGHT, | 235 RIGHT, |
236 RESULT | 236 RESULT |
237 }; | 237 }; |
238 | 238 |
239 explicit TypeFeedbackOracle(Handle<Code> code); | 239 TypeFeedbackOracle(Handle<Code> code, Handle<Context> global_context); |
240 | 240 |
241 bool LoadIsMonomorphic(Property* expr); | 241 bool LoadIsMonomorphic(Property* expr); |
242 bool StoreIsMonomorphic(Assignment* expr); | 242 bool StoreIsMonomorphic(Assignment* expr); |
243 bool CallIsMonomorphic(Call* expr); | 243 bool CallIsMonomorphic(Call* expr); |
244 | 244 |
245 Handle<Map> LoadMonomorphicReceiverType(Property* expr); | 245 Handle<Map> LoadMonomorphicReceiverType(Property* expr); |
246 Handle<Map> StoreMonomorphicReceiverType(Assignment* expr); | 246 Handle<Map> StoreMonomorphicReceiverType(Assignment* expr); |
247 Handle<Map> CallMonomorphicReceiverType(Call* expr); | |
248 | 247 |
249 ZoneMapList* LoadReceiverTypes(Property* expr, Handle<String> name); | 248 ZoneMapList* LoadReceiverTypes(Property* expr, Handle<String> name); |
250 ZoneMapList* StoreReceiverTypes(Assignment* expr, Handle<String> name); | 249 ZoneMapList* StoreReceiverTypes(Assignment* expr, Handle<String> name); |
251 ZoneMapList* CallReceiverTypes(Call* expr, Handle<String> name); | 250 ZoneMapList* CallReceiverTypes(Call* expr, Handle<String> name); |
252 | 251 |
| 252 CheckType GetCallCheckType(Call* expr); |
| 253 Handle<JSObject> GetPrototypeForPrimitiveCheck(CheckType check); |
| 254 |
253 bool LoadIsBuiltin(Property* expr, Builtins::Name id); | 255 bool LoadIsBuiltin(Property* expr, Builtins::Name id); |
254 | 256 |
255 // Get type information for arithmetic operations and compares. | 257 // Get type information for arithmetic operations and compares. |
256 TypeInfo BinaryType(BinaryOperation* expr, Side side); | 258 TypeInfo BinaryType(BinaryOperation* expr, Side side); |
257 TypeInfo CompareType(CompareOperation* expr, Side side); | 259 TypeInfo CompareType(CompareOperation* expr, Side side); |
258 TypeInfo SwitchType(CaseClause* clause); | 260 TypeInfo SwitchType(CaseClause* clause); |
259 | 261 |
260 private: | 262 private: |
261 void Initialize(Handle<Code> code); | 263 void Initialize(Handle<Code> code); |
262 | 264 |
263 bool IsMonomorphic(int pos) { return GetElement(map_, pos)->IsMap(); } | 265 bool IsMonomorphic(int pos) { return GetElement(map_, pos)->IsMap(); } |
264 | 266 |
265 ZoneMapList* CollectReceiverTypes(int position, | 267 ZoneMapList* CollectReceiverTypes(int position, |
266 Handle<String> name, | 268 Handle<String> name, |
267 Code::Flags flags); | 269 Code::Flags flags); |
268 | 270 |
269 void PopulateMap(Handle<Code> code); | 271 void PopulateMap(Handle<Code> code); |
270 | 272 |
271 void CollectPositions(Code* code, | 273 void CollectPositions(Code* code, |
272 List<int>* code_positions, | 274 List<int>* code_positions, |
273 List<int>* source_positions); | 275 List<int>* source_positions); |
274 | 276 |
| 277 Handle<Context> global_context_; |
275 Handle<JSObject> map_; | 278 Handle<JSObject> map_; |
276 | 279 |
277 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); | 280 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); |
278 }; | 281 }; |
279 | 282 |
280 } } // namespace v8::internal | 283 } } // namespace v8::internal |
281 | 284 |
282 #endif // V8_TYPE_INFO_H_ | 285 #endif // V8_TYPE_INFO_H_ |
OLD | NEW |