| 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 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 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1981 // Instantiate non-null type arguments. | 1981 // Instantiate non-null type arguments. |
| 1982 if (type_arguments().IsUninstantiatedIdentity()) { | 1982 if (type_arguments().IsUninstantiatedIdentity()) { |
| 1983 // TODO(regis): The following emitted code is duplicated in | 1983 // TODO(regis): The following emitted code is duplicated in |
| 1984 // VisitExtractConstructorTypeArguments above. The reason is that the code | 1984 // VisitExtractConstructorTypeArguments above. The reason is that the code |
| 1985 // is split between two computations, so that each one produces a | 1985 // is split between two computations, so that each one produces a |
| 1986 // single value, rather than producing a pair of values. | 1986 // single value, rather than producing a pair of values. |
| 1987 // If this becomes an issue, we should expose these tests at the IL level. | 1987 // If this becomes an issue, we should expose these tests at the IL level. |
| 1988 | 1988 |
| 1989 // Check if the instantiator type argument vector is a TypeArguments of a | 1989 // Check if the instantiator type argument vector is a TypeArguments of a |
| 1990 // matching length and, if so, use it as the instantiated type_arguments. | 1990 // matching length and, if so, use it as the instantiated type_arguments. |
| 1991 // No need to check the instantiator (RAX) for null here, because a null | 1991 // No need to check the instantiator ('instantiator_reg') for null here, |
| 1992 // instantiator will have the wrong class (Null instead of TypeArguments). | 1992 // because a null instantiator will have the wrong class (Null instead of |
| 1993 // TypeArguments). |
| 1993 __ CompareClassId(instantiator_reg, kTypeArgumentsCid); | 1994 __ CompareClassId(instantiator_reg, kTypeArgumentsCid); |
| 1994 __ j(NOT_EQUAL, &done, Assembler::kNearJump); | 1995 __ j(NOT_EQUAL, &done, Assembler::kNearJump); |
| 1995 const Immediate& arguments_length = | 1996 const Immediate& arguments_length = |
| 1996 Immediate(Smi::RawValue(type_arguments().Length())); | 1997 Immediate(Smi::RawValue(type_arguments().Length())); |
| 1997 __ cmpq(FieldAddress(instantiator_reg, TypeArguments::length_offset()), | 1998 __ cmpq(FieldAddress(instantiator_reg, TypeArguments::length_offset()), |
| 1998 arguments_length); | 1999 arguments_length); |
| 1999 __ j(NOT_EQUAL, &done, Assembler::kNearJump); | 2000 __ j(NOT_EQUAL, &done, Assembler::kNearJump); |
| 2000 // The instantiator was used in VisitExtractConstructorTypeArguments as the | 2001 // The instantiator was used in VisitExtractConstructorTypeArguments as the |
| 2001 // instantiated type arguments, no proper instantiator needed. | 2002 // instantiated type arguments, no proper instantiator needed. |
| 2002 __ movq(instantiator_reg, | 2003 __ movq(instantiator_reg, |
| (...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3608 PcDescriptors::kOther, | 3609 PcDescriptors::kOther, |
| 3609 locs()); | 3610 locs()); |
| 3610 __ Drop(2); // Discard type arguments and receiver. | 3611 __ Drop(2); // Discard type arguments and receiver. |
| 3611 } | 3612 } |
| 3612 | 3613 |
| 3613 } // namespace dart | 3614 } // namespace dart |
| 3614 | 3615 |
| 3615 #undef __ | 3616 #undef __ |
| 3616 | 3617 |
| 3617 #endif // defined TARGET_ARCH_X64 | 3618 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |