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

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

Issue 2117593002: Fuchsia: Initial check-in. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Edit README Created 4 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/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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 AbandonBumpAllocation(); 665 AbandonBumpAllocation();
666 } 666 }
667 for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { 667 for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) {
668 if (!it.page()->embedder_allocated()) { 668 if (!it.page()->embedder_allocated()) {
669 it.page()->WriteProtect(read_only); 669 it.page()->WriteProtect(read_only);
670 } 670 }
671 } 671 }
672 } 672 }
673 673
674 674
675 #ifndef PRODUCT
675 void PageSpace::PrintToJSONObject(JSONObject* object) const { 676 void PageSpace::PrintToJSONObject(JSONObject* object) const {
676 if (!FLAG_support_service) { 677 if (!FLAG_support_service) {
677 return; 678 return;
678 } 679 }
679 Isolate* isolate = Isolate::Current(); 680 Isolate* isolate = Isolate::Current();
680 ASSERT(isolate != NULL); 681 ASSERT(isolate != NULL);
681 JSONObject space(object, "old"); 682 JSONObject space(object, "old");
682 space.AddProperty("type", "HeapSpace"); 683 space.AddProperty("type", "HeapSpace");
683 space.AddProperty("name", "old"); 684 space.AddProperty("name", "old");
684 space.AddProperty("vmName", "PageSpace"); 685 space.AddProperty("vmName", "PageSpace");
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 for (HeapPage* page = exec_pages_; page != NULL; page = page->next()) { 749 for (HeapPage* page = exec_pages_; page != NULL; page = page->next()) {
749 JSONObject page_container(&all_pages); 750 JSONObject page_container(&all_pages);
750 page_container.AddPropertyF("objectStart", 751 page_container.AddPropertyF("objectStart",
751 "0x%" Px "", page->object_start()); 752 "0x%" Px "", page->object_start());
752 JSONArray page_map(&page_container, "objects"); 753 JSONArray page_map(&page_container, "objects");
753 HeapMapAsJSONVisitor printer(&page_map); 754 HeapMapAsJSONVisitor printer(&page_map);
754 page->VisitObjects(&printer); 755 page->VisitObjects(&printer);
755 } 756 }
756 } 757 }
757 } 758 }
759 #endif // PRODUCT
758 760
759 761
760 bool PageSpace::ShouldCollectCode() { 762 bool PageSpace::ShouldCollectCode() {
761 // Try to collect code if enough time has passed since the last attempt. 763 // Try to collect code if enough time has passed since the last attempt.
762 const int64_t start = OS::GetCurrentTimeMicros(); 764 const int64_t start = OS::GetCurrentTimeMicros();
763 const int64_t last_code_collection_in_us = 765 const int64_t last_code_collection_in_us =
764 page_space_controller_.last_code_collection_in_us(); 766 page_space_controller_.last_code_collection_in_us();
765 767
766 if ((start - last_code_collection_in_us) > 768 if ((start - last_code_collection_in_us) >
767 FLAG_code_collection_interval_in_us) { 769 FLAG_code_collection_interval_in_us) {
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 return 0; 1238 return 0;
1237 } else { 1239 } else {
1238 ASSERT(total_time >= gc_time); 1240 ASSERT(total_time >= gc_time);
1239 int result = static_cast<int>((static_cast<double>(gc_time) / 1241 int result = static_cast<int>((static_cast<double>(gc_time) /
1240 static_cast<double>(total_time)) * 100); 1242 static_cast<double>(total_time)) * 100);
1241 return result; 1243 return result;
1242 } 1244 }
1243 } 1245 }
1244 1246
1245 } // namespace dart 1247 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698