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

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

Issue 1842743002: [printing] Add COW identifier to elements kind (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | 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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 break; 389 break;
390 } 390 }
391 } 391 }
392 392
393 393
394 static void JSObjectPrintHeader(std::ostream& os, JSObject* obj, 394 static void JSObjectPrintHeader(std::ostream& os, JSObject* obj,
395 const char* id) { // NOLINT 395 const char* id) { // NOLINT
396 obj->PrintHeader(os, id); 396 obj->PrintHeader(os, id);
397 // Don't call GetElementsKind, its validation code can cause the printer to 397 // Don't call GetElementsKind, its validation code can cause the printer to
398 // fail when debugging. 398 // fail when debugging.
399 PrototypeIterator iter(obj->GetIsolate(), obj); 399 PrototypeIterator iter(obj->GetIsolate(), obj);
Toon Verwaest 2016/03/29 13:42:50 Move iter down to where it's used.
400 os << "\n - map = " << reinterpret_cast<void*>(obj->map()) << " [" 400 os << "\n - map = " << reinterpret_cast<void*>(obj->map()) << " ["
401 << ElementsKindToString(obj->map()->elements_kind()) 401 << ElementsKindToString(obj->map()->elements_kind());
402 << "]\n - prototype = " << reinterpret_cast<void*>(iter.GetCurrent()); 402 if (obj->elements()->map() == obj->GetHeap()->fixed_cow_array_map() ||
403 obj->elements()->map() == obj->GetHeap()->fixed_double_array_map()) {
Toon Verwaest 2016/03/29 13:42:50 Just cow_array_map I presume :)
404 os << " (COW)";
405 }
406 os << "]\n - prototype = " << reinterpret_cast<void*>(iter.GetCurrent());
403 } 407 }
404 408
405 409
406 static void JSObjectPrintBody(std::ostream& os, JSObject* obj, // NOLINT 410 static void JSObjectPrintBody(std::ostream& os, JSObject* obj, // NOLINT
407 bool print_elements = true) { 411 bool print_elements = true) {
408 os << "\n {"; 412 os << "\n {";
409 obj->PrintProperties(os); 413 obj->PrintProperties(os);
410 obj->PrintTransitions(os); 414 obj->PrintTransitions(os);
411 if (print_elements) obj->PrintElements(os); 415 if (print_elements) obj->PrintElements(os);
412 os << "\n }\n"; 416 os << "\n }\n";
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
1330 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT 1334 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT
1331 Object* transitions = map()->raw_transitions(); 1335 Object* transitions = map()->raw_transitions();
1332 int num_transitions = TransitionArray::NumberOfTransitions(transitions); 1336 int num_transitions = TransitionArray::NumberOfTransitions(transitions);
1333 if (num_transitions == 0) return; 1337 if (num_transitions == 0) return;
1334 os << "\n - transitions"; 1338 os << "\n - transitions";
1335 TransitionArray::PrintTransitions(os, transitions, false); 1339 TransitionArray::PrintTransitions(os, transitions, false);
1336 } 1340 }
1337 #endif // defined(DEBUG) || defined(OBJECT_PRINT) 1341 #endif // defined(DEBUG) || defined(OBJECT_PRINT)
1338 } // namespace internal 1342 } // namespace internal
1339 } // namespace v8 1343 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698