| 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 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2016 // Instantiate non-null type arguments. | 2016 // Instantiate non-null type arguments. |
| 2017 if (type_arguments().IsUninstantiatedIdentity()) { | 2017 if (type_arguments().IsUninstantiatedIdentity()) { |
| 2018 // TODO(regis): The following emitted code is duplicated in | 2018 // TODO(regis): The following emitted code is duplicated in |
| 2019 // VisitExtractConstructorTypeArguments above. The reason is that the code | 2019 // VisitExtractConstructorTypeArguments above. The reason is that the code |
| 2020 // is split between two computations, so that each one produces a | 2020 // is split between two computations, so that each one produces a |
| 2021 // single value, rather than producing a pair of values. | 2021 // single value, rather than producing a pair of values. |
| 2022 // If this becomes an issue, we should expose these tests at the IL level. | 2022 // If this becomes an issue, we should expose these tests at the IL level. |
| 2023 | 2023 |
| 2024 // Check if the instantiator type argument vector is a TypeArguments of a | 2024 // Check if the instantiator type argument vector is a TypeArguments of a |
| 2025 // matching length and, if so, use it as the instantiated type_arguments. | 2025 // matching length and, if so, use it as the instantiated type_arguments. |
| 2026 // No need to check the instantiator (RAX) for null here, because a null | 2026 // No need to check the instantiator for null here, because a null |
| 2027 // instantiator will have the wrong class (Null instead of TypeArguments). | 2027 // instantiator will have the wrong class (Null instead of TypeArguments). |
| 2028 __ CompareClassId(instantiator_reg, kTypeArgumentsCid, temp_reg); | 2028 __ CompareClassId(instantiator_reg, kTypeArgumentsCid, temp_reg); |
| 2029 __ j(NOT_EQUAL, &done, Assembler::kNearJump); | 2029 __ j(NOT_EQUAL, &done, Assembler::kNearJump); |
| 2030 const Immediate& arguments_length = | 2030 const Immediate& arguments_length = |
| 2031 Immediate(Smi::RawValue(type_arguments().Length())); | 2031 Immediate(Smi::RawValue(type_arguments().Length())); |
| 2032 __ cmpl(FieldAddress(instantiator_reg, TypeArguments::length_offset()), | 2032 __ cmpl(FieldAddress(instantiator_reg, TypeArguments::length_offset()), |
| 2033 arguments_length); | 2033 arguments_length); |
| 2034 __ j(NOT_EQUAL, &done, Assembler::kNearJump); | 2034 __ j(NOT_EQUAL, &done, Assembler::kNearJump); |
| 2035 // The instantiator was used in VisitExtractConstructorTypeArguments as the | 2035 // The instantiator was used in VisitExtractConstructorTypeArguments as the |
| 2036 // instantiated type arguments, no proper instantiator needed. | 2036 // instantiated type arguments, no proper instantiator needed. |
| (...skipping 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3971 PcDescriptors::kOther, | 3971 PcDescriptors::kOther, |
| 3972 locs()); | 3972 locs()); |
| 3973 __ Drop(2); // Discard type arguments and receiver. | 3973 __ Drop(2); // Discard type arguments and receiver. |
| 3974 } | 3974 } |
| 3975 | 3975 |
| 3976 } // namespace dart | 3976 } // namespace dart |
| 3977 | 3977 |
| 3978 #undef __ | 3978 #undef __ |
| 3979 | 3979 |
| 3980 #endif // defined TARGET_ARCH_IA32 | 3980 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |