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

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

Issue 600243002: Patchable AllocateArray stub, like instance allocation stubs. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/instructions_arm64_test.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/heap.h" 5 #include "vm/heap.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 return pretenure_policy_ > 0; 361 return pretenure_policy_ > 0;
362 } else { 362 } else {
363 return false; 363 return false;
364 } 364 }
365 } 365 }
366 366
367 367
368 void Heap::UpdatePretenurePolicy() { 368 void Heap::UpdatePretenurePolicy() {
369 if (FLAG_disable_alloc_stubs_after_gc) { 369 if (FLAG_disable_alloc_stubs_after_gc) {
370 ClassTable* table = isolate_->class_table(); 370 ClassTable* table = isolate_->class_table();
371 for (intptr_t cid = kNumPredefinedCids; cid < table->NumCids(); ++cid) { 371 for (intptr_t cid = 1; cid < table->NumCids(); ++cid) {
372 if (table->IsValidIndex(cid) && table->HasValidClassAt(cid)) { 372 if (((cid >= kNumPredefinedCids) || (cid == kArrayCid)) &&
373 table->IsValidIndex(cid) &&
374 table->HasValidClassAt(cid)) {
373 const Class& cls = Class::Handle(isolate_, table->At(cid)); 375 const Class& cls = Class::Handle(isolate_, table->At(cid));
374 cls.SwitchAllocationStub(); 376 cls.SwitchAllocationStub();
375 } 377 }
376 } 378 }
377 } 379 }
378 ClassHeapStats* stats = 380 ClassHeapStats* stats =
379 isolate_->class_table()->StatsWithUpdatedSize(kOneByteStringCid); 381 isolate_->class_table()->StatsWithUpdatedSize(kOneByteStringCid);
380 int allocated = stats->pre_gc.new_count; 382 int allocated = stats->pre_gc.new_count;
381 int promo_percent = (allocated == 0) ? 0 : 383 int promo_percent = (allocated == 0) ? 0 :
382 (100 * stats->promoted_count) / allocated; 384 (100 * stats->promoted_count) / allocated;
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 heap->DisableGrowthControl(); 717 heap->DisableGrowthControl();
716 } 718 }
717 719
718 720
719 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { 721 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() {
720 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); 722 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap();
721 heap->SetGrowthControlState(current_growth_controller_state_); 723 heap->SetGrowthControlState(current_growth_controller_state_);
722 } 724 }
723 725
724 } // namespace dart 726 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/instructions_arm64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698