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

Side by Side Diff: src/objects-printer.cc

Issue 391693002: In-object double fields unboxing (for 64-bit only). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebasing Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/objects-inl.h ('k') | src/property-details.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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/disasm.h" 7 #include "src/disasm.h"
8 #include "src/disassembler.h" 8 #include "src/disassembler.h"
9 #include "src/heap/objects-visiting.h" 9 #include "src/heap/objects-visiting.h"
10 #include "src/jsregexp.h" 10 #include "src/jsregexp.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 void JSObject::PrintProperties(std::ostream& os) { // NOLINT 226 void JSObject::PrintProperties(std::ostream& os) { // NOLINT
227 if (HasFastProperties()) { 227 if (HasFastProperties()) {
228 DescriptorArray* descs = map()->instance_descriptors(); 228 DescriptorArray* descs = map()->instance_descriptors();
229 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { 229 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) {
230 os << " "; 230 os << " ";
231 descs->GetKey(i)->NamePrint(os); 231 descs->GetKey(i)->NamePrint(os);
232 os << ": "; 232 os << ": ";
233 switch (descs->GetType(i)) { 233 switch (descs->GetType(i)) {
234 case FIELD: { 234 case FIELD: {
235 FieldIndex index = FieldIndex::ForDescriptor(map(), i); 235 FieldIndex index = FieldIndex::ForDescriptor(map(), i);
236 os << Brief(RawFastPropertyAt(index)) << " (field at offset " 236 if (IsUnboxedDoubleField(index)) {
237 << index.property_index() << ")\n"; 237 os << "<unboxed double> " << RawFastDoublePropertyAt(index);
238 } else {
239 os << Brief(RawFastPropertyAt(index));
240 }
241 os << " (field at offset " << index.property_index() << ")\n";
238 break; 242 break;
239 } 243 }
240 case CONSTANT: 244 case CONSTANT:
241 os << Brief(descs->GetConstant(i)) << " (constant)\n"; 245 os << Brief(descs->GetConstant(i)) << " (constant)\n";
242 break; 246 break;
243 case CALLBACKS: 247 case CALLBACKS:
244 os << Brief(descs->GetCallbacksObject(i)) << " (callback)\n"; 248 os << Brief(descs->GetCallbacksObject(i)) << " (callback)\n";
245 break; 249 break;
246 case NORMAL: // only in slow mode 250 case NORMAL: // only in slow mode
247 UNREACHABLE(); 251 UNREACHABLE();
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 if (is_access_check_needed()) os << " - access_check_needed\n"; 427 if (is_access_check_needed()) os << " - access_check_needed\n";
424 if (is_frozen()) { 428 if (is_frozen()) {
425 os << " - frozen\n"; 429 os << " - frozen\n";
426 } else if (!is_extensible()) { 430 } else if (!is_extensible()) {
427 os << " - sealed\n"; 431 os << " - sealed\n";
428 } 432 }
429 os << " - back pointer: " << Brief(GetBackPointer()); 433 os << " - back pointer: " << Brief(GetBackPointer());
430 os << "\n - instance descriptors " << (owns_descriptors() ? "(own) " : "") 434 os << "\n - instance descriptors " << (owns_descriptors() ? "(own) " : "")
431 << "#" << NumberOfOwnDescriptors() << ": " 435 << "#" << NumberOfOwnDescriptors() << ": "
432 << Brief(instance_descriptors()); 436 << Brief(instance_descriptors());
437 if (FLAG_unbox_double_fields) {
438 os << "\n - layout descriptor: " << Brief(layout_descriptor());
439 }
433 if (HasTransitionArray()) { 440 if (HasTransitionArray()) {
434 os << "\n - transitions: " << Brief(transitions()); 441 os << "\n - transitions: " << Brief(transitions());
435 } 442 }
436 os << "\n - prototype: " << Brief(prototype()); 443 os << "\n - prototype: " << Brief(prototype());
437 os << "\n - constructor: " << Brief(constructor()); 444 os << "\n - constructor: " << Brief(constructor());
438 os << "\n - code cache: " << Brief(code_cache()); 445 os << "\n - code cache: " << Brief(code_cache());
439 os << "\n - dependent code: " << Brief(dependent_code()); 446 os << "\n - dependent code: " << Brief(dependent_code());
440 os << "\n"; 447 os << "\n";
448 instance_descriptors()->PrintDescriptors(os);
449 os << "\n";
450 if (FLAG_unbox_double_fields) layout_descriptor()->Print(os);
441 } 451 }
442 452
443 453
444 void CodeCache::CodeCachePrint(std::ostream& os) { // NOLINT 454 void CodeCache::CodeCachePrint(std::ostream& os) { // NOLINT
445 HeapObject::PrintHeader(os, "CodeCache"); 455 HeapObject::PrintHeader(os, "CodeCache");
446 os << "\n - default_cache: " << Brief(default_cache()); 456 os << "\n - default_cache: " << Brief(default_cache());
447 os << "\n - normal_type_cache: " << Brief(normal_type_cache()); 457 os << "\n - normal_type_cache: " << Brief(normal_type_cache());
448 } 458 }
449 459
450 460
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 os << "Descriptor array " << number_of_descriptors() << "\n"; 1079 os << "Descriptor array " << number_of_descriptors() << "\n";
1070 for (int i = 0; i < number_of_descriptors(); i++) { 1080 for (int i = 0; i < number_of_descriptors(); i++) {
1071 Descriptor desc; 1081 Descriptor desc;
1072 Get(i, &desc); 1082 Get(i, &desc);
1073 os << " " << i << ": " << desc << "\n"; 1083 os << " " << i << ": " << desc << "\n";
1074 } 1084 }
1075 os << "\n"; 1085 os << "\n";
1076 } 1086 }
1077 1087
1078 1088
1089 static void PrintBitMask(std::ostream& os, uint32_t value) { // NOLINT
1090 for (int i = 0; i < 32; i++) {
1091 if ((i & 7) == 0) os << " ";
1092 os << (((value & 1) == 0) ? "_" : "x");
1093 value >>= 1;
1094 }
1095 }
1096
1097
1098 void LayoutDescriptor::Print() {
1099 OFStream os(stdout);
1100 this->Print(os);
1101 os << std::flush;
1102 }
1103
1104
1105 void LayoutDescriptor::Print(std::ostream& os) { // NOLINT
1106 os << "Layout descriptor: ";
1107 if (IsUninitialized()) {
1108 os << "<uninitialized>";
1109 } else if (IsFastPointerLayout()) {
1110 os << "<all tagged>";
1111 } else if (IsSmi()) {
1112 os << "fast";
1113 PrintBitMask(os, static_cast<uint32_t>(Smi::cast(this)->value()));
1114 } else {
1115 os << "slow";
1116 int len = length();
1117 for (int i = 0; i < len; i++) {
1118 if (i > 0) os << " |";
1119 PrintBitMask(os, get_scalar(i));
1120 }
1121 }
1122 os << "\n";
1123 }
1124
1125
1079 void TransitionArray::Print() { 1126 void TransitionArray::Print() {
1080 OFStream os(stdout); 1127 OFStream os(stdout);
1081 this->PrintTransitions(os); 1128 this->PrintTransitions(os);
1082 os << std::flush; 1129 os << std::flush;
1083 } 1130 }
1084 1131
1085 1132
1086 void TransitionArray::PrintTransitions(std::ostream& os, 1133 void TransitionArray::PrintTransitions(std::ostream& os,
1087 bool print_header) { // NOLINT 1134 bool print_header) { // NOLINT
1088 if (print_header) { 1135 if (print_header) {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 return SNPrintF(str, "#<%s>", s->PrivateSymbolToName()); 1204 return SNPrintF(str, "#<%s>", s->PrivateSymbolToName());
1158 } else { 1205 } else {
1159 return SNPrintF(str, "<%s>", String::cast(s->name())->ToCString().get()); 1206 return SNPrintF(str, "<%s>", String::cast(s->name())->ToCString().get());
1160 } 1207 }
1161 } 1208 }
1162 } 1209 }
1163 1210
1164 1211
1165 #endif // TRACE_MAPS 1212 #endif // TRACE_MAPS
1166 } } // namespace v8::internal 1213 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/property-details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698