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

Side by Side Diff: runtime/vm/object.cc

Issue 534373003: Fix printing of PcDescriptors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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 | « 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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 10510 matching lines...) Expand 10 before | Expand all | Expand 10 after
10521 return "No pc descriptors\n"; 10521 return "No pc descriptors\n";
10522 } 10522 }
10523 // 4 bits per hex digit. 10523 // 4 bits per hex digit.
10524 const int addr_width = kBitsPerWord / 4; 10524 const int addr_width = kBitsPerWord / 4;
10525 // "*" in a printf format specifier tells it to read the field width from 10525 // "*" in a printf format specifier tells it to read the field width from
10526 // the printf argument list. 10526 // the printf argument list.
10527 const char* kFormat = 10527 const char* kFormat =
10528 "%#-*" Px "\t%s\t%" Pd "\t\t%" Pd "\t%" Pd "\n"; 10528 "%#-*" Px "\t%s\t%" Pd "\t\t%" Pd "\t%" Pd "\n";
10529 // First compute the buffer size required. 10529 // First compute the buffer size required.
10530 intptr_t len = 1; // Trailing '\0'. 10530 intptr_t len = 1; // Trailing '\0'.
10531 Iterator iter(*this, RawPcDescriptors::kAnyKind); 10531 {
10532 while (iter.MoveNext()) { 10532 Iterator iter(*this, RawPcDescriptors::kAnyKind);
10533 len += OS::SNPrint(NULL, 0, kFormat, addr_width, 10533 while (iter.MoveNext()) {
10534 iter.Pc(), 10534 len += OS::SNPrint(NULL, 0, kFormat, addr_width,
10535 KindAsStr(iter.Kind()), 10535 iter.Pc(),
10536 iter.DeoptId(), 10536 KindAsStr(iter.Kind()),
10537 iter.TokenPos(), 10537 iter.DeoptId(),
10538 iter.TryIndex()); 10538 iter.TokenPos(),
10539 iter.TryIndex());
10540 }
10539 } 10541 }
10540 // Allocate the buffer. 10542 // Allocate the buffer.
10541 char* buffer = Isolate::Current()->current_zone()->Alloc<char>(len); 10543 char* buffer = Isolate::Current()->current_zone()->Alloc<char>(len);
10542 // Layout the fields in the buffer. 10544 // Layout the fields in the buffer.
10543 intptr_t index = 0; 10545 intptr_t index = 0;
10544 Iterator iter2(*this, RawPcDescriptors::kAnyKind); 10546 Iterator iter(*this, RawPcDescriptors::kAnyKind);
10545 while (iter2.MoveNext()) { 10547 while (iter.MoveNext()) {
10546 index += OS::SNPrint((buffer + index), (len - index), kFormat, addr_width, 10548 index += OS::SNPrint((buffer + index), (len - index), kFormat, addr_width,
10547 iter.Pc(), 10549 iter.Pc(),
10548 KindAsStr(iter.Kind()), 10550 KindAsStr(iter.Kind()),
10549 iter.DeoptId(), 10551 iter.DeoptId(),
10550 iter.TokenPos(), 10552 iter.TokenPos(),
10551 iter.TryIndex()); 10553 iter.TryIndex());
10552 } 10554 }
10553 return buffer; 10555 return buffer;
10554 } 10556 }
10555 10557
(...skipping 9064 matching lines...) Expand 10 before | Expand all | Expand 10 after
19620 return tag_label.ToCString(); 19622 return tag_label.ToCString();
19621 } 19623 }
19622 19624
19623 19625
19624 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 19626 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
19625 Instance::PrintJSONImpl(stream, ref); 19627 Instance::PrintJSONImpl(stream, ref);
19626 } 19628 }
19627 19629
19628 19630
19629 } // namespace dart 19631 } // namespace dart
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