Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Side by Side Diff: src/objects.cc

Issue 1831783002: [keys] adding fast-path for dict-mode objects with own keys only (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: simplifying simple property test Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/keys.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/keys.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698