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

Side by Side Diff: runtime/vm/compiler.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/compiler.h" 5 #include "vm/compiler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 8
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/block_scheduler.h" 10 #include "vm/block_scheduler.h"
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 graph_compiler.FinalizeStaticCallTargetsTable(code); 555 graph_compiler.FinalizeStaticCallTargetsTable(code);
556 556
557 if (optimized) { 557 if (optimized) {
558 if (osr_id == Isolate::kNoDeoptId) { 558 if (osr_id == Isolate::kNoDeoptId) {
559 CodePatcher::PatchEntry(Code::Handle(function.CurrentCode())); 559 CodePatcher::PatchEntry(Code::Handle(function.CurrentCode()));
560 if (FLAG_trace_compiler) { 560 if (FLAG_trace_compiler) {
561 OS::Print("--> patching entry %#" Px "\n", 561 OS::Print("--> patching entry %#" Px "\n",
562 Code::Handle(function.unoptimized_code()).EntryPoint()); 562 Code::Handle(function.unoptimized_code()).EntryPoint());
563 } 563 }
564 } 564 }
565 function.SetCode(code); 565 function.AttachCode(code);
566 566
567 for (intptr_t i = 0; 567 for (intptr_t i = 0;
568 i < flow_graph->guarded_fields()->length(); 568 i < flow_graph->guarded_fields()->length();
569 i++) { 569 i++) {
570 const Field* field = (*flow_graph->guarded_fields())[i]; 570 const Field* field = (*flow_graph->guarded_fields())[i];
571 field->RegisterDependentCode(code); 571 field->RegisterDependentCode(code);
572 } 572 }
573 } else { 573 } else {
574 function.set_unoptimized_code(code); 574 function.set_unoptimized_code(code);
575 function.SetCode(code); 575 function.AttachCode(code);
576 ASSERT(CodePatcher::CodeIsPatchable(code)); 576 ASSERT(CodePatcher::CodeIsPatchable(code));
577 } 577 }
578 } 578 }
579 is_compiled = true; 579 is_compiled = true;
580 done = true; 580 done = true;
581 } else { 581 } else {
582 // We bailed out. 582 // We bailed out.
583 583
584 if (isolate->object_store()->sticky_error() == 584 if (isolate->object_store()->sticky_error() ==
585 Object::branch_offset_error().raw()) { 585 Object::branch_offset_error().raw()) {
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 const Object& result = 947 const Object& result =
948 Object::Handle(isolate->object_store()->sticky_error()); 948 Object::Handle(isolate->object_store()->sticky_error());
949 isolate->object_store()->clear_sticky_error(); 949 isolate->object_store()->clear_sticky_error();
950 return result.raw(); 950 return result.raw();
951 } 951 }
952 UNREACHABLE(); 952 UNREACHABLE();
953 return Object::null(); 953 return Object::null();
954 } 954 }
955 955
956 } // namespace dart 956 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/gc_marker.cc » ('j') | runtime/vm/raw_object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698