| 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 2880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2891 } else { | 2891 } else { |
| 2892 // Set the new map first to satify the elements type assert in | 2892 // Set the new map first to satify the elements type assert in |
| 2893 // set_elements(). | 2893 // set_elements(). |
| 2894 Object* new_map; | 2894 Object* new_map; |
| 2895 MaybeObject* maybe = map()->GetSlowElementsMap(); | 2895 MaybeObject* maybe = map()->GetSlowElementsMap(); |
| 2896 if (!maybe->ToObject(&new_map)) return maybe; | 2896 if (!maybe->ToObject(&new_map)) return maybe; |
| 2897 set_map(Map::cast(new_map)); | 2897 set_map(Map::cast(new_map)); |
| 2898 set_elements(dictionary); | 2898 set_elements(dictionary); |
| 2899 } | 2899 } |
| 2900 | 2900 |
| 2901 old_map->GetHeap()->isolate()->counters()->elements_to_dictionary()->Increment
(); | 2901 old_map->GetHeap()->isolate()->counters()->elements_to_dictionary()-> |
| 2902 Increment(); |
| 2902 | 2903 |
| 2903 #ifdef DEBUG | 2904 #ifdef DEBUG |
| 2904 if (FLAG_trace_normalization) { | 2905 if (FLAG_trace_normalization) { |
| 2905 PrintF("Object elements have been normalized:\n"); | 2906 PrintF("Object elements have been normalized:\n"); |
| 2906 Print(); | 2907 Print(); |
| 2907 } | 2908 } |
| 2908 #endif | 2909 #endif |
| 2909 | 2910 |
| 2910 ASSERT(HasDictionaryElements() || HasDictionaryArgumentsElements()); | 2911 ASSERT(HasDictionaryElements() || HasDictionaryArgumentsElements()); |
| 2911 return dictionary; | 2912 return dictionary; |
| (...skipping 8801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11713 if (break_point_objects()->IsUndefined()) return 0; | 11714 if (break_point_objects()->IsUndefined()) return 0; |
| 11714 // Single beak point. | 11715 // Single beak point. |
| 11715 if (!break_point_objects()->IsFixedArray()) return 1; | 11716 if (!break_point_objects()->IsFixedArray()) return 1; |
| 11716 // Multiple break points. | 11717 // Multiple break points. |
| 11717 return FixedArray::cast(break_point_objects())->length(); | 11718 return FixedArray::cast(break_point_objects())->length(); |
| 11718 } | 11719 } |
| 11719 #endif | 11720 #endif |
| 11720 | 11721 |
| 11721 | 11722 |
| 11722 } } // namespace v8::internal | 11723 } } // namespace v8::internal |
| OLD | NEW |