| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
| 9 #include "vm/flow_graph_allocator.h" | 9 #include "vm/flow_graph_allocator.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1864 | 1864 |
| 1865 void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1865 void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1866 ICData& call_ic_data = ICData::ZoneHandle(ic_data()->raw()); | 1866 ICData& call_ic_data = ICData::ZoneHandle(ic_data()->raw()); |
| 1867 if (!FLAG_propagate_ic_data || !compiler->is_optimizing()) { | 1867 if (!FLAG_propagate_ic_data || !compiler->is_optimizing()) { |
| 1868 call_ic_data = ICData::New(compiler->parsed_function().function(), | 1868 call_ic_data = ICData::New(compiler->parsed_function().function(), |
| 1869 function_name(), | 1869 function_name(), |
| 1870 deopt_id(), | 1870 deopt_id(), |
| 1871 checked_argument_count()); | 1871 checked_argument_count()); |
| 1872 } | 1872 } |
| 1873 if (compiler->is_optimizing()) { | 1873 if (compiler->is_optimizing()) { |
| 1874 if (HasICData() && (ic_data()->NumberOfChecks() > 0)) { | 1874 ASSERT(HasICData()); |
| 1875 if (ic_data()->NumberOfChecks() > 0) { |
| 1875 const ICData& unary_ic_data = | 1876 const ICData& unary_ic_data = |
| 1876 ICData::ZoneHandle(ic_data()->AsUnaryClassChecks()); | 1877 ICData::ZoneHandle(ic_data()->AsUnaryClassChecks()); |
| 1877 compiler->GenerateInstanceCall(deopt_id(), | 1878 compiler->GenerateInstanceCall(deopt_id(), |
| 1878 token_pos(), | 1879 token_pos(), |
| 1879 ArgumentCount(), | 1880 ArgumentCount(), |
| 1880 argument_names(), | 1881 argument_names(), |
| 1881 locs(), | 1882 locs(), |
| 1882 unary_ic_data); | 1883 unary_ic_data); |
| 1883 } else { | 1884 } else { |
| 1884 Label* deopt = | 1885 // Call was not visited yet, use original ICData in order to populate it. |
| 1885 compiler->AddDeoptStub(deopt_id(), kDeoptInstanceCallNoICData); | 1886 compiler->GenerateInstanceCall(deopt_id(), |
| 1886 __ jmp(deopt); | 1887 token_pos(), |
| 1888 ArgumentCount(), |
| 1889 argument_names(), |
| 1890 locs(), |
| 1891 call_ic_data); |
| 1887 } | 1892 } |
| 1888 } else { | 1893 } else { |
| 1894 // Unoptimized code. |
| 1889 ASSERT(!HasICData()); | 1895 ASSERT(!HasICData()); |
| 1890 compiler->AddCurrentDescriptor(PcDescriptors::kDeoptBefore, | 1896 compiler->AddCurrentDescriptor(PcDescriptors::kDeoptBefore, |
| 1891 deopt_id(), | 1897 deopt_id(), |
| 1892 token_pos()); | 1898 token_pos()); |
| 1893 compiler->GenerateInstanceCall(deopt_id(), | 1899 compiler->GenerateInstanceCall(deopt_id(), |
| 1894 token_pos(), | 1900 token_pos(), |
| 1895 ArgumentCount(), | 1901 ArgumentCount(), |
| 1896 argument_names(), | 1902 argument_names(), |
| 1897 locs(), | 1903 locs(), |
| 1898 call_ic_data); | 1904 call_ic_data); |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2644 return Array::length_offset(); | 2650 return Array::length_offset(); |
| 2645 default: | 2651 default: |
| 2646 UNREACHABLE(); | 2652 UNREACHABLE(); |
| 2647 return -1; | 2653 return -1; |
| 2648 } | 2654 } |
| 2649 } | 2655 } |
| 2650 | 2656 |
| 2651 #undef __ | 2657 #undef __ |
| 2652 | 2658 |
| 2653 } // namespace dart | 2659 } // namespace dart |
| OLD | NEW |