Chromium Code Reviews

Side by Side Diff: src/type-info.h

Issue 6880276: Use type info for count operation in Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 212 matching lines...)
223 DEFAULT_STRING_STUB = 0, 223 DEFAULT_STRING_STUB = 0,
224 STRING_INDEX_OUT_OF_BOUNDS = 1 224 STRING_INDEX_OUT_OF_BOUNDS = 1
225 }; 225 };
226 226
227 227
228 // Forward declarations. 228 // Forward declarations.
229 class Assignment; 229 class Assignment;
230 class BinaryOperation; 230 class BinaryOperation;
231 class Call; 231 class Call;
232 class CompareOperation; 232 class CompareOperation;
233 class CountOperation;
233 class CompilationInfo; 234 class CompilationInfo;
234 class Property; 235 class Property;
235 class CaseClause; 236 class CaseClause;
236 237
237 class TypeFeedbackOracle BASE_EMBEDDED { 238 class TypeFeedbackOracle BASE_EMBEDDED {
238 public: 239 public:
239 TypeFeedbackOracle(Handle<Code> code, Handle<Context> global_context); 240 TypeFeedbackOracle(Handle<Code> code, Handle<Context> global_context);
240 241
241 bool LoadIsMonomorphic(Property* expr); 242 bool LoadIsMonomorphic(Property* expr);
242 bool StoreIsMonomorphic(Expression* expr); 243 bool StoreIsMonomorphic(Expression* expr);
(...skipping 11 matching lines...)
254 255
255 CheckType GetCallCheckType(Call* expr); 256 CheckType GetCallCheckType(Call* expr);
256 Handle<JSObject> GetPrototypeForPrimitiveCheck(CheckType check); 257 Handle<JSObject> GetPrototypeForPrimitiveCheck(CheckType check);
257 258
258 bool LoadIsBuiltin(Property* expr, Builtins::Name id); 259 bool LoadIsBuiltin(Property* expr, Builtins::Name id);
259 260
260 // Get type information for arithmetic operations and compares. 261 // Get type information for arithmetic operations and compares.
261 TypeInfo BinaryType(BinaryOperation* expr); 262 TypeInfo BinaryType(BinaryOperation* expr);
262 TypeInfo CompareType(CompareOperation* expr); 263 TypeInfo CompareType(CompareOperation* expr);
263 TypeInfo SwitchType(CaseClause* clause); 264 TypeInfo SwitchType(CaseClause* clause);
265 TypeInfo IncrementType(CountOperation* expr);
264 266
265 private: 267 private:
266 ZoneMapList* CollectReceiverTypes(unsigned ast_id, 268 ZoneMapList* CollectReceiverTypes(unsigned ast_id,
267 Handle<String> name, 269 Handle<String> name,
268 Code::Flags flags); 270 Code::Flags flags);
269 271
270 void SetInfo(unsigned ast_id, Object* target); 272 void SetInfo(unsigned ast_id, Object* target);
271 273
272 void PopulateMap(Handle<Code> code); 274 void PopulateMap(Handle<Code> code);
273 275
274 void CollectIds(Code* code, 276 void CollectIds(Code* code,
275 List<int>* code_positions, 277 List<int>* code_positions,
276 List<unsigned>* ast_ids); 278 List<unsigned>* ast_ids);
277 279
278 // Returns an element from the backing store. Returns undefined if 280 // Returns an element from the backing store. Returns undefined if
279 // there is no information. 281 // there is no information.
280 Handle<Object> GetInfo(unsigned ast_id); 282 Handle<Object> GetInfo(unsigned ast_id);
281 283
282 Handle<Context> global_context_; 284 Handle<Context> global_context_;
283 Handle<NumberDictionary> dictionary_; 285 Handle<NumberDictionary> dictionary_;
284 286
285 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); 287 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle);
286 }; 288 };
287 289
288 } } // namespace v8::internal 290 } } // namespace v8::internal
289 291
290 #endif // V8_TYPE_INFO_H_ 292 #endif // V8_TYPE_INFO_H_
OLDNEW

Powered by Google App Engine