OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 14668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14679 } | 14679 } |
14680 DCHECK(object->HasFastSmiOrObjectElements() || | 14680 DCHECK(object->HasFastSmiOrObjectElements() || |
14681 object->HasFastDoubleElements()); | 14681 object->HasFastDoubleElements()); |
14682 | 14682 |
14683 // Collect holes at the end, undefined before that and the rest at the | 14683 // Collect holes at the end, undefined before that and the rest at the |
14684 // start, and return the number of non-hole, non-undefined values. | 14684 // start, and return the number of non-hole, non-undefined values. |
14685 | 14685 |
14686 Handle<FixedArrayBase> elements_base(object->elements()); | 14686 Handle<FixedArrayBase> elements_base(object->elements()); |
14687 uint32_t elements_length = static_cast<uint32_t>(elements_base->length()); | 14687 uint32_t elements_length = static_cast<uint32_t>(elements_base->length()); |
14688 if (limit > elements_length) { | 14688 if (limit > elements_length) { |
14689 limit = elements_length ; | 14689 limit = elements_length; |
14690 } | 14690 } |
14691 if (limit == 0) { | 14691 if (limit == 0) { |
14692 return handle(Smi::FromInt(0), isolate); | 14692 return handle(Smi::FromInt(0), isolate); |
14693 } | 14693 } |
14694 | 14694 |
14695 uint32_t result = 0; | 14695 uint32_t result = 0; |
14696 if (elements_base->map() == isolate->heap()->fixed_double_array_map()) { | 14696 if (elements_base->map() == isolate->heap()->fixed_double_array_map()) { |
14697 FixedDoubleArray* elements = FixedDoubleArray::cast(*elements_base); | 14697 FixedDoubleArray* elements = FixedDoubleArray::cast(*elements_base); |
14698 // Split elements into defined and the_hole, in that order. | 14698 // Split elements into defined and the_hole, in that order. |
14699 unsigned int holes = limit; | 14699 unsigned int holes = limit; |
(...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16745 if (cell->value() != *new_value) { | 16745 if (cell->value() != *new_value) { |
16746 cell->set_value(*new_value); | 16746 cell->set_value(*new_value); |
16747 Isolate* isolate = cell->GetIsolate(); | 16747 Isolate* isolate = cell->GetIsolate(); |
16748 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16748 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
16749 isolate, DependentCode::kPropertyCellChangedGroup); | 16749 isolate, DependentCode::kPropertyCellChangedGroup); |
16750 } | 16750 } |
16751 } | 16751 } |
16752 | 16752 |
16753 } // namespace internal | 16753 } // namespace internal |
16754 } // namespace v8 | 16754 } // namespace v8 |
OLD | NEW |