| OLD | NEW |
| 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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 graph_compiler.FinalizeStaticCallTargetsTable(code); | 559 graph_compiler.FinalizeStaticCallTargetsTable(code); |
| 560 | 560 |
| 561 if (optimized) { | 561 if (optimized) { |
| 562 if (osr_id == Isolate::kNoDeoptId) { | 562 if (osr_id == Isolate::kNoDeoptId) { |
| 563 CodePatcher::PatchEntry(Code::Handle(function.CurrentCode())); | 563 CodePatcher::PatchEntry(Code::Handle(function.CurrentCode())); |
| 564 if (FLAG_trace_compiler) { | 564 if (FLAG_trace_compiler) { |
| 565 OS::Print("--> patching entry %#" Px "\n", | 565 OS::Print("--> patching entry %#" Px "\n", |
| 566 Code::Handle(function.unoptimized_code()).EntryPoint()); | 566 Code::Handle(function.unoptimized_code()).EntryPoint()); |
| 567 } | 567 } |
| 568 } | 568 } |
| 569 function.SetCode(code); | 569 function.AttachCode(code); |
| 570 | 570 |
| 571 for (intptr_t i = 0; | 571 for (intptr_t i = 0; |
| 572 i < flow_graph->guarded_fields()->length(); | 572 i < flow_graph->guarded_fields()->length(); |
| 573 i++) { | 573 i++) { |
| 574 const Field* field = (*flow_graph->guarded_fields())[i]; | 574 const Field* field = (*flow_graph->guarded_fields())[i]; |
| 575 field->RegisterDependentCode(code); | 575 field->RegisterDependentCode(code); |
| 576 } | 576 } |
| 577 } else { | 577 } else { |
| 578 function.set_unoptimized_code(code); | 578 function.set_unoptimized_code(code); |
| 579 function.SetCode(code); | 579 function.AttachCode(code); |
| 580 ASSERT(CodePatcher::CodeIsPatchable(code)); | 580 ASSERT(CodePatcher::CodeIsPatchable(code)); |
| 581 } | 581 } |
| 582 if (parsed_function->HasDeferredPrefixes()) { | 582 if (parsed_function->HasDeferredPrefixes()) { |
| 583 GrowableObjectArray* prefixes = parsed_function->DeferredPrefixes(); | 583 GrowableObjectArray* prefixes = parsed_function->DeferredPrefixes(); |
| 584 LibraryPrefix& prefix = LibraryPrefix::Handle(); | 584 LibraryPrefix& prefix = LibraryPrefix::Handle(); |
| 585 for (intptr_t i = 0; i < prefixes->Length(); i++) { | 585 for (intptr_t i = 0; i < prefixes->Length(); i++) { |
| 586 prefix ^= prefixes->At(i); | 586 prefix ^= prefixes->At(i); |
| 587 prefix.RegisterDependentCode(code); | 587 prefix.RegisterDependentCode(code); |
| 588 } | 588 } |
| 589 } | 589 } |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 const Object& result = | 959 const Object& result = |
| 960 Object::Handle(isolate->object_store()->sticky_error()); | 960 Object::Handle(isolate->object_store()->sticky_error()); |
| 961 isolate->object_store()->clear_sticky_error(); | 961 isolate->object_store()->clear_sticky_error(); |
| 962 return result.raw(); | 962 return result.raw(); |
| 963 } | 963 } |
| 964 UNREACHABLE(); | 964 UNREACHABLE(); |
| 965 return Object::null(); | 965 return Object::null(); |
| 966 } | 966 } |
| 967 | 967 |
| 968 } // namespace dart | 968 } // namespace dart |
| OLD | NEW |