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

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

Issue 1163203002: Fixed memory leak in JSDate::JSDatePrint(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 567
568 void JSDate::JSDatePrint(std::ostream& os) { // NOLINT 568 void JSDate::JSDatePrint(std::ostream& os) { // NOLINT
569 HeapObject::PrintHeader(os, "JSDate"); 569 HeapObject::PrintHeader(os, "JSDate");
570 os << " - map = " << reinterpret_cast<void*>(map()) << "\n"; 570 os << " - map = " << reinterpret_cast<void*>(map()) << "\n";
571 os << " - value = "; 571 os << " - value = ";
572 value()->Print(os); 572 value()->Print(os);
573 if (!year()->IsSmi()) { 573 if (!year()->IsSmi()) {
574 os << " - time = NaN\n"; 574 os << " - time = NaN\n";
575 } else { 575 } else {
576 // TODO(svenpanne) Add some basic formatting to our streams. 576 // TODO(svenpanne) Add some basic formatting to our streams.
577 Vector<char> buf = Vector<char>::New(100); 577 ScopedVector<char> buf(100);
578 SNPrintF( 578 SNPrintF(
579 buf, " - time = %s %04d/%02d/%02d %02d:%02d:%02d\n", 579 buf, " - time = %s %04d/%02d/%02d %02d:%02d:%02d\n",
580 weekdays[weekday()->IsSmi() ? Smi::cast(weekday())->value() + 1 : 0], 580 weekdays[weekday()->IsSmi() ? Smi::cast(weekday())->value() + 1 : 0],
581 year()->IsSmi() ? Smi::cast(year())->value() : -1, 581 year()->IsSmi() ? Smi::cast(year())->value() : -1,
582 month()->IsSmi() ? Smi::cast(month())->value() : -1, 582 month()->IsSmi() ? Smi::cast(month())->value() : -1,
583 day()->IsSmi() ? Smi::cast(day())->value() : -1, 583 day()->IsSmi() ? Smi::cast(day())->value() : -1,
584 hour()->IsSmi() ? Smi::cast(hour())->value() : -1, 584 hour()->IsSmi() ? Smi::cast(hour())->value() : -1,
585 min()->IsSmi() ? Smi::cast(min())->value() : -1, 585 min()->IsSmi() ? Smi::cast(min())->value() : -1,
586 sec()->IsSmi() ? Smi::cast(sec())->value() : -1); 586 sec()->IsSmi() ? Smi::cast(sec())->value() : -1);
587 os << buf.start(); 587 os << buf.start();
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 } 1171 }
1172 } 1172 }
1173 1173
1174 1174
1175 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT 1175 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT
1176 TransitionArray::PrintTransitions(os, map()->raw_transitions()); 1176 TransitionArray::PrintTransitions(os, map()->raw_transitions());
1177 } 1177 }
1178 #endif // defined(DEBUG) || defined(OBJECT_PRINT) 1178 #endif // defined(DEBUG) || defined(OBJECT_PRINT)
1179 } // namespace internal 1179 } // namespace internal
1180 } // namespace v8 1180 } // 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