OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/tracing/traced-value.h" | 5 #include "src/tracing/traced-value.h" |
6 | 6 |
7 #include "src/base/platform/platform.h" | 7 #include "src/base/platform/platform.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace tracing { | 10 namespace tracing { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 DEBUG_POP_CONTAINER(); | 74 DEBUG_POP_CONTAINER(); |
75 DCHECK_CONTAINER_STACK_DEPTH_EQ(0u); | 75 DCHECK_CONTAINER_STACK_DEPTH_EQ(0u); |
76 } | 76 } |
77 | 77 |
78 void TracedValue::SetInteger(const char* name, int value) { | 78 void TracedValue::SetInteger(const char* name, int value) { |
79 DCHECK_CURRENT_CONTAINER_IS(kStackTypeDict); | 79 DCHECK_CURRENT_CONTAINER_IS(kStackTypeDict); |
80 WriteName(name); | 80 WriteName(name); |
81 data_ += std::to_string(value); | 81 data_ += std::to_string(value); |
82 } | 82 } |
83 | 83 |
| 84 void TracedValue::SetLongInteger(const char* name, int64_t value) { |
| 85 DCHECK_CURRENT_CONTAINER_IS(kStackTypeDict); |
| 86 WriteName(name); |
| 87 data_ += std::to_string(value); |
| 88 } |
| 89 |
84 void TracedValue::SetDouble(const char* name, double value) { | 90 void TracedValue::SetDouble(const char* name, double value) { |
85 DCHECK_CURRENT_CONTAINER_IS(kStackTypeDict); | 91 DCHECK_CURRENT_CONTAINER_IS(kStackTypeDict); |
86 WriteName(name); | 92 WriteName(name); |
87 data_ += std::to_string(value); | 93 data_ += std::to_string(value); |
88 } | 94 } |
89 | 95 |
90 void TracedValue::SetBoolean(const char* name, bool value) { | 96 void TracedValue::SetBoolean(const char* name, bool value) { |
91 DCHECK_CURRENT_CONTAINER_IS(kStackTypeDict); | 97 DCHECK_CURRENT_CONTAINER_IS(kStackTypeDict); |
92 WriteName(name); | 98 WriteName(name); |
93 data_ += value ? "true" : "false"; | 99 data_ += value ? "true" : "false"; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 } | 197 } |
192 | 198 |
193 void TracedValue::AppendAsTraceFormat(std::string* out) const { | 199 void TracedValue::AppendAsTraceFormat(std::string* out) const { |
194 *out += '{'; | 200 *out += '{'; |
195 *out += data_; | 201 *out += data_; |
196 *out += '}'; | 202 *out += '}'; |
197 } | 203 } |
198 | 204 |
199 } // namespace tracing | 205 } // namespace tracing |
200 } // namespace v8 | 206 } // namespace v8 |
OLD | NEW |