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

Side by Side Diff: runtime/vm/object_id_ring.cc

Issue 82793004: Add field and function view for libraries. Rough cut. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object.cc ('k') | tests/standalone/vmservice/isolate_class_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/dart_api_state.h" 6 #include "vm/dart_api_state.h"
7 #include "vm/object_id_ring.h" 7 #include "vm/object_id_ring.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 serial_num_++; 79 serial_num_++;
80 if (serial_num_ >= max_serial_) { 80 if (serial_num_ >= max_serial_) {
81 serial_num_ = 0; 81 serial_num_ = 0;
82 wrapped_ = true; 82 wrapped_ = true;
83 } 83 }
84 return r; 84 return r;
85 } 85 }
86 86
87 87
88 int32_t ObjectIdRing::AllocateNewId(RawObject* raw_obj) { 88 int32_t ObjectIdRing::AllocateNewId(RawObject* raw_obj) {
89 ASSERT(raw_obj->IsHeapObject()); 89 // TODO(turnidge): Do not enter Smis into the ObjectIdRing.
Ivan Posva 2013/11/22 22:58:36 I would actually leave the ASSERT in the code, jus
90 int32_t id = NextSerial(); 90 int32_t id = NextSerial();
91 ASSERT(id != kInvalidId); 91 ASSERT(id != kInvalidId);
92 int32_t cursor = IndexOfId(id); 92 int32_t cursor = IndexOfId(id);
93 ASSERT(cursor != kInvalidId); 93 ASSERT(cursor != kInvalidId);
94 if (table_[cursor] != Object::null()) { 94 if (table_[cursor] != Object::null()) {
95 // Free old handle. 95 // Free old handle.
96 table_[cursor] = Object::null(); 96 table_[cursor] = Object::null();
97 } 97 }
98 ASSERT(table_[cursor] == Object::null()); 98 ASSERT(table_[cursor] == Object::null());
99 table_[cursor] = raw_obj; 99 table_[cursor] = raw_obj;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 const int32_t max_serial_num = max_serial_; 158 const int32_t max_serial_num = max_serial_;
159 const int32_t bottom = max_serial_num - (capacity_ - serial_num_); 159 const int32_t bottom = max_serial_num - (capacity_ - serial_num_);
160 return id >= bottom && bottom < max_serial_num; 160 return id >= bottom && bottom < max_serial_num;
161 } 161 }
162 } 162 }
163 ASSERT(wrapped_ == false); 163 ASSERT(wrapped_ == false);
164 return IsValidContiguous(id); 164 return IsValidContiguous(id);
165 } 165 }
166 166
167 } // namespace dart 167 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | tests/standalone/vmservice/isolate_class_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698