| OLD | NEW |
| 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/json_stream.h" | 7 #include "vm/json_stream.h" |
| 8 #include "vm/object_id_ring.h" | 8 #include "vm/object_id_ring.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| 11 | 11 |
| 12 #ifndef PRODUCT |
| 13 |
| 12 void ObjectIdRing::Init(Isolate* isolate, int32_t capacity) { | 14 void ObjectIdRing::Init(Isolate* isolate, int32_t capacity) { |
| 13 ObjectIdRing* ring = new ObjectIdRing(isolate, capacity); | 15 ObjectIdRing* ring = new ObjectIdRing(isolate, capacity); |
| 14 isolate->set_object_id_ring(ring); | 16 isolate->set_object_id_ring(ring); |
| 15 } | 17 } |
| 16 | 18 |
| 17 | 19 |
| 18 ObjectIdRing::~ObjectIdRing() { | 20 ObjectIdRing::~ObjectIdRing() { |
| 19 ASSERT(table_ != NULL); | 21 ASSERT(table_ != NULL); |
| 20 free(table_); | 22 free(table_); |
| 21 table_ = NULL; | 23 table_ = NULL; |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 // Interval #2 | 248 // Interval #2 |
| 247 const int32_t max_serial_num = max_serial_; | 249 const int32_t max_serial_num = max_serial_; |
| 248 const int32_t bottom = max_serial_num - (capacity_ - serial_num_); | 250 const int32_t bottom = max_serial_num - (capacity_ - serial_num_); |
| 249 return id >= bottom && bottom < max_serial_num; | 251 return id >= bottom && bottom < max_serial_num; |
| 250 } | 252 } |
| 251 } | 253 } |
| 252 ASSERT(wrapped_ == false); | 254 ASSERT(wrapped_ == false); |
| 253 return IsValidContiguous(id); | 255 return IsValidContiguous(id); |
| 254 } | 256 } |
| 255 | 257 |
| 258 #endif // !PRODUCT |
| 259 |
| 256 } // namespace dart | 260 } // namespace dart |
| OLD | NEW |