| OLD | NEW |
| 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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 OS::Print("Trying to detach code.\n"); | 439 OS::Print("Trying to detach code.\n"); |
| 440 } | 440 } |
| 441 page_space_controller_.set_last_code_collection_in_us(start); | 441 page_space_controller_.set_last_code_collection_in_us(start); |
| 442 return true; | 442 return true; |
| 443 } | 443 } |
| 444 return false; | 444 return false; |
| 445 } | 445 } |
| 446 | 446 |
| 447 | 447 |
| 448 void PageSpace::WriteProtectCode(bool read_only) { | 448 void PageSpace::WriteProtectCode(bool read_only) { |
| 449 // TODO(koda): Is this flag still useful? | |
| 450 if (FLAG_write_protect_code) { | 449 if (FLAG_write_protect_code) { |
| 451 HeapPage* current_page = pages_; | 450 HeapPage* current_page = pages_; |
| 452 while (current_page != NULL) { | 451 while (current_page != NULL) { |
| 453 if (current_page->type() == HeapPage::kExecutable) { | 452 if (current_page->type() == HeapPage::kExecutable) { |
| 454 current_page->WriteProtect(read_only); | 453 current_page->WriteProtect(read_only); |
| 455 } | 454 } |
| 456 current_page = NextPageAnySize(current_page); | 455 current_page = NextPageAnySize(current_page); |
| 457 } | 456 } |
| 458 } | 457 } |
| 459 } | 458 } |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 return 0; | 681 return 0; |
| 683 } else { | 682 } else { |
| 684 ASSERT(total_time >= gc_time); | 683 ASSERT(total_time >= gc_time); |
| 685 int result= static_cast<int>((static_cast<double>(gc_time) / | 684 int result= static_cast<int>((static_cast<double>(gc_time) / |
| 686 static_cast<double>(total_time)) * 100); | 685 static_cast<double>(total_time)) * 100); |
| 687 return result; | 686 return result; |
| 688 } | 687 } |
| 689 } | 688 } |
| 690 | 689 |
| 691 } // namespace dart | 690 } // namespace dart |
| OLD | NEW |