OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 8377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8388 | 8388 |
8389 | 8389 |
8390 Handle<FixedArray> JSObject::GetEnumPropertyKeys(Handle<JSObject> object) { | 8390 Handle<FixedArray> JSObject::GetEnumPropertyKeys(Handle<JSObject> object) { |
8391 Isolate* isolate = object->GetIsolate(); | 8391 Isolate* isolate = object->GetIsolate(); |
8392 if (object->HasFastProperties()) { | 8392 if (object->HasFastProperties()) { |
8393 return GetFastEnumPropertyKeys(isolate, object); | 8393 return GetFastEnumPropertyKeys(isolate, object); |
8394 } else if (object->IsJSGlobalObject()) { | 8394 } else if (object->IsJSGlobalObject()) { |
8395 Handle<GlobalDictionary> dictionary(object->global_dictionary()); | 8395 Handle<GlobalDictionary> dictionary(object->global_dictionary()); |
8396 int length = dictionary->NumberOfEnumElements(); | 8396 int length = dictionary->NumberOfEnumElements(); |
8397 if (length == 0) { | 8397 if (length == 0) { |
8398 return Handle<FixedArray>(isolate->heap()->empty_fixed_array()); | 8398 return isolate->factory()->empty_fixed_array(); |
8399 } | 8399 } |
8400 Handle<FixedArray> storage = isolate->factory()->NewFixedArray(length); | 8400 Handle<FixedArray> storage = isolate->factory()->NewFixedArray(length); |
8401 dictionary->CopyEnumKeysTo(*storage); | 8401 dictionary->CopyEnumKeysTo(*storage); |
8402 return storage; | 8402 return storage; |
8403 } else { | 8403 } else { |
8404 Handle<NameDictionary> dictionary(object->property_dictionary()); | 8404 Handle<NameDictionary> dictionary(object->property_dictionary()); |
8405 int length = dictionary->NumberOfEnumElements(); | 8405 int length = dictionary->NumberOfEnumElements(); |
8406 if (length == 0) { | 8406 if (length == 0) { |
8407 return Handle<FixedArray>(isolate->heap()->empty_fixed_array()); | 8407 return isolate->factory()->empty_fixed_array(); |
8408 } | 8408 } |
8409 Handle<FixedArray> storage = isolate->factory()->NewFixedArray(length); | 8409 Handle<FixedArray> storage = isolate->factory()->NewFixedArray(length); |
8410 dictionary->CopyEnumKeysTo(*storage); | 8410 dictionary->CopyEnumKeysTo(*storage); |
8411 return storage; | 8411 return storage; |
8412 } | 8412 } |
8413 } | 8413 } |
8414 | 8414 |
8415 | 8415 |
8416 enum IndexedOrNamed { kIndexed, kNamed }; | 8416 enum IndexedOrNamed { kIndexed, kNamed }; |
8417 | 8417 |
(...skipping 11342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19760 if (cell->value() != *new_value) { | 19760 if (cell->value() != *new_value) { |
19761 cell->set_value(*new_value); | 19761 cell->set_value(*new_value); |
19762 Isolate* isolate = cell->GetIsolate(); | 19762 Isolate* isolate = cell->GetIsolate(); |
19763 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19763 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
19764 isolate, DependentCode::kPropertyCellChangedGroup); | 19764 isolate, DependentCode::kPropertyCellChangedGroup); |
19765 } | 19765 } |
19766 } | 19766 } |
19767 | 19767 |
19768 } // namespace internal | 19768 } // namespace internal |
19769 } // namespace v8 | 19769 } // namespace v8 |
OLD | NEW |