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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 } | 239 } |
240 | 240 |
241 MarkAndPush(raw_obj); | 241 MarkAndPush(raw_obj); |
242 } | 242 } |
243 | 243 |
244 void DetachCode() { | 244 void DetachCode() { |
245 intptr_t unoptimized_code_count = 0; | 245 intptr_t unoptimized_code_count = 0; |
246 intptr_t current_code_count = 0; | 246 intptr_t current_code_count = 0; |
247 for (int i = 0; i < skipped_code_functions_.length(); i++) { | 247 for (int i = 0; i < skipped_code_functions_.length(); i++) { |
248 RawFunction* func = skipped_code_functions_[i]; | 248 RawFunction* func = skipped_code_functions_[i]; |
249 RawCode* code = func->ptr()->instructions_->ptr()->code_; | 249 RawCode* code = func->ptr()->code_; |
250 if (!code->IsMarked()) { | 250 if (!code->IsMarked()) { |
251 // If the code wasn't strongly visited through other references | 251 // If the code wasn't strongly visited through other references |
252 // after skipping the function's code pointer, then we disconnect the | 252 // after skipping the function's code pointer, then we disconnect the |
253 // code from the function. | 253 // code from the function. |
254 StubCode* stub_code = isolate()->stub_code(); | 254 StubCode* stub_code = isolate()->stub_code(); |
255 func->StorePointer( | 255 func->StorePointer( |
256 &(func->ptr()->instructions_), | 256 &(func->ptr()->code_), |
257 stub_code->LazyCompile_entry()->code()->ptr()->instructions_); | 257 stub_code->LazyCompile_entry()->code()); |
258 if (FLAG_log_code_drop) { | 258 if (FLAG_log_code_drop) { |
259 // NOTE: This code runs while GC is in progress and runs within | 259 // NOTE: This code runs while GC is in progress and runs within |
260 // a NoHandleScope block. Hence it is not okay to use a regular Zone | 260 // a NoHandleScope block. Hence it is not okay to use a regular Zone |
261 // or Scope handle. We use a direct stack handle so the raw pointer in | 261 // or Scope handle. We use a direct stack handle so the raw pointer in |
262 // this handle is not traversed. The use of a handle is mainly to | 262 // this handle is not traversed. The use of a handle is mainly to |
263 // be able to reuse the handle based code and avoid having to add | 263 // be able to reuse the handle based code and avoid having to add |
264 // helper functions to the raw object interface. | 264 // helper functions to the raw object interface. |
265 String name; | 265 String name; |
266 name = func->ptr()->name_; | 266 name = func->ptr()->name_; |
267 ISL_Print("Detaching code: %s\n", name.ToCString()); | 267 ISL_Print("Detaching code: %s\n", name.ToCString()); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 MarkingWeakVisitor mark_weak; | 538 MarkingWeakVisitor mark_weak; |
539 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); | 539 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); |
540 mark.Finalize(); | 540 mark.Finalize(); |
541 ProcessWeakTables(page_space); | 541 ProcessWeakTables(page_space); |
542 ProcessObjectIdTable(isolate); | 542 ProcessObjectIdTable(isolate); |
543 } | 543 } |
544 Epilogue(isolate, invoke_api_callbacks); | 544 Epilogue(isolate, invoke_api_callbacks); |
545 } | 545 } |
546 | 546 |
547 } // namespace dart | 547 } // namespace dart |
OLD | NEW |