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

Side by Side Diff: src/global-handles.cc

Issue 2001073002: [build] Fix a clang warning (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 7 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/disassembler.cc ('k') | src/heap/mark-compact.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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/global-handles.h" 5 #include "src/global-handles.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/v8.h" 8 #include "src/v8.h"
9 #include "src/vm-state-inl.h" 9 #include "src/vm-state-inl.h"
10 10
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 void ObjectGroupsTracer::PrintObject(Object* object) { 872 void ObjectGroupsTracer::PrintObject(Object* object) {
873 if (object->IsJSObject()) { 873 if (object->IsJSObject()) {
874 JSObject* js_object = JSObject::cast(object); 874 JSObject* js_object = JSObject::cast(object);
875 875
876 PrintF("{ constructor_name: "); 876 PrintF("{ constructor_name: ");
877 PrintConstructor(js_object); 877 PrintConstructor(js_object);
878 PrintF(", hidden_fields: [ "); 878 PrintF(", hidden_fields: [ ");
879 PrintInternalFields(js_object); 879 PrintInternalFields(js_object);
880 PrintF(" ] }\n"); 880 PrintF(" ] }\n");
881 } else { 881 } else {
882 PrintF("object of unexpected type: %p\n", object); 882 PrintF("object of unexpected type: %p\n", static_cast<void*>(object));
883 } 883 }
884 } 884 }
885 885
886 void ObjectGroupsTracer::PrintConstructor(JSObject* js_object) { 886 void ObjectGroupsTracer::PrintConstructor(JSObject* js_object) {
887 Object* maybe_constructor = js_object->map()->GetConstructor(); 887 Object* maybe_constructor = js_object->map()->GetConstructor();
888 if (maybe_constructor->IsJSFunction()) { 888 if (maybe_constructor->IsJSFunction()) {
889 JSFunction* constructor = JSFunction::cast(maybe_constructor); 889 JSFunction* constructor = JSFunction::cast(maybe_constructor);
890 String* name = String::cast(constructor->shared()->name()); 890 String* name = String::cast(constructor->shared()->name());
891 if (name->length() == 0) name = constructor->shared()->inferred_name(); 891 if (name->length() == 0) name = constructor->shared()->inferred_name();
892 892
893 PrintF("%s", name->ToCString().get()); 893 PrintF("%s", name->ToCString().get());
894 } else if (maybe_constructor->IsNull()) { 894 } else if (maybe_constructor->IsNull()) {
895 if (js_object->IsOddball()) { 895 if (js_object->IsOddball()) {
896 PrintF("<oddball>"); 896 PrintF("<oddball>");
897 } else { 897 } else {
898 PrintF("<null>"); 898 PrintF("<null>");
899 } 899 }
900 } else { 900 } else {
901 UNREACHABLE(); 901 UNREACHABLE();
902 } 902 }
903 } 903 }
904 904
905 void ObjectGroupsTracer::PrintInternalFields(JSObject* js_object) { 905 void ObjectGroupsTracer::PrintInternalFields(JSObject* js_object) {
906 for (int i = 0; i < js_object->GetInternalFieldCount(); ++i) { 906 for (int i = 0; i < js_object->GetInternalFieldCount(); ++i) {
907 if (i != 0) { 907 if (i != 0) {
908 PrintF(", "); 908 PrintF(", ");
909 } 909 }
910 PrintF("%p", js_object->GetInternalField(i)); 910 PrintF("%p", static_cast<void*>(js_object->GetInternalField(i)));
911 } 911 }
912 } 912 }
913 913
914 void ObjectGroupsTracer::PrintObjectGroup(ObjectGroup* group) { 914 void ObjectGroupsTracer::PrintObjectGroup(ObjectGroup* group) {
915 PrintIsolate(isolate_, "ObjectGroup (size: %" PRIuS ")\n", group->length); 915 PrintIsolate(isolate_, "ObjectGroup (size: %" PRIuS ")\n", group->length);
916 Object*** objects = group->objects; 916 Object*** objects = group->objects;
917 917
918 for (size_t i = 0; i < group->length; ++i) { 918 for (size_t i = 0; i < group->length; ++i) {
919 PrintIsolate(isolate_, " - Member: "); 919 PrintIsolate(isolate_, " - Member: ");
920 PrintObject(*objects[i]); 920 PrintObject(*objects[i]);
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 blocks_[block][offset] = object; 1505 blocks_[block][offset] = object;
1506 if (isolate->heap()->InNewSpace(object)) { 1506 if (isolate->heap()->InNewSpace(object)) {
1507 new_space_indices_.Add(size_); 1507 new_space_indices_.Add(size_);
1508 } 1508 }
1509 *index = size_++; 1509 *index = size_++;
1510 } 1510 }
1511 1511
1512 1512
1513 } // namespace internal 1513 } // namespace internal
1514 } // namespace v8 1514 } // namespace v8
OLDNEW
« no previous file with comments | « src/disassembler.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698