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

Side by Side Diff: src/ast.h

Issue 23615012: Properly filter types using the initial map from HAllocate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 3 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 | « no previous file | src/ast.cc » ('j') | src/ast.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 void AddMapIfMissing(Handle<Map> map, Zone* zone) { 281 void AddMapIfMissing(Handle<Map> map, Zone* zone) {
282 Map* updated = map->CurrentMapForDeprecated(); 282 Map* updated = map->CurrentMapForDeprecated();
283 if (updated == NULL) return; 283 if (updated == NULL) return;
284 map = Handle<Map>(updated); 284 map = Handle<Map>(updated);
285 for (int i = 0; i < length(); ++i) { 285 for (int i = 0; i < length(); ++i) {
286 if (at(i).is_identical_to(map)) return; 286 if (at(i).is_identical_to(map)) return;
287 } 287 }
288 Add(map, zone); 288 Add(map, zone);
289 } 289 }
290 290
291 void FilterForPossibleTransitions(Map* root_map) {
292 for (int i = list_.length() - 1; i >= 0; i--) {
293 if (at(i)->FindRootMap() != root_map) {
294 list_.RemoveElement(list_.at(i));
295 }
296 }
297 }
298
291 void Add(Handle<Map> handle, Zone* zone) { 299 void Add(Handle<Map> handle, Zone* zone) {
292 list_.Add(handle.location(), zone); 300 list_.Add(handle.location(), zone);
293 } 301 }
294 302
295 Handle<Map> at(int i) const { 303 Handle<Map> at(int i) const {
296 return Handle<Map>(list_.at(i)); 304 return Handle<Map>(list_.at(i));
297 } 305 }
298 306
299 Handle<Map> first() const { return at(0); } 307 Handle<Map> first() const { return at(0); }
300 Handle<Map> last() const { return at(length() - 1); } 308 Handle<Map> last() const { return at(length() - 1); }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 367
360 // Type feedback information for assignments and properties. 368 // Type feedback information for assignments and properties.
361 virtual bool IsMonomorphic() { 369 virtual bool IsMonomorphic() {
362 UNREACHABLE(); 370 UNREACHABLE();
363 return false; 371 return false;
364 } 372 }
365 virtual SmallMapList* GetReceiverTypes() { 373 virtual SmallMapList* GetReceiverTypes() {
366 UNREACHABLE(); 374 UNREACHABLE();
367 return NULL; 375 return NULL;
368 } 376 }
369 Handle<Map> GetMonomorphicReceiverType() {
370 ASSERT(IsMonomorphic());
371 SmallMapList* types = GetReceiverTypes();
372 ASSERT(types != NULL && types->length() == 1);
373 return types->at(0);
374 }
375 virtual KeyedAccessStoreMode GetStoreMode() { 377 virtual KeyedAccessStoreMode GetStoreMode() {
376 UNREACHABLE(); 378 UNREACHABLE();
377 return STANDARD_STORE; 379 return STANDARD_STORE;
378 } 380 }
379 381
380 // TODO(rossberg): this should move to its own AST node eventually. 382 // TODO(rossberg): this should move to its own AST node eventually.
381 virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle); 383 virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle);
382 byte to_boolean_types() const { return to_boolean_types_; } 384 byte to_boolean_types() const { return to_boolean_types_; }
383 385
384 BailoutId id() const { return id_; } 386 BailoutId id() const { return id_; }
(...skipping 2870 matching lines...) Expand 10 before | Expand all | Expand 10 after
3255 private: 3257 private:
3256 Isolate* isolate_; 3258 Isolate* isolate_;
3257 Zone* zone_; 3259 Zone* zone_;
3258 Visitor visitor_; 3260 Visitor visitor_;
3259 }; 3261 };
3260 3262
3261 3263
3262 } } // namespace v8::internal 3264 } } // namespace v8::internal
3263 3265
3264 #endif // V8_AST_H_ 3266 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/ast.cc » ('j') | src/ast.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698