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

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

Issue 1406113007: Merge GlobalObject with JSGlobalObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/isolate-inl.h ('k') | src/lookup.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #ifndef V8_JSON_STRINGIFIER_H_ 5 #ifndef V8_JSON_STRINGIFIER_H_
6 #define V8_JSON_STRINGIFIER_H_ 6 #define V8_JSON_STRINGIFIER_H_
7 7
8 #include "src/conversions.h" 8 #include "src/conversions.h"
9 #include "src/lookup.h" 9 #include "src/lookup.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 } 512 }
513 return SUCCESS; 513 return SUCCESS;
514 } 514 }
515 515
516 516
517 BasicJsonStringifier::Result BasicJsonStringifier::SerializeJSObject( 517 BasicJsonStringifier::Result BasicJsonStringifier::SerializeJSObject(
518 Handle<JSObject> object) { 518 Handle<JSObject> object) {
519 HandleScope handle_scope(isolate_); 519 HandleScope handle_scope(isolate_);
520 Result stack_push = StackPush(object); 520 Result stack_push = StackPush(object);
521 if (stack_push != SUCCESS) return stack_push; 521 if (stack_push != SUCCESS) return stack_push;
522 DCHECK(!object->IsJSGlobalProxy() && !object->IsGlobalObject()); 522 DCHECK(!object->IsJSGlobalProxy() && !object->IsJSGlobalObject());
523 523
524 builder_.AppendCharacter('{'); 524 builder_.AppendCharacter('{');
525 bool comma = false; 525 bool comma = false;
526 526
527 if (object->HasFastProperties() && 527 if (object->HasFastProperties() &&
528 !object->HasIndexedInterceptor() && 528 !object->HasIndexedInterceptor() &&
529 !object->HasNamedInterceptor() && 529 !object->HasNamedInterceptor() &&
530 object->elements()->length() == 0) { 530 object->elements()->length() == 0) {
531 Handle<Map> map(object->map()); 531 Handle<Map> map(object->map());
532 for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) { 532 for (int i = 0; i < map->NumberOfOwnDescriptors(); i++) {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 } else { 673 } else {
674 SerializeString_<uc16, uc16>(object); 674 SerializeString_<uc16, uc16>(object);
675 } 675 }
676 } 676 }
677 } 677 }
678 678
679 } // namespace internal 679 } // namespace internal
680 } // namespace v8 680 } // namespace v8
681 681
682 #endif // V8_JSON_STRINGIFIER_H_ 682 #endif // V8_JSON_STRINGIFIER_H_
OLDNEW
« no previous file with comments | « src/isolate-inl.h ('k') | src/lookup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698