OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/gc_marker.h" | 5 #include "vm/gc_marker.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 void Add(RawFunction* func) { | 85 void Add(RawFunction* func) { |
86 skipped_code_functions_.Add(func); | 86 skipped_code_functions_.Add(func); |
87 } | 87 } |
88 | 88 |
89 void DetachCode() { | 89 void DetachCode() { |
90 intptr_t unoptimized_code_count = 0; | 90 intptr_t unoptimized_code_count = 0; |
91 intptr_t current_code_count = 0; | 91 intptr_t current_code_count = 0; |
92 for (int i = 0; i < skipped_code_functions_.length(); i++) { | 92 for (int i = 0; i < skipped_code_functions_.length(); i++) { |
93 RawFunction* func = skipped_code_functions_[i]; | 93 RawFunction* func = skipped_code_functions_[i]; |
94 RawCode* code = func->ptr()->code_; | 94 RawCode* code = func->ptr()->instructions_->ptr()->code_; |
95 if (!code->IsMarked()) { | 95 if (!code->IsMarked()) { |
96 // If the code wasn't strongly visited through other references | 96 // If the code wasn't strongly visited through other references |
97 // after skipping the function's code pointer, then we disconnect the | 97 // after skipping the function's code pointer, then we disconnect the |
98 // code from the function. | 98 // code from the function. |
99 func->StorePointer( | 99 func->StorePointer( |
100 &(func->ptr()->code_), | 100 &(func->ptr()->instructions_), |
101 StubCode::LazyCompile_entry()->code()); | 101 StubCode::LazyCompile_entry()->code()->ptr()->instructions_); |
102 uword entry_point = StubCode::LazyCompile_entry()->EntryPoint(); | 102 uword entry_point = StubCode::LazyCompile_entry()->EntryPoint(); |
103 func->ptr()->entry_point_ = entry_point; | 103 func->ptr()->entry_point_ = entry_point; |
104 if (FLAG_log_code_drop) { | 104 if (FLAG_log_code_drop) { |
105 // NOTE: This code runs while GC is in progress and runs within | 105 // NOTE: This code runs while GC is in progress and runs within |
106 // a NoHandleScope block. Hence it is not okay to use a regular Zone | 106 // a NoHandleScope block. Hence it is not okay to use a regular Zone |
107 // or Scope handle. We use a direct stack handle so the raw pointer in | 107 // or Scope handle. We use a direct stack handle so the raw pointer in |
108 // this handle is not traversed. The use of a handle is mainly to | 108 // this handle is not traversed. The use of a handle is mainly to |
109 // be able to reuse the handle based code and avoid having to add | 109 // be able to reuse the handle based code and avoid having to add |
110 // helper functions to the raw object interface. | 110 // helper functions to the raw object interface. |
111 String name; | 111 String name; |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 // Finalization complete and all tasks exited. | 707 // Finalization complete and all tasks exited. |
708 } | 708 } |
709 delay_set.ClearReferences(); | 709 delay_set.ClearReferences(); |
710 ProcessWeakTables(page_space); | 710 ProcessWeakTables(page_space); |
711 ProcessObjectIdTable(isolate); | 711 ProcessObjectIdTable(isolate); |
712 } | 712 } |
713 Epilogue(isolate, invoke_api_callbacks); | 713 Epilogue(isolate, invoke_api_callbacks); |
714 } | 714 } |
715 | 715 |
716 } // namespace dart | 716 } // namespace dart |
OLD | NEW |