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

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

Issue 1247783002: Make array allocation stub shared between isolates. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 unified diff | Download patch
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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 443
444 intptr_t ClassTable::CounterOffsetFor(intptr_t cid, bool is_new_space) { 444 intptr_t ClassTable::CounterOffsetFor(intptr_t cid, bool is_new_space) {
445 const intptr_t class_offset = ClassOffsetFor(cid); 445 const intptr_t class_offset = ClassOffsetFor(cid);
446 const intptr_t count_field_offset = is_new_space 446 const intptr_t count_field_offset = is_new_space
447 ? ClassHeapStats::allocated_since_gc_new_space_offset() 447 ? ClassHeapStats::allocated_since_gc_new_space_offset()
448 : ClassHeapStats::allocated_since_gc_old_space_offset(); 448 : ClassHeapStats::allocated_since_gc_old_space_offset();
449 return class_offset + count_field_offset; 449 return class_offset + count_field_offset;
450 } 450 }
451 451
452 452
453 ClassHeapStats** ClassTable::StateAddressFor(intptr_t cid, 453 intptr_t ClassTable::StateOffsetFor(intptr_t cid) {
454 intptr_t* state_offset) { 454 return ClassOffsetFor(cid)+ ClassHeapStats::state_offset();
455 *state_offset = ClassOffsetFor(cid)+ ClassHeapStats::state_offset();
456 return TableAddressFor(cid);
457 } 455 }
458 456
459 457
460 intptr_t ClassTable::SizeOffsetFor(intptr_t cid, bool is_new_space) { 458 intptr_t ClassTable::SizeOffsetFor(intptr_t cid, bool is_new_space) {
461 const uword class_offset = ClassOffsetFor(cid); 459 const uword class_offset = ClassOffsetFor(cid);
462 const uword size_field_offset = is_new_space 460 const uword size_field_offset = is_new_space
463 ? ClassHeapStats::allocated_size_since_gc_new_space_offset() 461 ? ClassHeapStats::allocated_size_since_gc_new_space_offset()
464 : ClassHeapStats::allocated_size_since_gc_old_space_offset(); 462 : ClassHeapStats::allocated_size_since_gc_old_space_offset();
465 return class_offset + size_field_offset; 463 return class_offset + size_field_offset;
466 } 464 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 524
527 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) { 525 void ClassTable::UpdateLiveNew(intptr_t cid, intptr_t size) {
528 ClassHeapStats* stats = PreliminaryStatsAt(cid); 526 ClassHeapStats* stats = PreliminaryStatsAt(cid);
529 ASSERT(stats != NULL); 527 ASSERT(stats != NULL);
530 ASSERT(size >= 0); 528 ASSERT(size >= 0);
531 stats->post_gc.AddNew(size); 529 stats->post_gc.AddNew(size);
532 } 530 }
533 531
534 532
535 } // namespace dart 533 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698