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

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

Issue 6075012: Clean up code for type feedback a bit.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 11 months 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 | « src/hydrogen.cc ('k') | src/type-info.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 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 class Assignment; 223 class Assignment;
224 class BinaryOperation; 224 class BinaryOperation;
225 class Call; 225 class Call;
226 class CompareOperation; 226 class CompareOperation;
227 class CompilationInfo; 227 class CompilationInfo;
228 class Property; 228 class Property;
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 {
234 LEFT,
235 RIGHT,
236 RESULT
237 };
238
239 explicit TypeFeedbackOracle(Handle<Code> code); 233 explicit TypeFeedbackOracle(Handle<Code> code);
240 234
241 bool LoadIsMonomorphic(Property* expr); 235 bool LoadIsMonomorphic(Property* expr);
242 bool StoreIsMonomorphic(Assignment* expr); 236 bool StoreIsMonomorphic(Assignment* expr);
243 bool CallIsMonomorphic(Call* expr); 237 bool CallIsMonomorphic(Call* expr);
244 238
245 Handle<Map> LoadMonomorphicReceiverType(Property* expr); 239 Handle<Map> LoadMonomorphicReceiverType(Property* expr);
246 Handle<Map> StoreMonomorphicReceiverType(Assignment* expr); 240 Handle<Map> StoreMonomorphicReceiverType(Assignment* expr);
247 Handle<Map> CallMonomorphicReceiverType(Call* expr); 241 Handle<Map> CallMonomorphicReceiverType(Call* expr);
248 242
249 ZoneMapList* LoadReceiverTypes(Property* expr, Handle<String> name); 243 ZoneMapList* LoadReceiverTypes(Property* expr, Handle<String> name);
250 ZoneMapList* StoreReceiverTypes(Assignment* expr, Handle<String> name); 244 ZoneMapList* StoreReceiverTypes(Assignment* expr, Handle<String> name);
251 ZoneMapList* CallReceiverTypes(Call* expr, Handle<String> name); 245 ZoneMapList* CallReceiverTypes(Call* expr, Handle<String> name);
252 246
253 bool LoadIsBuiltin(Property* expr, Builtins::Name id); 247 bool LoadIsBuiltin(Property* expr, Builtins::Name id);
254 248
255 // Get type information for arithmetic operations and compares. 249 // Get type information for arithmetic operations and compares.
256 TypeInfo BinaryType(BinaryOperation* expr, Side side); 250 TypeInfo BinaryType(BinaryOperation* expr);
257 TypeInfo CompareType(CompareOperation* expr, Side side); 251 TypeInfo CompareType(CompareOperation* expr);
258 TypeInfo SwitchType(CaseClause* clause); 252 TypeInfo SwitchType(CaseClause* clause);
259 253
260 private: 254 private:
261 void Initialize(Handle<Code> code); 255 void Initialize(Handle<Code> code);
262 256
263 bool IsMonomorphic(int pos) { return GetElement(map_, pos)->IsMap(); } 257 bool IsMonomorphic(int pos) { return GetElement(map_, pos)->IsMap(); }
264 258
265 ZoneMapList* CollectReceiverTypes(int position, 259 ZoneMapList* CollectReceiverTypes(int position,
266 Handle<String> name, 260 Handle<String> name,
267 Code::Flags flags); 261 Code::Flags flags);
268 262
269 void PopulateMap(Handle<Code> code); 263 void PopulateMap(Handle<Code> code);
270 264
271 void CollectPositions(Code* code, 265 void CollectPositions(Code* code,
272 List<int>* code_positions, 266 List<int>* code_positions,
273 List<int>* source_positions); 267 List<int>* source_positions);
274 268
275 Handle<JSObject> map_; 269 Handle<JSObject> map_;
276 270
277 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); 271 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle);
278 }; 272 };
279 273
280 } } // namespace v8::internal 274 } } // namespace v8::internal
281 275
282 #endif // V8_TYPE_INFO_H_ 276 #endif // V8_TYPE_INFO_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/type-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698