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

Unified Diff: runtime/vm/object_id_ring.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/object_id_ring.h ('k') | runtime/vm/object_id_ring_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_id_ring.cc
diff --git a/runtime/vm/object_id_ring.cc b/runtime/vm/object_id_ring.cc
index d01d8bd296007d58ce1e02931697b011a164c3d8..aba613abc583b9197aba83fc5316694545f23dd6 100644
--- a/runtime/vm/object_id_ring.cc
+++ b/runtime/vm/object_id_ring.cc
@@ -2,10 +2,11 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+#include "vm/object_id_ring.h"
+
#include "platform/assert.h"
#include "vm/dart_api_state.h"
#include "vm/json_stream.h"
-#include "vm/object_id_ring.h"
namespace dart {
@@ -16,7 +17,6 @@ void ObjectIdRing::Init(Isolate* isolate, int32_t capacity) {
isolate->set_object_id_ring(ring);
}
-
ObjectIdRing::~ObjectIdRing() {
ASSERT(table_ != NULL);
free(table_);
@@ -27,7 +27,6 @@ ObjectIdRing::~ObjectIdRing() {
}
}
-
int32_t ObjectIdRing::GetIdForObject(RawObject* object, IdPolicy policy) {
// We do not allow inserting null because null is how we detect as entry was
// reclaimed by the GC.
@@ -44,7 +43,6 @@ int32_t ObjectIdRing::GetIdForObject(RawObject* object, IdPolicy policy) {
return AllocateNewId(object);
}
-
int32_t ObjectIdRing::FindExistingIdForObject(RawObject* raw_obj) {
for (int32_t i = 0; i < capacity_; i++) {
if (table_[i] == raw_obj) {
@@ -54,7 +52,6 @@ int32_t ObjectIdRing::FindExistingIdForObject(RawObject* raw_obj) {
return kInvalidId;
}
-
RawObject* ObjectIdRing::GetObjectForId(int32_t id, LookupResult* kind) {
int32_t index = IndexOfId(id);
if (index == kInvalidId) {
@@ -72,13 +69,11 @@ RawObject* ObjectIdRing::GetObjectForId(int32_t id, LookupResult* kind) {
return table_[index];
}
-
void ObjectIdRing::VisitPointers(ObjectPointerVisitor* visitor) {
ASSERT(table_ != NULL);
visitor->VisitPointers(table_, capacity_);
}
-
void ObjectIdRing::PrintJSON(JSONStream* js) {
Thread* thread = Thread::Current();
Zone* zone = thread->zone();
@@ -100,7 +95,6 @@ void ObjectIdRing::PrintJSON(JSONStream* js) {
}
}
-
ObjectIdRing::ObjectIdRing(Isolate* isolate, int32_t capacity) {
ASSERT(capacity > 0);
isolate_ = isolate;
@@ -110,7 +104,6 @@ ObjectIdRing::ObjectIdRing(Isolate* isolate, int32_t capacity) {
SetCapacityAndMaxSerial(capacity, kMaxId);
}
-
void ObjectIdRing::SetCapacityAndMaxSerial(int32_t capacity,
int32_t max_serial) {
ASSERT(max_serial <= kMaxId);
@@ -127,7 +120,6 @@ void ObjectIdRing::SetCapacityAndMaxSerial(int32_t capacity,
max_serial_ = max_serial - (max_serial % capacity_);
}
-
int32_t ObjectIdRing::NextSerial() {
int32_t r = serial_num_;
serial_num_++;
@@ -138,7 +130,6 @@ int32_t ObjectIdRing::NextSerial() {
return r;
}
-
int32_t ObjectIdRing::AllocateNewId(RawObject* raw_obj) {
ASSERT(raw_obj->IsHeapObject());
int32_t id = NextSerial();
@@ -149,7 +140,6 @@ int32_t ObjectIdRing::AllocateNewId(RawObject* raw_obj) {
return id;
}
-
int32_t ObjectIdRing::IndexOfId(int32_t id) {
if (!IsValidId(id)) {
return kInvalidId;
@@ -158,7 +148,6 @@ int32_t ObjectIdRing::IndexOfId(int32_t id) {
return id % capacity_;
}
-
int32_t ObjectIdRing::IdOfIndex(int32_t index) {
if (index < 0) {
return kInvalidId;
@@ -200,7 +189,6 @@ int32_t ObjectIdRing::IdOfIndex(int32_t index) {
return id;
}
-
bool ObjectIdRing::IsValidContiguous(int32_t id) {
ASSERT(id != kInvalidId);
ASSERT((id >= 0) && (id < max_serial_));
@@ -215,7 +203,6 @@ bool ObjectIdRing::IsValidContiguous(int32_t id) {
return id >= bottom;
}
-
bool ObjectIdRing::IsValidId(int32_t id) {
if (id == kInvalidId) {
return false;
« no previous file with comments | « runtime/vm/object_id_ring.h ('k') | runtime/vm/object_id_ring_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698