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

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 Created 6 years, 8 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
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/megamorphic_cache_table.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 func->ptr()->code_ = StubCode::LazyCompile_entry()->code();
253 func->ptr()->unoptimized_code_ = Code::null(); 253 func->ptr()->unoptimized_code_ = Code::null();
254 if (FLAG_log_code_drop) { 254 if (FLAG_log_code_drop) {
255 // NOTE: This code runs while GC is in progress and runs within 255 // 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 256 // 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 257 // 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 258 // 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 259 // be able to reuse the handle based code and avoid having to add
260 // helper functions to the raw object interface. 260 // helper functions to the raw object interface.
261 String name; 261 String name;
262 name = func->ptr()->name_; 262 name = func->ptr()->name_;
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 MarkingWeakVisitor mark_weak; 497 MarkingWeakVisitor mark_weak;
498 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); 498 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks);
499 mark.Finalize(); 499 mark.Finalize();
500 ProcessWeakTables(page_space); 500 ProcessWeakTables(page_space);
501 ProcessObjectIdTable(isolate); 501 ProcessObjectIdTable(isolate);
502 502
503 Epilogue(isolate, invoke_api_callbacks); 503 Epilogue(isolate, invoke_api_callbacks);
504 } 504 }
505 505
506 } // namespace dart 506 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/megamorphic_cache_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698