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

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

Issue 203523011: Introduce a lazy-compile stub for functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased & added MIPS code Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 242 }
243 243
244 void DetachCode() { 244 void DetachCode() {
245 for (int i = 0; i < skipped_code_functions_.length(); i++) { 245 for (int i = 0; i < skipped_code_functions_.length(); i++) {
246 RawFunction* func = skipped_code_functions_[i]; 246 RawFunction* func = skipped_code_functions_[i];
247 RawCode* code = func->ptr()->code_; 247 RawCode* code = func->ptr()->code_;
248 if (!code->IsMarked()) { 248 if (!code->IsMarked()) {
249 // If the code wasn't strongly visited through other references 249 // If the code wasn't strongly visited through other references
250 // after skipping the function's code pointer, then we disconnect the 250 // after skipping the function's code pointer, then we disconnect the
251 // code from the function. 251 // code from the function.
252 func->ptr()->code_ = Code::null(); 252 bool is_closure =
253 Function::KindBits::decode(func->ptr()->kind_tag_) ==
254 RawFunction::kClosureFunction;
255 func->ptr()->code_ = is_closure
256 ? StubCode::LazyCompileClosure_entry()->code()
257 : Code::null();
253 func->ptr()->unoptimized_code_ = Code::null(); 258 func->ptr()->unoptimized_code_ = Code::null();
254 if (FLAG_log_code_drop) { 259 if (FLAG_log_code_drop) {
255 // NOTE: This code runs while GC is in progress and runs within 260 // NOTE: This code runs while GC is in progress and runs within
256 // a NoHandleScope block. Hence it is not okay to use a regular Zone 261 // a NoHandleScope block. Hence it is not okay to use a regular Zone
257 // or Scope handle. We use a direct stack handle so the raw pointer in 262 // or Scope handle. We use a direct stack handle so the raw pointer in
258 // this handle is not traversed. The use of a handle is mainly to 263 // this handle is not traversed. The use of a handle is mainly to
259 // be able to reuse the handle based code and avoid having to add 264 // be able to reuse the handle based code and avoid having to add
260 // helper functions to the raw object interface. 265 // helper functions to the raw object interface.
261 String name; 266 String name;
262 name = func->ptr()->name_; 267 name = func->ptr()->name_;
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 MarkingWeakVisitor mark_weak; 502 MarkingWeakVisitor mark_weak;
498 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); 503 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks);
499 mark.Finalize(); 504 mark.Finalize();
500 ProcessWeakTables(page_space); 505 ProcessWeakTables(page_space);
501 ProcessObjectIdTable(isolate); 506 ProcessObjectIdTable(isolate);
502 507
503 Epilogue(isolate, invoke_api_callbacks); 508 Epilogue(isolate, invoke_api_callbacks);
504 } 509 }
505 510
506 } // namespace dart 511 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698