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

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

Issue 2002203002: [api] Add more parameters to Object::GetPropertyNames (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2016-05-06_keys_fast_path_1995263002
Patch Set: addressing nits Created 4 years, 6 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/elements.cc ('k') | src/keys.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 StackPop(); 530 StackPop();
531 return SUCCESS; 531 return SUCCESS;
532 } 532 }
533 533
534 JsonStringifier::Result JsonStringifier::SerializeJSReceiverSlow( 534 JsonStringifier::Result JsonStringifier::SerializeJSReceiverSlow(
535 Handle<JSReceiver> object) { 535 Handle<JSReceiver> object) {
536 Handle<FixedArray> contents = property_list_; 536 Handle<FixedArray> contents = property_list_;
537 if (contents.is_null()) { 537 if (contents.is_null()) {
538 ASSIGN_RETURN_ON_EXCEPTION_VALUE( 538 ASSIGN_RETURN_ON_EXCEPTION_VALUE(
539 isolate_, contents, 539 isolate_, contents,
540 KeyAccumulator::GetKeys(object, OWN_ONLY, ENUMERABLE_STRINGS), 540 KeyAccumulator::GetKeys(object, KeyCollectionMode::kOwnOnly,
541 ENUMERABLE_STRINGS),
541 EXCEPTION); 542 EXCEPTION);
542 } 543 }
543 builder_.AppendCharacter('{'); 544 builder_.AppendCharacter('{');
544 Indent(); 545 Indent();
545 bool comma = false; 546 bool comma = false;
546 for (int i = 0; i < contents->length(); i++) { 547 for (int i = 0; i < contents->length(); i++) {
547 Object* key = contents->get(i); 548 Object* key = contents->get(i);
548 Handle<String> key_handle; 549 Handle<String> key_handle;
549 MaybeHandle<Object> maybe_property; 550 MaybeHandle<Object> maybe_property;
550 if (key->IsString()) { 551 if (key->IsString()) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 if (object->IsOneByteRepresentationUnderneath()) { 698 if (object->IsOneByteRepresentationUnderneath()) {
698 SerializeString_<uint8_t, uc16>(object); 699 SerializeString_<uint8_t, uc16>(object);
699 } else { 700 } else {
700 SerializeString_<uc16, uc16>(object); 701 SerializeString_<uc16, uc16>(object);
701 } 702 }
702 } 703 }
703 } 704 }
704 705
705 } // namespace internal 706 } // namespace internal
706 } // namespace v8 707 } // namespace v8
OLDNEW
« no previous file with comments | « src/elements.cc ('k') | src/keys.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698