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