| 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 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1038   ASSERT(Utils::IsAligned(pointer, OS::PreferredCodeAlignment())); | 1038   ASSERT(Utils::IsAligned(pointer, OS::PreferredCodeAlignment())); | 
| 1039 | 1039 | 
| 1040   VirtualMemory* memory = VirtualMemory::ForInstructionsSnapshot(pointer, size); | 1040   VirtualMemory* memory = VirtualMemory::ForInstructionsSnapshot(pointer, size); | 
| 1041   ASSERT(memory != NULL); | 1041   ASSERT(memory != NULL); | 
| 1042   HeapPage* page = reinterpret_cast<HeapPage*>(malloc(sizeof(HeapPage))); | 1042   HeapPage* page = reinterpret_cast<HeapPage*>(malloc(sizeof(HeapPage))); | 
| 1043   page->memory_ = memory; | 1043   page->memory_ = memory; | 
| 1044   page->next_ = NULL; | 1044   page->next_ = NULL; | 
| 1045   page->object_end_ = memory->end(); | 1045   page->object_end_ = memory->end(); | 
| 1046   page->executable_ = true; | 1046   page->executable_ = true; | 
| 1047 | 1047 | 
| 1048 #if defined(DEBUG) |  | 
| 1049   OS::Print("Precompiled instructions page at [0x%" Px ", 0x%" Px ")\n", |  | 
| 1050             page->object_start(), page->object_end()); |  | 
| 1051 #endif |  | 
| 1052 |  | 
| 1053   MutexLocker ml(pages_lock_); | 1048   MutexLocker ml(pages_lock_); | 
| 1054   if (exec_pages_ == NULL) { | 1049   if (exec_pages_ == NULL) { | 
| 1055     exec_pages_ = page; | 1050     exec_pages_ = page; | 
| 1056   } else { | 1051   } else { | 
| 1057     exec_pages_tail_->set_next(page); | 1052     exec_pages_tail_->set_next(page); | 
| 1058   } | 1053   } | 
| 1059   exec_pages_tail_ = page; | 1054   exec_pages_tail_ = page; | 
| 1060 } | 1055 } | 
| 1061 | 1056 | 
| 1062 | 1057 | 
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1185     return 0; | 1180     return 0; | 
| 1186   } else { | 1181   } else { | 
| 1187     ASSERT(total_time >= gc_time); | 1182     ASSERT(total_time >= gc_time); | 
| 1188     int result = static_cast<int>((static_cast<double>(gc_time) / | 1183     int result = static_cast<int>((static_cast<double>(gc_time) / | 
| 1189                                    static_cast<double>(total_time)) * 100); | 1184                                    static_cast<double>(total_time)) * 100); | 
| 1190     return result; | 1185     return result; | 
| 1191   } | 1186   } | 
| 1192 } | 1187 } | 
| 1193 | 1188 | 
| 1194 }  // namespace dart | 1189 }  // namespace dart | 
| OLD | NEW | 
|---|