| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 data_ += '['; | 114 data_ += '['; |
| 115 first_item_ = true; | 115 first_item_ = true; |
| 116 } | 116 } |
| 117 | 117 |
| 118 void TracedValue::AppendInteger(int value) { | 118 void TracedValue::AppendInteger(int value) { |
| 119 DCHECK_CURRENT_CONTAINER_IS(kStackTypeArray); | 119 DCHECK_CURRENT_CONTAINER_IS(kStackTypeArray); |
| 120 WriteComma(); | 120 WriteComma(); |
| 121 data_ += std::to_string(value); | 121 data_ += std::to_string(value); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void TracedValue::AppendLongInteger(int64_t value) { |
| 125 DCHECK_CURRENT_CONTAINER_IS(kStackTypeArray); |
| 126 WriteComma(); |
| 127 data_ += std::to_string(value); |
| 128 } |
| 129 |
| 124 void TracedValue::AppendDouble(double value) { | 130 void TracedValue::AppendDouble(double value) { |
| 125 DCHECK_CURRENT_CONTAINER_IS(kStackTypeArray); | 131 DCHECK_CURRENT_CONTAINER_IS(kStackTypeArray); |
| 126 WriteComma(); | 132 WriteComma(); |
| 127 data_ += std::to_string(value); | 133 data_ += std::to_string(value); |
| 128 } | 134 } |
| 129 | 135 |
| 130 void TracedValue::AppendBoolean(bool value) { | 136 void TracedValue::AppendBoolean(bool value) { |
| 131 DCHECK_CURRENT_CONTAINER_IS(kStackTypeArray); | 137 DCHECK_CURRENT_CONTAINER_IS(kStackTypeArray); |
| 132 WriteComma(); | 138 WriteComma(); |
| 133 data_ += value ? "true" : "false"; | 139 data_ += value ? "true" : "false"; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 191 } |
| 186 | 192 |
| 187 void TracedValue::AppendAsTraceFormat(std::string* out) const { | 193 void TracedValue::AppendAsTraceFormat(std::string* out) const { |
| 188 *out += '{'; | 194 *out += '{'; |
| 189 *out += data_; | 195 *out += data_; |
| 190 *out += '}'; | 196 *out += '}'; |
| 191 } | 197 } |
| 192 | 198 |
| 193 } // namespace tracing | 199 } // namespace tracing |
| 194 } // namespace v8 | 200 } // namespace v8 |
| OLD | NEW |