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

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

Issue 1430973005: Don't register code for CHA or field guard deopt when precompiling. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | 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) 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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 result->ClearFieldInnvalidationGen(); 788 result->ClearFieldInnvalidationGen();
789 } 789 }
790 if (!parsed_function->HasDeferredPrefixes()) { 790 if (!parsed_function->HasDeferredPrefixes()) {
791 result->ClearPrefixInnvalidationGen(); 791 result->ClearPrefixInnvalidationGen();
792 } 792 }
793 } else { 793 } else {
794 const bool is_osr = osr_id != Compiler::kNoOSRDeoptId; 794 const bool is_osr = osr_id != Compiler::kNoOSRDeoptId;
795 function.InstallOptimizedCode(code, is_osr); 795 function.InstallOptimizedCode(code, is_osr);
796 } 796 }
797 797
798 // TODO(srdjan): In background compilation, verify that CHA has not 798 // TODO(srdjan): In background compilation, verify that CHA and field
799 // been invalidated in the meantime. 799 // guards have not been invalidated in the meantime.
800 // Register code with the classes it depends on because of CHA. 800 // Register code with the classes it depends on because of CHA and
801 for (intptr_t i = 0; 801 // fields it depends on because of store guards, unless we cannot
802 i < thread->cha()->leaf_classes().length(); 802 // deopt.
803 ++i) { 803 if (Compiler::allow_recompilation()) {
804 thread->cha()->leaf_classes()[i]->RegisterCHACode(code); 804 for (intptr_t i = 0;
805 } 805 i < thread->cha()->leaf_classes().length();
806 806 ++i) {
807 for (intptr_t i = 0; 807 thread->cha()->leaf_classes()[i]->RegisterCHACode(code);
808 i < flow_graph->guarded_fields()->length(); 808 }
809 i++) { 809 for (intptr_t i = 0;
810 const Field* field = (*flow_graph->guarded_fields())[i]; 810 i < flow_graph->guarded_fields()->length();
811 field->RegisterDependentCode(code); 811 i++) {
812 const Field* field = (*flow_graph->guarded_fields())[i];
813 field->RegisterDependentCode(code);
814 }
812 } 815 }
813 } else { // not optimized. 816 } else { // not optimized.
814 if (!Compiler::always_optimize() && 817 if (!Compiler::always_optimize() &&
815 (function.ic_data_array() == Array::null())) { 818 (function.ic_data_array() == Array::null())) {
816 function.SaveICDataMap( 819 function.SaveICDataMap(
817 graph_compiler.deopt_id_to_ic_data(), 820 graph_compiler.deopt_id_to_ic_data(),
818 Array::Handle(zone, graph_compiler.edge_counters_array())); 821 Array::Handle(zone, graph_compiler.edge_counters_array()));
819 } 822 }
820 function.set_unoptimized_code(code); 823 function.set_unoptimized_code(code);
821 function.AttachCode(code); 824 function.AttachCode(code);
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 isolate->set_background_compiler(task); 1827 isolate->set_background_compiler(task);
1825 start_task = true; 1828 start_task = true;
1826 } 1829 }
1827 } 1830 }
1828 if (start_task) { 1831 if (start_task) {
1829 Dart::thread_pool()->Run(isolate->background_compiler()); 1832 Dart::thread_pool()->Run(isolate->background_compiler());
1830 } 1833 }
1831 } 1834 }
1832 1835
1833 } // namespace dart 1836 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698