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 7967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7978 if (object->IsJSValue()) { | 7978 if (object->IsJSValue()) { |
7979 Object* value = JSValue::cast(object)->value(); | 7979 Object* value = JSValue::cast(object)->value(); |
7980 if (value->IsString()) { | 7980 if (value->IsString()) { |
7981 if (String::cast(value)->length() > 0) return true; | 7981 if (String::cast(value)->length() > 0) return true; |
7982 } | 7982 } |
7983 } | 7983 } |
7984 switch (object->GetElementsKind()) { | 7984 switch (object->GetElementsKind()) { |
7985 case FAST_SMI_ELEMENTS: | 7985 case FAST_SMI_ELEMENTS: |
7986 case FAST_ELEMENTS: | 7986 case FAST_ELEMENTS: |
7987 case FAST_DOUBLE_ELEMENTS: { | 7987 case FAST_DOUBLE_ELEMENTS: { |
7988 DCHECK(object->IsJSArray()); | 7988 int length = object->IsJSArray() |
7989 int length = Smi::cast(JSArray::cast(object)->length())->value(); | 7989 ? Smi::cast(JSArray::cast(object)->length())->value() |
| 7990 : object->elements()->length(); |
7990 return length > 0; | 7991 return length > 0; |
7991 } | 7992 } |
7992 case FAST_HOLEY_SMI_ELEMENTS: | 7993 case FAST_HOLEY_SMI_ELEMENTS: |
7993 case FAST_HOLEY_ELEMENTS: { | 7994 case FAST_HOLEY_ELEMENTS: { |
7994 FixedArray* elements = FixedArray::cast(object->elements()); | 7995 FixedArray* elements = FixedArray::cast(object->elements()); |
7995 int length = object->IsJSArray() | 7996 int length = object->IsJSArray() |
7996 ? Smi::cast(JSArray::cast(object)->length())->value() | 7997 ? Smi::cast(JSArray::cast(object)->length())->value() |
7997 : elements->length(); | 7998 : elements->length(); |
7998 for (int i = 0; i < length; i++) { | 7999 for (int i = 0; i < length; i++) { |
7999 if (!elements->is_the_hole(i)) return true; | 8000 if (!elements->is_the_hole(i)) return true; |
(...skipping 11163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19163 if (cell->value() != *new_value) { | 19164 if (cell->value() != *new_value) { |
19164 cell->set_value(*new_value); | 19165 cell->set_value(*new_value); |
19165 Isolate* isolate = cell->GetIsolate(); | 19166 Isolate* isolate = cell->GetIsolate(); |
19166 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19167 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
19167 isolate, DependentCode::kPropertyCellChangedGroup); | 19168 isolate, DependentCode::kPropertyCellChangedGroup); |
19168 } | 19169 } |
19169 } | 19170 } |
19170 | 19171 |
19171 } // namespace internal | 19172 } // namespace internal |
19172 } // namespace v8 | 19173 } // namespace v8 |
OLD | NEW |