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

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

Issue 311963002: In class Function replace current code field with current instruction field, that way we save one l… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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/intermediate_language_arm.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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } else { 237 } else {
238 class_table_->UpdateLiveOld(raw_obj->GetClassId(), 0); 238 class_table_->UpdateLiveOld(raw_obj->GetClassId(), 0);
239 } 239 }
240 240
241 MarkAndPush(raw_obj); 241 MarkAndPush(raw_obj);
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()->instructions_->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_ = StubCode::LazyCompile_entry()->code(); 252 func->ptr()->instructions_ =
253 StubCode::LazyCompile_entry()->code()->ptr()->instructions_;
253 func->ptr()->unoptimized_code_ = Code::null(); 254 func->ptr()->unoptimized_code_ = Code::null();
254 if (FLAG_log_code_drop) { 255 if (FLAG_log_code_drop) {
255 // NOTE: This code runs while GC is in progress and runs within 256 // 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 257 // 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 258 // 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 259 // 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 260 // be able to reuse the handle based code and avoid having to add
260 // helper functions to the raw object interface. 261 // helper functions to the raw object interface.
261 String name; 262 String name;
262 name = func->ptr()->name_; 263 name = func->ptr()->name_;
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 MarkingWeakVisitor mark_weak; 508 MarkingWeakVisitor mark_weak;
508 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); 509 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks);
509 mark.Finalize(); 510 mark.Finalize();
510 ProcessWeakTables(page_space); 511 ProcessWeakTables(page_space);
511 ProcessObjectIdTable(isolate); 512 ProcessObjectIdTable(isolate);
512 513
513 Epilogue(isolate, invoke_api_callbacks); 514 Epilogue(isolate, invoke_api_callbacks);
514 } 515 }
515 516
516 } // namespace dart 517 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698