OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |