OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/globals.h" // Needed here to get TARGET_ARCH_XXX. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. |
6 | 6 |
7 #include "vm/flow_graph_compiler.h" | 7 #include "vm/flow_graph_compiler.h" |
8 | 8 |
9 #include "vm/bit_vector.h" | 9 #include "vm/bit_vector.h" |
10 #include "vm/cha.h" | 10 #include "vm/cha.h" |
(...skipping 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1760 CallTargets* targets = new (zone) CallTargets(zone); | 1760 CallTargets* targets = new (zone) CallTargets(zone); |
1761 targets->Add(new (zone) TargetInfo(cid, cid, &fn, /* count = */ 1)); | 1761 targets->Add(new (zone) TargetInfo(cid, cid, &fn, /* count = */ 1)); |
1762 | 1762 |
1763 return targets; | 1763 return targets; |
1764 } | 1764 } |
1765 | 1765 |
1766 | 1766 |
1767 bool FlowGraphCompiler::LookupMethodFor(int class_id, | 1767 bool FlowGraphCompiler::LookupMethodFor(int class_id, |
1768 const String& name, | 1768 const String& name, |
1769 const ArgumentsDescriptor& args_desc, | 1769 const ArgumentsDescriptor& args_desc, |
1770 Function* fn_return) { | 1770 Function* fn_return, |
| 1771 bool* class_is_abstract_return) { |
1771 Thread* thread = Thread::Current(); | 1772 Thread* thread = Thread::Current(); |
1772 Isolate* isolate = thread->isolate(); | 1773 Isolate* isolate = thread->isolate(); |
1773 Zone* zone = thread->zone(); | 1774 Zone* zone = thread->zone(); |
1774 if (class_id < 0) return false; | 1775 if (class_id < 0) return false; |
1775 if (class_id >= isolate->class_table()->NumCids()) return false; | 1776 if (class_id >= isolate->class_table()->NumCids()) return false; |
1776 | 1777 |
1777 RawClass* raw_class = isolate->class_table()->At(class_id); | 1778 RawClass* raw_class = isolate->class_table()->At(class_id); |
1778 if (raw_class == NULL) return false; | 1779 if (raw_class == NULL) return false; |
1779 Class& cls = Class::Handle(zone, raw_class); | 1780 Class& cls = Class::Handle(zone, raw_class); |
1780 if (cls.IsNull()) return false; | 1781 if (cls.IsNull()) return false; |
1781 if (!cls.is_finalized()) return false; | 1782 if (!cls.is_finalized()) return false; |
1782 if (Array::Handle(cls.functions()).IsNull()) return false; | 1783 if (Array::Handle(cls.functions()).IsNull()) return false; |
1783 | 1784 |
| 1785 if (class_is_abstract_return != NULL) { |
| 1786 *class_is_abstract_return = cls.is_abstract(); |
| 1787 } |
1784 const bool allow_add = false; | 1788 const bool allow_add = false; |
1785 Function& target_function = | 1789 Function& target_function = |
1786 Function::Handle(zone, Resolver::ResolveDynamicForReceiverClass( | 1790 Function::Handle(zone, Resolver::ResolveDynamicForReceiverClass( |
1787 cls, name, args_desc, allow_add)); | 1791 cls, name, args_desc, allow_add)); |
1788 if (target_function.IsNull()) return false; | 1792 if (target_function.IsNull()) return false; |
1789 *fn_return ^= target_function.raw(); | 1793 *fn_return ^= target_function.raw(); |
1790 return true; | 1794 return true; |
1791 } | 1795 } |
1792 | 1796 |
1793 | 1797 |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2018 | 2022 |
2019 | 2023 |
2020 void FlowGraphCompiler::FrameStateClear() { | 2024 void FlowGraphCompiler::FrameStateClear() { |
2021 ASSERT(!is_optimizing()); | 2025 ASSERT(!is_optimizing()); |
2022 frame_state_.TruncateTo(0); | 2026 frame_state_.TruncateTo(0); |
2023 } | 2027 } |
2024 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) | 2028 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) |
2025 | 2029 |
2026 | 2030 |
2027 } // namespace dart | 2031 } // namespace dart |
OLD | NEW |