OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/precompiler.h" | 5 #include "vm/precompiler.h" |
6 | 6 |
7 #include "vm/aot_optimizer.h" | 7 #include "vm/aot_optimizer.h" |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
10 #include "vm/branch_optimizer.h" | 10 #include "vm/branch_optimizer.h" |
(...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1714 Function& target_; | 1714 Function& target_; |
1715 Code& target_code_; | 1715 Code& target_code_; |
1716 }; | 1716 }; |
1717 | 1717 |
1718 BindStaticCallsVisitor visitor(Z); | 1718 BindStaticCallsVisitor visitor(Z); |
1719 VisitFunctions(&visitor); | 1719 VisitFunctions(&visitor); |
1720 } | 1720 } |
1721 | 1721 |
1722 | 1722 |
1723 void Precompiler::SwitchICCalls() { | 1723 void Precompiler::SwitchICCalls() { |
| 1724 #if !defined(TARGET_ARCH_DBC) |
1724 // Now that all functions have been compiled, we can switch to an instance | 1725 // Now that all functions have been compiled, we can switch to an instance |
1725 // call sequence that loads the Code object and entry point directly from | 1726 // call sequence that loads the Code object and entry point directly from |
1726 // the ic data array instead indirectly through a Function in the ic data | 1727 // the ic data array instead indirectly through a Function in the ic data |
1727 // array. Iterate all the object pools and rewrite the ic data from | 1728 // array. Iterate all the object pools and rewrite the ic data from |
1728 // (cid, target function, count) to (cid, target code, entry point), and | 1729 // (cid, target function, count) to (cid, target code, entry point), and |
1729 // replace the ICLookupThroughFunction stub with ICLookupThroughCode. | 1730 // replace the ICLookupThroughFunction stub with ICLookupThroughCode. |
1730 | 1731 |
1731 class SwitchICCallsVisitor : public FunctionVisitor { | 1732 class SwitchICCallsVisitor : public FunctionVisitor { |
1732 public: | 1733 public: |
1733 explicit SwitchICCallsVisitor(Zone* zone) : | 1734 explicit SwitchICCallsVisitor(Zone* zone) : |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1787 Object& entry_; | 1788 Object& entry_; |
1788 ICData& ic_; | 1789 ICData& ic_; |
1789 Function& target_; | 1790 Function& target_; |
1790 Code& target_code_; | 1791 Code& target_code_; |
1791 Smi& entry_point_; | 1792 Smi& entry_point_; |
1792 }; | 1793 }; |
1793 | 1794 |
1794 ASSERT(!I->compilation_allowed()); | 1795 ASSERT(!I->compilation_allowed()); |
1795 SwitchICCallsVisitor visitor(Z); | 1796 SwitchICCallsVisitor visitor(Z); |
1796 VisitFunctions(&visitor); | 1797 VisitFunctions(&visitor); |
| 1798 #endif |
1797 } | 1799 } |
1798 | 1800 |
1799 | 1801 |
1800 void Precompiler::DedupStackmaps() { | 1802 void Precompiler::DedupStackmaps() { |
1801 class DedupStackmapsVisitor : public FunctionVisitor { | 1803 class DedupStackmapsVisitor : public FunctionVisitor { |
1802 public: | 1804 public: |
1803 explicit DedupStackmapsVisitor(Zone* zone) : | 1805 explicit DedupStackmapsVisitor(Zone* zone) : |
1804 zone_(zone), | 1806 zone_(zone), |
1805 canonical_stackmaps_(), | 1807 canonical_stackmaps_(), |
1806 code_(Code::Handle(zone)), | 1808 code_(Code::Handle(zone)), |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2736 CompilationPipeline::New(thread->zone(), function); | 2738 CompilationPipeline::New(thread->zone(), function); |
2737 | 2739 |
2738 ASSERT(FLAG_precompiled_mode); | 2740 ASSERT(FLAG_precompiled_mode); |
2739 const bool optimized = function.IsOptimizable(); // False for natives. | 2741 const bool optimized = function.IsOptimizable(); // False for natives. |
2740 return PrecompileFunctionHelper(pipeline, function, optimized); | 2742 return PrecompileFunctionHelper(pipeline, function, optimized); |
2741 } | 2743 } |
2742 | 2744 |
2743 #endif // DART_PRECOMPILER | 2745 #endif // DART_PRECOMPILER |
2744 | 2746 |
2745 } // namespace dart | 2747 } // namespace dart |
OLD | NEW |