Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4090)

Unified Diff: runtime/vm/metrics.cc

Issue 2974233002: VM: Re-format to use at most one newline between functions (Closed)
Patch Set: Rebase and merge Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/metrics.h ('k') | runtime/vm/mirrors_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/metrics.cc
diff --git a/runtime/vm/metrics.cc b/runtime/vm/metrics.cc
index 3cf35f68fe32c767fa3a3983f0d7edc1b676035e..5489823047c4f7f9233ab74d5f095661df7c03d9 100644
--- a/runtime/vm/metrics.cc
+++ b/runtime/vm/metrics.cc
@@ -6,10 +6,10 @@
#include "vm/isolate.h"
#include "vm/json_stream.h"
+#include "vm/log.h"
#include "vm/native_entry.h"
-#include "vm/runtime_entry.h"
#include "vm/object.h"
-#include "vm/log.h"
+#include "vm/runtime_entry.h"
namespace dart {
@@ -28,7 +28,6 @@ Metric::Metric()
value_(0),
next_(NULL) {}
-
void Metric::Init(Isolate* isolate,
const char* name,
const char* description,
@@ -43,7 +42,6 @@ void Metric::Init(Isolate* isolate,
RegisterWithIsolate();
}
-
void Metric::Init(const char* name, const char* description, Unit unit) {
// Only called once.
ASSERT(next_ == NULL);
@@ -54,7 +52,6 @@ void Metric::Init(const char* name, const char* description, Unit unit) {
RegisterWithVM();
}
-
Metric::~Metric() {
// Only deregister metrics which had been registered. Metrics without a name
// are from shallow copy isolates.
@@ -67,7 +64,6 @@ Metric::~Metric() {
}
}
-
#ifndef PRODUCT
static const char* UnitString(intptr_t unit) {
switch (unit) {
@@ -84,7 +80,6 @@ static const char* UnitString(intptr_t unit) {
return NULL;
}
-
void Metric::PrintJSON(JSONStream* stream) {
if (!FLAG_support_service) {
return;
@@ -105,7 +100,6 @@ void Metric::PrintJSON(JSONStream* stream) {
}
#endif // !PRODUCT
-
char* Metric::ValueToString(int64_t value, Unit unit) {
Thread* thread = Thread::Current();
ASSERT(thread != NULL);
@@ -149,7 +143,6 @@ char* Metric::ValueToString(int64_t value, Unit unit) {
}
}
-
char* Metric::ToString() {
Thread* thread = Thread::Current();
ASSERT(thread != NULL);
@@ -158,7 +151,6 @@ char* Metric::ToString() {
return zone->PrintToString("%s %s", name(), ValueToString(Value(), unit()));
}
-
bool Metric::NameExists(Metric* head, const char* name) {
ASSERT(name != NULL);
while (head != NULL) {
@@ -172,7 +164,6 @@ bool Metric::NameExists(Metric* head, const char* name) {
return false;
}
-
void Metric::RegisterWithIsolate() {
ASSERT(isolate_ != NULL);
ASSERT(next_ == NULL);
@@ -185,7 +176,6 @@ void Metric::RegisterWithIsolate() {
isolate_->set_metrics_list_head(this);
}
-
void Metric::DeregisterWithIsolate() {
Metric* head = isolate_->metrics_list_head();
ASSERT(head != NULL);
@@ -214,7 +204,6 @@ void Metric::DeregisterWithIsolate() {
UNREACHABLE();
}
-
void Metric::RegisterWithVM() {
ASSERT(isolate_ == NULL);
ASSERT(next_ == NULL);
@@ -227,7 +216,6 @@ void Metric::RegisterWithVM() {
vm_list_head_ = this;
}
-
void Metric::DeregisterWithVM() {
ASSERT(isolate_ == NULL);
Metric* head = vm_list_head_;
@@ -259,43 +247,36 @@ void Metric::DeregisterWithVM() {
UNREACHABLE();
}
-
int64_t MetricHeapOldUsed::Value() const {
ASSERT(isolate() == Isolate::Current());
return isolate()->heap()->UsedInWords(Heap::kOld) * kWordSize;
}
-
int64_t MetricHeapOldCapacity::Value() const {
ASSERT(isolate() == Isolate::Current());
return isolate()->heap()->CapacityInWords(Heap::kOld) * kWordSize;
}
-
int64_t MetricHeapOldExternal::Value() const {
ASSERT(isolate() == Isolate::Current());
return isolate()->heap()->ExternalInWords(Heap::kOld) * kWordSize;
}
-
int64_t MetricHeapNewUsed::Value() const {
ASSERT(isolate() == Isolate::Current());
return isolate()->heap()->UsedInWords(Heap::kNew) * kWordSize;
}
-
int64_t MetricHeapNewCapacity::Value() const {
ASSERT(isolate() == Isolate::Current());
return isolate()->heap()->CapacityInWords(Heap::kNew) * kWordSize;
}
-
int64_t MetricHeapNewExternal::Value() const {
ASSERT(isolate() == Isolate::Current());
return isolate()->heap()->ExternalInWords(Heap::kNew) * kWordSize;
}
-
int64_t MetricHeapUsed::Value() const {
ASSERT(isolate() == Isolate::Current());
return isolate()->heap()->UsedInWords(Heap::kNew) * kWordSize +
@@ -306,7 +287,6 @@ int64_t MetricIsolateCount::Value() const {
return Isolate::IsolateListLength();
}
-
int64_t MetricPeakRSS::Value() const {
return OS::MaxRSS();
}
@@ -316,7 +296,6 @@ int64_t MetricPeakRSS::Value() const {
VM_METRIC_LIST(VM_METRIC_VARIABLE);
#undef VM_METRIC_VARIABLE
-
void Metric::InitOnce() {
#define VM_METRIC_INIT(type, variable, name, unit) \
vm_metric_##variable##_.Init(name, NULL, Metric::unit);
@@ -338,24 +317,20 @@ void Metric::Cleanup() {
}
}
-
MaxMetric::MaxMetric() : Metric() {
set_value(kMinInt64);
}
-
void MaxMetric::SetValue(int64_t new_value) {
if (new_value > value()) {
set_value(new_value);
}
}
-
MinMetric::MinMetric() : Metric() {
set_value(kMaxInt64);
}
-
void MinMetric::SetValue(int64_t new_value) {
if (new_value < value()) {
set_value(new_value);
« no previous file with comments | « runtime/vm/metrics.h ('k') | runtime/vm/mirrors_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698