Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/metrics.h" | 5 #include "vm/metrics.h" |
| 6 | 6 |
| 7 #include "vm/isolate.h" | 7 #include "vm/isolate.h" |
| 8 #include "vm/json_stream.h" | 8 #include "vm/json_stream.h" |
| 9 #include "vm/native_entry.h" | 9 #include "vm/native_entry.h" |
| 10 #include "vm/runtime_entry.h" | 10 #include "vm/runtime_entry.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 return isolate()->heap()->CapacityInWords(Heap::kNew) * kWordSize; | 269 return isolate()->heap()->CapacityInWords(Heap::kNew) * kWordSize; |
| 270 } | 270 } |
| 271 | 271 |
| 272 | 272 |
| 273 int64_t MetricHeapNewExternal::Value() const { | 273 int64_t MetricHeapNewExternal::Value() const { |
| 274 ASSERT(isolate() == Isolate::Current()); | 274 ASSERT(isolate() == Isolate::Current()); |
| 275 return isolate()->heap()->ExternalInWords(Heap::kNew) * kWordSize; | 275 return isolate()->heap()->ExternalInWords(Heap::kNew) * kWordSize; |
| 276 } | 276 } |
| 277 | 277 |
| 278 | 278 |
| 279 int64_t MetricHeapUsed::Value() const { | |
| 280 ASSERT(isolate() == Isolate::Current()); | |
| 281 return isolate()->heap()->UsedInWords(Heap::kNew) * kWordSize + | |
| 282 isolate()->heap()->UsedInWords(Heap::kOld) * kWordSize; | |
|
koda
2015/10/06 18:09:02
May overflow.
koda
2015/10/06 18:24:03
Actually, we should simply change the return type
Cutch
2015/10/06 20:23:18
Done.
| |
| 283 } | |
| 284 | |
| 279 int64_t MetricIsolateCount::Value() const { | 285 int64_t MetricIsolateCount::Value() const { |
| 280 return Isolate::IsolateListLength(); | 286 return Isolate::IsolateListLength(); |
| 281 } | 287 } |
| 282 | 288 |
| 283 #define VM_METRIC_VARIABLE(type, variable, name, unit) \ | 289 #define VM_METRIC_VARIABLE(type, variable, name, unit) \ |
| 284 static type vm_metric_##variable##_; | 290 static type vm_metric_##variable##_; |
| 285 VM_METRIC_LIST(VM_METRIC_VARIABLE); | 291 VM_METRIC_LIST(VM_METRIC_VARIABLE); |
| 286 #undef VM_METRIC_VARIABLE | 292 #undef VM_METRIC_VARIABLE |
| 287 | 293 |
| 288 | 294 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 327 } | 333 } |
| 328 | 334 |
| 329 | 335 |
| 330 void MinMetric::SetValue(int64_t new_value) { | 336 void MinMetric::SetValue(int64_t new_value) { |
| 331 if (new_value < value()) { | 337 if (new_value < value()) { |
| 332 set_value(new_value); | 338 set_value(new_value); |
| 333 } | 339 } |
| 334 } | 340 } |
| 335 | 341 |
| 336 } // namespace dart | 342 } // namespace dart |
| OLD | NEW |