| 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 bool code_is_valid = true; | 482 bool code_is_valid = true; |
| 483 if (!thread()->cha()->leaf_classes().is_empty()) { | 483 if (!thread()->cha()->leaf_classes().is_empty()) { |
| 484 if (cha_invalidation_gen_at_start() != | 484 if (cha_invalidation_gen_at_start() != |
| 485 isolate()->cha_invalidation_gen()) { | 485 isolate()->cha_invalidation_gen()) { |
| 486 code_is_valid = false; | 486 code_is_valid = false; |
| 487 if (trace_compiler) { | 487 if (trace_compiler) { |
| 488 THR_Print("--> FAIL: CHA invalidation."); | 488 THR_Print("--> FAIL: CHA invalidation."); |
| 489 } | 489 } |
| 490 } | 490 } |
| 491 } | 491 } |
| 492 if (!flow_graph->guarded_fields()->is_empty()) { | 492 if (!flow_graph->parsed_function().guarded_fields()->is_empty()) { |
| 493 if (field_invalidation_gen_at_start() != | 493 if (field_invalidation_gen_at_start() != |
| 494 isolate()->field_invalidation_gen()) { | 494 isolate()->field_invalidation_gen()) { |
| 495 code_is_valid = false; | 495 code_is_valid = false; |
| 496 if (trace_compiler) { | 496 if (trace_compiler) { |
| 497 THR_Print("--> FAIL: Field invalidation."); | 497 THR_Print("--> FAIL: Field invalidation."); |
| 498 } | 498 } |
| 499 } | 499 } |
| 500 } | 500 } |
| 501 if (parsed_function()->HasDeferredPrefixes()) { | 501 if (parsed_function()->HasDeferredPrefixes()) { |
| 502 if (prefix_invalidation_gen_at_start() != | 502 if (prefix_invalidation_gen_at_start() != |
| (...skipping 16 matching lines...) Expand all Loading... |
| 519 } | 519 } |
| 520 | 520 |
| 521 // Register code with the classes it depends on because of CHA and | 521 // Register code with the classes it depends on because of CHA and |
| 522 // fields it depends on because of store guards, unless we cannot | 522 // fields it depends on because of store guards, unless we cannot |
| 523 // deopt. | 523 // deopt. |
| 524 for (intptr_t i = 0; | 524 for (intptr_t i = 0; |
| 525 i < thread()->cha()->leaf_classes().length(); | 525 i < thread()->cha()->leaf_classes().length(); |
| 526 ++i) { | 526 ++i) { |
| 527 thread()->cha()->leaf_classes()[i]->RegisterCHACode(code); | 527 thread()->cha()->leaf_classes()[i]->RegisterCHACode(code); |
| 528 } | 528 } |
| 529 for (intptr_t i = 0; | 529 const ZoneGrowableArray<const Field*>& guarded_fields = |
| 530 i < flow_graph->guarded_fields()->length(); | 530 *flow_graph->parsed_function().guarded_fields(); |
| 531 i++) { | 531 for (intptr_t i = 0; i < guarded_fields.length(); i++) { |
| 532 const Field* field = (*flow_graph->guarded_fields())[i]; | 532 const Field* field = guarded_fields[i]; |
| 533 field->RegisterDependentCode(code); | 533 field->RegisterDependentCode(code); |
| 534 } | 534 } |
| 535 } else { // not optimized. | 535 } else { // not optimized. |
| 536 if (function.ic_data_array() == Array::null()) { | 536 if (function.ic_data_array() == Array::null()) { |
| 537 function.SaveICDataMap( | 537 function.SaveICDataMap( |
| 538 graph_compiler->deopt_id_to_ic_data(), | 538 graph_compiler->deopt_id_to_ic_data(), |
| 539 Array::Handle(zone, graph_compiler->edge_counters_array())); | 539 Array::Handle(zone, graph_compiler->edge_counters_array())); |
| 540 } | 540 } |
| 541 function.set_unoptimized_code(code); | 541 function.set_unoptimized_code(code); |
| 542 function.AttachCode(code); | 542 function.AttachCode(code); |
| (...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1892 } | 1892 } |
| 1893 | 1893 |
| 1894 | 1894 |
| 1895 void BackgroundCompiler::EnsureInit(Thread* thread) { | 1895 void BackgroundCompiler::EnsureInit(Thread* thread) { |
| 1896 UNREACHABLE(); | 1896 UNREACHABLE(); |
| 1897 } | 1897 } |
| 1898 | 1898 |
| 1899 #endif // DART_PRECOMPILED_RUNTIME | 1899 #endif // DART_PRECOMPILED_RUNTIME |
| 1900 | 1900 |
| 1901 } // namespace dart | 1901 } // namespace dart |
| OLD | NEW |