| 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/code_generator.h" | 5 #include "vm/code_generator.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
| 9 #include "vm/code_patcher.h" | 9 #include "vm/code_patcher.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 Function::Handle(cache_class.GetInvocationDispatcher( | 760 Function::Handle(cache_class.GetInvocationDispatcher( |
| 761 target_name, | 761 target_name, |
| 762 arguments_descriptor, | 762 arguments_descriptor, |
| 763 RawFunction::kInvokeFieldDispatcher, | 763 RawFunction::kInvokeFieldDispatcher, |
| 764 FLAG_lazy_dispatchers)); | 764 FLAG_lazy_dispatchers)); |
| 765 ASSERT(!target_function.IsNull() || !FLAG_lazy_dispatchers); | 765 ASSERT(!target_function.IsNull() || !FLAG_lazy_dispatchers); |
| 766 if (FLAG_trace_ic) { | 766 if (FLAG_trace_ic) { |
| 767 OS::PrintErr("InvokeField IC miss: adding <%s> id:%" Pd " -> <%s>\n", | 767 OS::PrintErr("InvokeField IC miss: adding <%s> id:%" Pd " -> <%s>\n", |
| 768 Class::Handle(receiver.clazz()).ToCString(), | 768 Class::Handle(receiver.clazz()).ToCString(), |
| 769 receiver.GetClassId(), | 769 receiver.GetClassId(), |
| 770 target_function.ToCString()); | 770 target_function.IsNull() ? "null" : target_function.ToCString()); |
| 771 } | 771 } |
| 772 *result = target_function.raw(); | 772 *result = target_function.raw(); |
| 773 return true; | 773 return true; |
| 774 } | 774 } |
| 775 | 775 |
| 776 | 776 |
| 777 // Handle other invocations (implicit closures, noSuchMethod). | 777 // Handle other invocations (implicit closures, noSuchMethod). |
| 778 RawFunction* InlineCacheMissHelper( | 778 RawFunction* InlineCacheMissHelper( |
| 779 const Instance& receiver, | 779 const Instance& receiver, |
| 780 const ICData& ic_data) { | 780 const ICData& ic_data) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 793 const Function& target_function = | 793 const Function& target_function = |
| 794 Function::Handle(receiver_class.GetInvocationDispatcher( | 794 Function::Handle(receiver_class.GetInvocationDispatcher( |
| 795 target_name, | 795 target_name, |
| 796 args_descriptor, | 796 args_descriptor, |
| 797 RawFunction::kNoSuchMethodDispatcher, | 797 RawFunction::kNoSuchMethodDispatcher, |
| 798 FLAG_lazy_dispatchers)); | 798 FLAG_lazy_dispatchers)); |
| 799 if (FLAG_trace_ic) { | 799 if (FLAG_trace_ic) { |
| 800 OS::PrintErr("NoSuchMethod IC miss: adding <%s> id:%" Pd " -> <%s>\n", | 800 OS::PrintErr("NoSuchMethod IC miss: adding <%s> id:%" Pd " -> <%s>\n", |
| 801 Class::Handle(receiver.clazz()).ToCString(), | 801 Class::Handle(receiver.clazz()).ToCString(), |
| 802 receiver.GetClassId(), | 802 receiver.GetClassId(), |
| 803 target_function.ToCString()); | 803 target_function.IsNull() ? "null" : target_function.ToCString()); |
| 804 } | 804 } |
| 805 result = target_function.raw(); | 805 result = target_function.raw(); |
| 806 } | 806 } |
| 807 // May be null if --no-lazy-dispatchers, in which case dispatch will be | 807 // May be null if --no-lazy-dispatchers, in which case dispatch will be |
| 808 // handled by InvokeNoSuchMethodDispatcher. | 808 // handled by InvokeNoSuchMethodDispatcher. |
| 809 ASSERT(!result.IsNull() || !FLAG_lazy_dispatchers); | 809 ASSERT(!result.IsNull() || !FLAG_lazy_dispatchers); |
| 810 return result.raw(); | 810 return result.raw(); |
| 811 } | 811 } |
| 812 | 812 |
| 813 static RawFunction* InlineCacheMissHandler( | 813 static RawFunction* InlineCacheMissHandler( |
| (...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1825 const intptr_t elm_size = old_data.ElementSizeInBytes(); | 1825 const intptr_t elm_size = old_data.ElementSizeInBytes(); |
| 1826 const TypedData& new_data = | 1826 const TypedData& new_data = |
| 1827 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); | 1827 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); |
| 1828 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); | 1828 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); |
| 1829 typed_data_cell.SetAt(0, new_data); | 1829 typed_data_cell.SetAt(0, new_data); |
| 1830 arguments.SetReturn(new_data); | 1830 arguments.SetReturn(new_data); |
| 1831 } | 1831 } |
| 1832 | 1832 |
| 1833 | 1833 |
| 1834 } // namespace dart | 1834 } // namespace dart |
| OLD | NEW |