OLD | NEW |
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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 Handle<Object> object = GetInfo(ast_id); | 408 Handle<Object> object = GetInfo(ast_id); |
409 if (object->IsUndefined() || object->IsSmi()) return; | 409 if (object->IsUndefined() || object->IsSmi()) return; |
410 | 410 |
411 if (*object == | 411 if (*object == |
412 isolate_->builtins()->builtin(Builtins::kStoreIC_GlobalProxy)) { | 412 isolate_->builtins()->builtin(Builtins::kStoreIC_GlobalProxy)) { |
413 // TODO(fschneider): We could collect the maps and signal that | 413 // TODO(fschneider): We could collect the maps and signal that |
414 // we need a generic store (or load) here. | 414 // we need a generic store (or load) here. |
415 ASSERT(Handle<Code>::cast(object)->ic_state() == MEGAMORPHIC); | 415 ASSERT(Handle<Code>::cast(object)->ic_state() == MEGAMORPHIC); |
416 } else if (object->IsMap()) { | 416 } else if (object->IsMap()) { |
417 types->Add(Handle<Map>::cast(object)); | 417 types->Add(Handle<Map>::cast(object)); |
418 } else if (Handle<Code>::cast(object)->ic_state() == MEGAMORPHIC) { | 418 } else if (FLAG_collect_megamorphic_maps_from_stub_cache && |
| 419 Handle<Code>::cast(object)->ic_state() == MEGAMORPHIC) { |
419 types->Reserve(4); | 420 types->Reserve(4); |
420 ASSERT(object->IsCode()); | 421 ASSERT(object->IsCode()); |
421 isolate_->stub_cache()->CollectMatchingMaps(types, *name, flags); | 422 isolate_->stub_cache()->CollectMatchingMaps(types, *name, flags); |
422 } | 423 } |
423 } | 424 } |
424 | 425 |
425 | 426 |
426 static void AddMapIfMissing(Handle<Map> map, SmallMapList* list) { | 427 static void AddMapIfMissing(Handle<Map> map, SmallMapList* list) { |
427 for (int i = 0; i < list->length(); ++i) { | 428 for (int i = 0; i < list->length(); ++i) { |
428 if (list->at(i).is_identical_to(map)) return; | 429 if (list->at(i).is_identical_to(map)) return; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 USE(maybe_result); | 565 USE(maybe_result); |
565 #ifdef DEBUG | 566 #ifdef DEBUG |
566 Object* result = NULL; | 567 Object* result = NULL; |
567 // Dictionary has been allocated with sufficient size for all elements. | 568 // Dictionary has been allocated with sufficient size for all elements. |
568 ASSERT(maybe_result->ToObject(&result)); | 569 ASSERT(maybe_result->ToObject(&result)); |
569 ASSERT(*dictionary_ == result); | 570 ASSERT(*dictionary_ == result); |
570 #endif | 571 #endif |
571 } | 572 } |
572 | 573 |
573 } } // namespace v8::internal | 574 } } // namespace v8::internal |
OLD | NEW |