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

Side by Side Diff: src/json-stringifier.cc

Issue 2624903003: [runtime] Use PropertyKind/PropertyLocation instead of PropertyType. (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/json-stringifier.h" 5 #include "src/json-stringifier.h"
6 6
7 #include "src/conversions.h" 7 #include "src/conversions.h"
8 #include "src/lookup.h" 8 #include "src/lookup.h"
9 #include "src/messages.h" 9 #include "src/messages.h"
10 #include "src/objects-inl.h" 10 #include "src/objects-inl.h"
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 Indent(); 527 Indent();
528 bool comma = false; 528 bool comma = false;
529 for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) { 529 for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) {
530 Handle<Name> name(map->instance_descriptors()->GetKey(i), isolate_); 530 Handle<Name> name(map->instance_descriptors()->GetKey(i), isolate_);
531 // TODO(rossberg): Should this throw? 531 // TODO(rossberg): Should this throw?
532 if (!name->IsString()) continue; 532 if (!name->IsString()) continue;
533 Handle<String> key = Handle<String>::cast(name); 533 Handle<String> key = Handle<String>::cast(name);
534 PropertyDetails details = map->instance_descriptors()->GetDetails(i); 534 PropertyDetails details = map->instance_descriptors()->GetDetails(i);
535 if (details.IsDontEnum()) continue; 535 if (details.IsDontEnum()) continue;
536 Handle<Object> property; 536 Handle<Object> property;
537 if (details.type() == DATA && *map == js_obj->map()) { 537 if (details.location() == kField && *map == js_obj->map()) {
Jakob Kummerow 2017/01/12 15:40:30 DCHECK_EQ(kData, details.kind());
Igor Sheludko 2017/01/12 15:52:31 Done.
538 FieldIndex field_index = FieldIndex::ForDescriptor(*map, i); 538 FieldIndex field_index = FieldIndex::ForDescriptor(*map, i);
539 property = JSObject::FastPropertyAt(js_obj, details.representation(), 539 property = JSObject::FastPropertyAt(js_obj, details.representation(),
540 field_index); 540 field_index);
541 } else { 541 } else {
542 ASSIGN_RETURN_ON_EXCEPTION_VALUE( 542 ASSIGN_RETURN_ON_EXCEPTION_VALUE(
543 isolate_, property, Object::GetPropertyOrElement(js_obj, key), 543 isolate_, property, Object::GetPropertyOrElement(js_obj, key),
544 EXCEPTION); 544 EXCEPTION);
545 } 545 }
546 Result result = SerializeProperty(property, comma, key); 546 Result result = SerializeProperty(property, comma, key);
547 if (!comma && result == SUCCESS) comma = true; 547 if (!comma && result == SUCCESS) comma = true;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 if (object->IsOneByteRepresentationUnderneath()) { 713 if (object->IsOneByteRepresentationUnderneath()) {
714 SerializeString_<uint8_t, uc16>(object); 714 SerializeString_<uint8_t, uc16>(object);
715 } else { 715 } else {
716 SerializeString_<uc16, uc16>(object); 716 SerializeString_<uc16, uc16>(object);
717 } 717 }
718 } 718 }
719 } 719 }
720 720
721 } // namespace internal 721 } // namespace internal
722 } // namespace v8 722 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698