OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 5556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5567 } else if (lookup_.IsConstant()) { | 5567 } else if (lookup_.IsConstant()) { |
5568 constant_ = handle(lookup_.GetConstantFromMap(*map), isolate()); | 5568 constant_ = handle(lookup_.GetConstantFromMap(*map), isolate()); |
5569 } | 5569 } |
5570 | 5570 |
5571 return true; | 5571 return true; |
5572 } | 5572 } |
5573 | 5573 |
5574 | 5574 |
5575 void HOptimizedGraphBuilder::PropertyAccessInfo::LoadFieldMaps( | 5575 void HOptimizedGraphBuilder::PropertyAccessInfo::LoadFieldMaps( |
5576 Handle<Map> map) { | 5576 Handle<Map> map) { |
| 5577 // Clear any previously collected field maps. |
| 5578 field_maps_.Clear(); |
| 5579 |
5577 // Figure out the field type from the accessor map. | 5580 // Figure out the field type from the accessor map. |
5578 Handle<HeapType> field_type(lookup_.GetFieldTypeFromMap(*map), isolate()); | 5581 Handle<HeapType> field_type(lookup_.GetFieldTypeFromMap(*map), isolate()); |
5579 | 5582 |
5580 // Collect the (stable) maps from the field type. | 5583 // Collect the (stable) maps from the field type. |
5581 int num_field_maps = field_type->NumClasses(); | 5584 int num_field_maps = field_type->NumClasses(); |
5582 if (num_field_maps == 0) { | 5585 if (num_field_maps == 0) return; |
5583 field_maps_.Clear(); | |
5584 return; | |
5585 } | |
5586 ASSERT(access_.representation().IsHeapObject()); | 5586 ASSERT(access_.representation().IsHeapObject()); |
5587 field_maps_.Reserve(num_field_maps, zone()); | 5587 field_maps_.Reserve(num_field_maps, zone()); |
5588 HeapType::Iterator<Map> it = field_type->Classes(); | 5588 HeapType::Iterator<Map> it = field_type->Classes(); |
5589 while (!it.Done()) { | 5589 while (!it.Done()) { |
5590 Handle<Map> field_map = it.Current(); | 5590 Handle<Map> field_map = it.Current(); |
5591 if (!field_map->is_stable()) { | 5591 if (!field_map->is_stable()) { |
5592 field_maps_.Clear(); | 5592 field_maps_.Clear(); |
5593 return; | 5593 return; |
5594 } | 5594 } |
5595 field_maps_.Add(field_map, zone()); | 5595 field_maps_.Add(field_map, zone()); |
(...skipping 6048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11644 if (ShouldProduceTraceOutput()) { | 11644 if (ShouldProduceTraceOutput()) { |
11645 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11645 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11646 } | 11646 } |
11647 | 11647 |
11648 #ifdef DEBUG | 11648 #ifdef DEBUG |
11649 graph_->Verify(false); // No full verify. | 11649 graph_->Verify(false); // No full verify. |
11650 #endif | 11650 #endif |
11651 } | 11651 } |
11652 | 11652 |
11653 } } // namespace v8::internal | 11653 } } // namespace v8::internal |
OLD | NEW |