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

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

Issue 1702093002: Minor work for background compilation (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Minor work for background compilation Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/class_table.h" 5 #include "vm/class_table.h"
6 #include "vm/flags.h" 6 #include "vm/flags.h"
7 #include "vm/freelist.h" 7 #include "vm/freelist.h"
8 #include "vm/growable_array.h" 8 #include "vm/growable_array.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 top_); 137 top_);
138 } 138 }
139 cls.set_id(top_); 139 cls.set_id(top_);
140 table_[top_] = cls.raw(); 140 table_[top_] = cls.raw();
141 top_++; // Increment next index. 141 top_++; // Increment next index.
142 } 142 }
143 } 143 }
144 144
145 145
146 void ClassTable::RegisterAt(intptr_t index, const Class& cls) { 146 void ClassTable::RegisterAt(intptr_t index, const Class& cls) {
147 ASSERT(Thread::Current()->IsMutatorThread());
147 ASSERT(index != kIllegalCid); 148 ASSERT(index != kIllegalCid);
148 ASSERT(index >= kNumPredefinedCids); 149 ASSERT(index >= kNumPredefinedCids);
149 if (index >= capacity_) { 150 if (index >= capacity_) {
150 // Grow the capacity of the class table. 151 // Grow the capacity of the class table.
151 // TODO(koda): Add ClassTable::Grow to share code. 152 // TODO(koda): Add ClassTable::Grow to share code.
152 intptr_t new_capacity = index + capacity_increment_; 153 intptr_t new_capacity = index + capacity_increment_;
153 if (!Class::is_valid_id(index) || new_capacity < capacity_) { 154 if (!Class::is_valid_id(index) || new_capacity < capacity_) {
154 FATAL1("Fatal error in ClassTable::Register: invalid index %" Pd "\n", 155 FATAL1("Fatal error in ClassTable::Register: invalid index %" Pd "\n",
155 index); 156 index);
156 } 157 }
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 542
542 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { 543 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) {
543 ClassHeapStats* stats = PreliminaryStatsAt(cid); 544 ClassHeapStats* stats = PreliminaryStatsAt(cid);
544 ASSERT(stats != NULL); 545 ASSERT(stats != NULL);
545 ASSERT(size >= 0); 546 ASSERT(size >= 0);
546 stats->post_gc.AddNew(size); 547 stats->post_gc.AddNew(size);
547 } 548 }
548 549
549 550
550 } // namespace dart 551 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698