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

Side by Side Diff: dart/runtime/vm/pages.cc

Issue 119673004: Version 1.1.0-dev.5.2 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 11 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 | « dart/runtime/vm/object_test.cc ('k') | dart/runtime/vm/parser.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/pages.h" 5 #include "vm/pages.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/compiler_stats.h" 8 #include "vm/compiler_stats.h"
9 #include "vm/gc_marker.h" 9 #include "vm/gc_marker.h"
10 #include "vm/gc_sweeper.h" 10 #include "vm/gc_sweeper.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 RawObject* raw_obj = RawObject::FromAddr(obj_addr); 77 RawObject* raw_obj = RawObject::FromAddr(obj_addr);
78 obj_addr += raw_obj->VisitPointers(visitor); 78 obj_addr += raw_obj->VisitPointers(visitor);
79 } 79 }
80 ASSERT(obj_addr == end_addr); 80 ASSERT(obj_addr == end_addr);
81 } 81 }
82 82
83 83
84 RawObject* HeapPage::FindObject(FindObjectVisitor* visitor) const { 84 RawObject* HeapPage::FindObject(FindObjectVisitor* visitor) const {
85 uword obj_addr = object_start(); 85 uword obj_addr = object_start();
86 uword end_addr = object_end(); 86 uword end_addr = object_end();
87 while (obj_addr < end_addr) { 87 if (visitor->VisitRange(obj_addr, end_addr)) {
88 RawObject* raw_obj = RawObject::FromAddr(obj_addr); 88 while (obj_addr < end_addr) {
89 if (raw_obj->FindObject(visitor)) { 89 RawObject* raw_obj = RawObject::FromAddr(obj_addr);
90 return raw_obj; // Found object, return it. 90 uword next_obj_addr = obj_addr + raw_obj->Size();
91 if (visitor->VisitRange(obj_addr, next_obj_addr) &&
92 raw_obj->FindObject(visitor)) {
93 return raw_obj; // Found object, return it.
94 }
95 obj_addr = next_obj_addr;
91 } 96 }
92 obj_addr += raw_obj->Size(); 97 ASSERT(obj_addr == end_addr);
93 } 98 }
94 ASSERT(obj_addr == end_addr);
95 return Object::null(); 99 return Object::null();
96 } 100 }
97 101
98 102
99 void HeapPage::WriteProtect(bool read_only) { 103 void HeapPage::WriteProtect(bool read_only) {
100 VirtualMemory::Protection prot; 104 VirtualMemory::Protection prot;
101 if (read_only) { 105 if (read_only) {
102 if (executable_) { 106 if (executable_) {
103 prot = VirtualMemory::kReadExecute; 107 prot = VirtualMemory::kReadExecute;
104 } else { 108 } else {
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 return 0; 626 return 0;
623 } else { 627 } else {
624 ASSERT(total_time >= gc_time); 628 ASSERT(total_time >= gc_time);
625 int result= static_cast<int>((static_cast<double>(gc_time) / 629 int result= static_cast<int>((static_cast<double>(gc_time) /
626 static_cast<double>(total_time)) * 100); 630 static_cast<double>(total_time)) * 100);
627 return result; 631 return result;
628 } 632 }
629 } 633 }
630 634
631 } // namespace dart 635 } // namespace dart
OLDNEW
« no previous file with comments | « dart/runtime/vm/object_test.cc ('k') | dart/runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698