| 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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1868 } | 1868 } |
| 1869 | 1869 |
| 1870 | 1870 |
| 1871 void InstantiateTypeArgumentsInstr::EmitNativeCode( | 1871 void InstantiateTypeArgumentsInstr::EmitNativeCode( |
| 1872 FlowGraphCompiler* compiler) { | 1872 FlowGraphCompiler* compiler) { |
| 1873 Register instantiator_reg = locs()->in(0).reg(); | 1873 Register instantiator_reg = locs()->in(0).reg(); |
| 1874 Register result_reg = locs()->out().reg(); | 1874 Register result_reg = locs()->out().reg(); |
| 1875 | 1875 |
| 1876 // 'instantiator_reg' is the instantiator AbstractTypeArguments object | 1876 // 'instantiator_reg' is the instantiator AbstractTypeArguments object |
| 1877 // (or null). | 1877 // (or null). |
| 1878 if (!type_arguments().IsUninstantiatedIdentity()) { | 1878 if (!type_arguments().IsUninstantiatedIdentity() && |
| 1879 !type_arguments().CanShareInstantiatorTypeArguments( |
| 1880 instantiator_class())) { |
| 1879 // If the instantiator is null and if the type argument vector | 1881 // If the instantiator is null and if the type argument vector |
| 1880 // instantiated from null becomes a vector of dynamic, then use null as | 1882 // instantiated from null becomes a vector of dynamic, then use null as |
| 1881 // the type arguments. | 1883 // the type arguments. |
| 1882 Label type_arguments_instantiated; | 1884 Label type_arguments_instantiated; |
| 1883 const intptr_t len = type_arguments().Length(); | 1885 const intptr_t len = type_arguments().Length(); |
| 1884 if (type_arguments().IsRawInstantiatedRaw(len)) { | 1886 if (type_arguments().IsRawInstantiatedRaw(len)) { |
| 1885 const Immediate& raw_null = | 1887 const Immediate& raw_null = |
| 1886 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 1888 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 1887 __ cmpl(instantiator_reg, raw_null); | 1889 __ cmpl(instantiator_reg, raw_null); |
| 1888 __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump); | 1890 __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1918 | 1920 |
| 1919 | 1921 |
| 1920 void ExtractConstructorTypeArgumentsInstr::EmitNativeCode( | 1922 void ExtractConstructorTypeArgumentsInstr::EmitNativeCode( |
| 1921 FlowGraphCompiler* compiler) { | 1923 FlowGraphCompiler* compiler) { |
| 1922 Register instantiator_reg = locs()->in(0).reg(); | 1924 Register instantiator_reg = locs()->in(0).reg(); |
| 1923 Register result_reg = locs()->out().reg(); | 1925 Register result_reg = locs()->out().reg(); |
| 1924 ASSERT(instantiator_reg == result_reg); | 1926 ASSERT(instantiator_reg == result_reg); |
| 1925 | 1927 |
| 1926 // instantiator_reg is the instantiator type argument vector, i.e. an | 1928 // instantiator_reg is the instantiator type argument vector, i.e. an |
| 1927 // AbstractTypeArguments object (or null). | 1929 // AbstractTypeArguments object (or null). |
| 1928 if (!type_arguments().IsUninstantiatedIdentity()) { | 1930 if (!type_arguments().IsUninstantiatedIdentity() && |
| 1931 !type_arguments().CanShareInstantiatorTypeArguments( |
| 1932 instantiator_class())) { |
| 1929 // If the instantiator is null and if the type argument vector | 1933 // If the instantiator is null and if the type argument vector |
| 1930 // instantiated from null becomes a vector of dynamic, then use null as | 1934 // instantiated from null becomes a vector of dynamic, then use null as |
| 1931 // the type arguments. | 1935 // the type arguments. |
| 1932 Label type_arguments_instantiated; | 1936 Label type_arguments_instantiated; |
| 1933 const intptr_t len = type_arguments().Length(); | 1937 const intptr_t len = type_arguments().Length(); |
| 1934 if (type_arguments().IsRawInstantiatedRaw(len)) { | 1938 if (type_arguments().IsRawInstantiatedRaw(len)) { |
| 1935 const Immediate& raw_null = | 1939 const Immediate& raw_null = |
| 1936 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 1940 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 1937 __ cmpl(instantiator_reg, raw_null); | 1941 __ cmpl(instantiator_reg, raw_null); |
| 1938 __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump); | 1942 __ j(EQUAL, &type_arguments_instantiated, Assembler::kNearJump); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1961 } | 1965 } |
| 1962 | 1966 |
| 1963 | 1967 |
| 1964 void ExtractConstructorInstantiatorInstr::EmitNativeCode( | 1968 void ExtractConstructorInstantiatorInstr::EmitNativeCode( |
| 1965 FlowGraphCompiler* compiler) { | 1969 FlowGraphCompiler* compiler) { |
| 1966 Register instantiator_reg = locs()->in(0).reg(); | 1970 Register instantiator_reg = locs()->in(0).reg(); |
| 1967 ASSERT(locs()->out().reg() == instantiator_reg); | 1971 ASSERT(locs()->out().reg() == instantiator_reg); |
| 1968 | 1972 |
| 1969 // instantiator_reg is the instantiator AbstractTypeArguments object | 1973 // instantiator_reg is the instantiator AbstractTypeArguments object |
| 1970 // (or null). | 1974 // (or null). |
| 1971 if (type_arguments().IsUninstantiatedIdentity()) { | 1975 if (type_arguments().IsUninstantiatedIdentity() || |
| 1976 type_arguments().CanShareInstantiatorTypeArguments( |
| 1977 instantiator_class())) { |
| 1972 // The instantiator was used in VisitExtractConstructorTypeArguments as the | 1978 // The instantiator was used in VisitExtractConstructorTypeArguments as the |
| 1973 // instantiated type arguments, no proper instantiator needed. | 1979 // instantiated type arguments, no proper instantiator needed. |
| 1974 __ movl(instantiator_reg, | 1980 __ movl(instantiator_reg, |
| 1975 Immediate(Smi::RawValue(StubCode::kNoInstantiator))); | 1981 Immediate(Smi::RawValue(StubCode::kNoInstantiator))); |
| 1976 } else { | 1982 } else { |
| 1977 // If the instantiator is null and if the type argument vector | 1983 // If the instantiator is null and if the type argument vector |
| 1978 // instantiated from null becomes a vector of dynamic, then use null as | 1984 // instantiated from null becomes a vector of dynamic, then use null as |
| 1979 // the type arguments and do not pass the instantiator. | 1985 // the type arguments and do not pass the instantiator. |
| 1980 const intptr_t len = type_arguments().Length(); | 1986 const intptr_t len = type_arguments().Length(); |
| 1981 if (type_arguments().IsRawInstantiatedRaw(len)) { | 1987 if (type_arguments().IsRawInstantiatedRaw(len)) { |
| (...skipping 2198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4180 PcDescriptors::kOther, | 4186 PcDescriptors::kOther, |
| 4181 locs()); | 4187 locs()); |
| 4182 __ Drop(2); // Discard type arguments and receiver. | 4188 __ Drop(2); // Discard type arguments and receiver. |
| 4183 } | 4189 } |
| 4184 | 4190 |
| 4185 } // namespace dart | 4191 } // namespace dart |
| 4186 | 4192 |
| 4187 #undef __ | 4193 #undef __ |
| 4188 | 4194 |
| 4189 #endif // defined TARGET_ARCH_IA32 | 4195 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |