• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2019 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "src/objects/tagged-impl.h"
6 
7 #include <sstream>
8 
9 #include "src/objects/objects.h"
10 #include "src/strings/string-stream.h"
11 #include "src/utils/ostreams.h"
12 
13 namespace v8 {
14 namespace internal {
15 
16 template <HeapObjectReferenceType kRefType, typename StorageType>
ShortPrint(FILE * out)17 void TaggedImpl<kRefType, StorageType>::ShortPrint(FILE* out) {
18   OFStream os(out);
19   os << Brief(*this);
20 }
21 
22 template <HeapObjectReferenceType kRefType, typename StorageType>
ShortPrint(StringStream * accumulator)23 void TaggedImpl<kRefType, StorageType>::ShortPrint(StringStream* accumulator) {
24   std::ostringstream os;
25   os << Brief(*this);
26   accumulator->Add(os.str().c_str());
27 }
28 
29 template <HeapObjectReferenceType kRefType, typename StorageType>
ShortPrint(std::ostream & os)30 void TaggedImpl<kRefType, StorageType>::ShortPrint(std::ostream& os) {
31   os << Brief(*this);
32 }
33 
34 // Explicit instantiation declarations.
35 template class TaggedImpl<HeapObjectReferenceType::STRONG, Address>;
36 template class TaggedImpl<HeapObjectReferenceType::WEAK, Address>;
37 
38 }  // namespace internal
39 }  // namespace v8
40