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

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

Issue 390323002: Remove JSReceiver::GetPrototype and replace it with PrototypeIterator calls (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/isolate.cc ('k') | src/objects.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 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/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 return SUCCESS; 624 return SUCCESS;
625 } 625 }
626 626
627 627
628 BasicJsonStringifier::Result BasicJsonStringifier::SerializeJSObject( 628 BasicJsonStringifier::Result BasicJsonStringifier::SerializeJSObject(
629 Handle<JSObject> object) { 629 Handle<JSObject> object) {
630 HandleScope handle_scope(isolate_); 630 HandleScope handle_scope(isolate_);
631 Result stack_push = StackPush(object); 631 Result stack_push = StackPush(object);
632 if (stack_push != SUCCESS) return stack_push; 632 if (stack_push != SUCCESS) return stack_push;
633 if (object->IsJSGlobalProxy()) { 633 if (object->IsJSGlobalProxy()) {
634 object = Handle<JSObject>( 634 // TODO(verwaest): This will crash if the global proxy is detached.
635 JSObject::cast(object->GetPrototype()), isolate_); 635 PrototypeIterator iter(isolate_, object);
636 object = Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter));
636 ASSERT(object->IsGlobalObject()); 637 ASSERT(object->IsGlobalObject());
637 } 638 }
638 639
639 Append('{'); 640 Append('{');
640 bool comma = false; 641 bool comma = false;
641 642
642 if (object->HasFastProperties() && 643 if (object->HasFastProperties() &&
643 !object->HasIndexedInterceptor() && 644 !object->HasIndexedInterceptor() &&
644 !object->HasNamedInterceptor() && 645 !object->HasNamedInterceptor() &&
645 object->elements()->length() == 0) { 646 object->elements()->length() == 0) {
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 SerializeString_<false, uint8_t>(object); 872 SerializeString_<false, uint8_t>(object);
872 } else { 873 } else {
873 SerializeString_<false, uc16>(object); 874 SerializeString_<false, uc16>(object);
874 } 875 }
875 } 876 }
876 } 877 }
877 878
878 } } // namespace v8::internal 879 } } // namespace v8::internal
879 880
880 #endif // V8_JSON_STRINGIFIER_H_ 881 #endif // V8_JSON_STRINGIFIER_H_
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698