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 13542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13553 // If the object is in dictionary mode, it is converted to fast elements | 13553 // If the object is in dictionary mode, it is converted to fast elements |
13554 // mode. | 13554 // mode. |
13555 MaybeObject* JSObject::PrepareElementsForSort(uint32_t limit) { | 13555 MaybeObject* JSObject::PrepareElementsForSort(uint32_t limit) { |
13556 Heap* heap = GetHeap(); | 13556 Heap* heap = GetHeap(); |
13557 | 13557 |
13558 if (HasDictionaryElements()) { | 13558 if (HasDictionaryElements()) { |
13559 // Convert to fast elements containing only the existing properties. | 13559 // Convert to fast elements containing only the existing properties. |
13560 // Ordering is irrelevant, since we are going to sort anyway. | 13560 // Ordering is irrelevant, since we are going to sort anyway. |
13561 SeededNumberDictionary* dict = element_dictionary(); | 13561 SeededNumberDictionary* dict = element_dictionary(); |
13562 if (IsJSArray() || dict->requires_slow_elements() || | 13562 if (IsJSArray() || dict->requires_slow_elements() || |
13563 dict->max_number_key() >= limit) { | 13563 dict->max_number_key() >= limit || map()->is_observed()) { |
13564 return PrepareSlowElementsForSort(limit); | 13564 return PrepareSlowElementsForSort(limit); |
13565 } | 13565 } |
13566 // Convert to fast elements. | 13566 // Convert to fast elements. |
13567 | 13567 |
13568 Object* obj; | 13568 Object* obj; |
13569 MaybeObject* maybe_obj = GetElementsTransitionMap(GetIsolate(), | 13569 MaybeObject* maybe_obj = GetElementsTransitionMap(GetIsolate(), |
13570 FAST_HOLEY_ELEMENTS); | 13570 FAST_HOLEY_ELEMENTS); |
13571 if (!maybe_obj->ToObject(&obj)) return maybe_obj; | 13571 if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
13572 Map* new_map = Map::cast(obj); | 13572 Map* new_map = Map::cast(obj); |
13573 | 13573 |
(...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15428 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 15428 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
15429 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 15429 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
15430 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 15430 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
15431 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 15431 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
15432 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 15432 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
15433 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 15433 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
15434 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 15434 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
15435 } | 15435 } |
15436 | 15436 |
15437 } } // namespace v8::internal | 15437 } } // namespace v8::internal |
OLD | NEW |