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/objects-printer.cc

Issue 1483003002: Revert of Introduce instance type for transition arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/objects-inl.h ('k') | src/transitions.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/objects.h" 5 #include "src/objects.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/interpreter/bytecodes.h" 9 #include "src/interpreter/bytecodes.h"
10 #include "src/objects-inl.h" 10 #include "src/objects-inl.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 break; 69 break;
70 case FIXED_ARRAY_TYPE: 70 case FIXED_ARRAY_TYPE:
71 FixedArray::cast(this)->FixedArrayPrint(os); 71 FixedArray::cast(this)->FixedArrayPrint(os);
72 break; 72 break;
73 case BYTE_ARRAY_TYPE: 73 case BYTE_ARRAY_TYPE:
74 ByteArray::cast(this)->ByteArrayPrint(os); 74 ByteArray::cast(this)->ByteArrayPrint(os);
75 break; 75 break;
76 case BYTECODE_ARRAY_TYPE: 76 case BYTECODE_ARRAY_TYPE:
77 BytecodeArray::cast(this)->BytecodeArrayPrint(os); 77 BytecodeArray::cast(this)->BytecodeArrayPrint(os);
78 break; 78 break;
79 case TRANSITION_ARRAY_TYPE:
80 TransitionArray::cast(this)->TransitionArrayPrint(os);
81 break;
82 case FREE_SPACE_TYPE: 79 case FREE_SPACE_TYPE:
83 FreeSpace::cast(this)->FreeSpacePrint(os); 80 FreeSpace::cast(this)->FreeSpacePrint(os);
84 break; 81 break;
85 82
86 #define PRINT_FIXED_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ 83 #define PRINT_FIXED_TYPED_ARRAY(Type, type, TYPE, ctype, size) \
87 case Fixed##Type##Array::kInstanceType: \ 84 case Fixed##Type##Array::kInstanceType: \
88 Fixed##Type##Array::cast(this)->FixedTypedArrayPrint(os); \ 85 Fixed##Type##Array::cast(this)->FixedTypedArrayPrint(os); \
89 break; 86 break;
90 87
91 TYPED_ARRAYS(PRINT_FIXED_TYPED_ARRAY) 88 TYPED_ARRAYS(PRINT_FIXED_TYPED_ARRAY)
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 for (int i = 0; i < length(); i++) { 544 for (int i = 0; i < length(); i++) {
548 os << "\n [" << i << "]: "; 545 os << "\n [" << i << "]: ";
549 if (is_the_hole(i)) { 546 if (is_the_hole(i)) {
550 os << "<the hole>"; 547 os << "<the hole>";
551 } else { 548 } else {
552 os << get_scalar(i); 549 os << get_scalar(i);
553 } 550 }
554 } 551 }
555 os << "\n"; 552 os << "\n";
556 } 553 }
557
558
559 void TransitionArray::TransitionArrayPrint(std::ostream& os) { // NOLINT
560 HeapObject::PrintHeader(os, "TransitionArray");
561 os << " - capacity: " << length();
562 for (int i = 0; i < length(); i++) {
563 os << "\n [" << i << "]: " << Brief(get(i));
564 if (i == kNextLinkIndex) os << " (next link)";
565 if (i == kPrototypeTransitionsIndex) os << " (prototype transitions)";
566 if (i == kTransitionLengthIndex) os << " (number of transitions)";
567 }
568 os << "\n";
569 }
570 554
571 555
572 void TypeFeedbackMetadata::Print() { 556 void TypeFeedbackMetadata::Print() {
573 OFStream os(stdout); 557 OFStream os(stdout);
574 TypeFeedbackMetadataPrint(os); 558 TypeFeedbackMetadataPrint(os);
575 os << std::flush; 559 os << std::flush;
576 } 560 }
577 561
578 562
579 void TypeFeedbackMetadata::TypeFeedbackMetadataPrint( 563 void TypeFeedbackMetadata::TypeFeedbackMetadataPrint(
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT 1330 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT
1347 Object* transitions = map()->raw_transitions(); 1331 Object* transitions = map()->raw_transitions();
1348 int num_transitions = TransitionArray::NumberOfTransitions(transitions); 1332 int num_transitions = TransitionArray::NumberOfTransitions(transitions);
1349 if (num_transitions == 0) return; 1333 if (num_transitions == 0) return;
1350 os << "\n - transitions"; 1334 os << "\n - transitions";
1351 TransitionArray::PrintTransitions(os, transitions, false); 1335 TransitionArray::PrintTransitions(os, transitions, false);
1352 } 1336 }
1353 #endif // defined(DEBUG) || defined(OBJECT_PRINT) 1337 #endif // defined(DEBUG) || defined(OBJECT_PRINT)
1354 } // namespace internal 1338 } // namespace internal
1355 } // namespace v8 1339 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/transitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698