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

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

Issue 6172001: Revert r6194: 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
233 explicit TypeFeedbackOracle(Handle<Code> code); 239 explicit TypeFeedbackOracle(Handle<Code> code);
234 240
235 bool LoadIsMonomorphic(Property* expr); 241 bool LoadIsMonomorphic(Property* expr);
236 bool StoreIsMonomorphic(Assignment* expr); 242 bool StoreIsMonomorphic(Assignment* expr);
237 bool CallIsMonomorphic(Call* expr); 243 bool CallIsMonomorphic(Call* expr);
238 244
239 Handle<Map> LoadMonomorphicReceiverType(Property* expr); 245 Handle<Map> LoadMonomorphicReceiverType(Property* expr);
240 Handle<Map> StoreMonomorphicReceiverType(Assignment* expr); 246 Handle<Map> StoreMonomorphicReceiverType(Assignment* expr);
241 Handle<Map> CallMonomorphicReceiverType(Call* expr); 247 Handle<Map> CallMonomorphicReceiverType(Call* expr);
242 248
243 ZoneMapList* LoadReceiverTypes(Property* expr, Handle<String> name); 249 ZoneMapList* LoadReceiverTypes(Property* expr, Handle<String> name);
244 ZoneMapList* StoreReceiverTypes(Assignment* expr, Handle<String> name); 250 ZoneMapList* StoreReceiverTypes(Assignment* expr, Handle<String> name);
245 ZoneMapList* CallReceiverTypes(Call* expr, Handle<String> name); 251 ZoneMapList* CallReceiverTypes(Call* expr, Handle<String> name);
246 252
247 bool LoadIsBuiltin(Property* expr, Builtins::Name id); 253 bool LoadIsBuiltin(Property* expr, Builtins::Name id);
248 254
249 // Get type information for arithmetic operations and compares. 255 // Get type information for arithmetic operations and compares.
250 TypeInfo BinaryType(BinaryOperation* expr); 256 TypeInfo BinaryType(BinaryOperation* expr, Side side);
251 TypeInfo CompareType(CompareOperation* expr); 257 TypeInfo CompareType(CompareOperation* expr, Side side);
252 TypeInfo SwitchType(CaseClause* clause); 258 TypeInfo SwitchType(CaseClause* clause);
253 259
254 private: 260 private:
255 void Initialize(Handle<Code> code); 261 void Initialize(Handle<Code> code);
256 262
257 bool IsMonomorphic(int pos) { return GetElement(map_, pos)->IsMap(); } 263 bool IsMonomorphic(int pos) { return GetElement(map_, pos)->IsMap(); }
258 264
259 ZoneMapList* CollectReceiverTypes(int position, 265 ZoneMapList* CollectReceiverTypes(int position,
260 Handle<String> name, 266 Handle<String> name,
261 Code::Flags flags); 267 Code::Flags flags);
262 268
263 void PopulateMap(Handle<Code> code); 269 void PopulateMap(Handle<Code> code);
264 270
265 void CollectPositions(Code* code, 271 void CollectPositions(Code* code,
266 List<int>* code_positions, 272 List<int>* code_positions,
267 List<int>* source_positions); 273 List<int>* source_positions);
268 274
269 Handle<JSObject> map_; 275 Handle<JSObject> map_;
270 276
271 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle); 277 DISALLOW_COPY_AND_ASSIGN(TypeFeedbackOracle);
272 }; 278 };
273 279
274 } } // namespace v8::internal 280 } } // namespace v8::internal
275 281
276 #endif // V8_TYPE_INFO_H_ 282 #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