| 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 "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1604 __ popl(value_cid_reg); | 1604 __ popl(value_cid_reg); |
| 1605 } else { | 1605 } else { |
| 1606 ASSERT(field_cid == kIllegalCid); | 1606 ASSERT(field_cid == kIllegalCid); |
| 1607 ASSERT(field_length == Field::kUnknownFixedLength); | 1607 ASSERT(field_length == Field::kUnknownFixedLength); |
| 1608 // At compile time we do not know the type of the field nor its | 1608 // At compile time we do not know the type of the field nor its |
| 1609 // length. At execution time we may have set the class id and | 1609 // length. At execution time we may have set the class id and |
| 1610 // list length so we compare the guarded length with the | 1610 // list length so we compare the guarded length with the |
| 1611 // list length here, without this check the list length could change | 1611 // list length here, without this check the list length could change |
| 1612 // without triggering a deoptimization. | 1612 // without triggering a deoptimization. |
| 1613 Label check_array, length_compared, no_fixed_length; | 1613 Label check_array, length_compared, no_fixed_length; |
| 1614 // If length is negative the length guard is either disabled or |
| 1615 // has not been initialized, either way it is safe to skip the |
| 1616 // length check. |
| 1617 __ cmpl(field_length_operand, Immediate(Smi::RawValue(0))); |
| 1618 __ j(LESS, &skip_length_check); |
| 1614 __ cmpl(value_cid_reg, Immediate(kNullCid)); | 1619 __ cmpl(value_cid_reg, Immediate(kNullCid)); |
| 1615 __ j(EQUAL, &no_fixed_length, Assembler::kNearJump); | 1620 __ j(EQUAL, &no_fixed_length, Assembler::kNearJump); |
| 1616 // Check for typed data array. | 1621 // Check for typed data array. |
| 1617 __ cmpl(value_cid_reg, Immediate(kTypedDataFloat32x4ArrayCid)); | 1622 __ cmpl(value_cid_reg, Immediate(kTypedDataFloat32x4ArrayCid)); |
| 1618 // Not a typed array or a regular array. | 1623 // Not a typed array or a regular array. |
| 1619 __ j(GREATER, &no_fixed_length, Assembler::kNearJump); | 1624 __ j(GREATER, &no_fixed_length, Assembler::kNearJump); |
| 1620 __ cmpl(value_cid_reg, Immediate(kTypedDataInt8ArrayCid)); | 1625 __ cmpl(value_cid_reg, Immediate(kTypedDataInt8ArrayCid)); |
| 1621 // Could still be a regular array. | 1626 // Could still be a regular array. |
| 1622 __ j(LESS, &check_array, Assembler::kNearJump); | 1627 __ j(LESS, &check_array, Assembler::kNearJump); |
| 1623 __ pushl(value_cid_reg); | 1628 __ pushl(value_cid_reg); |
| (...skipping 3598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5222 PcDescriptors::kOther, | 5227 PcDescriptors::kOther, |
| 5223 locs()); | 5228 locs()); |
| 5224 __ Drop(2); // Discard type arguments and receiver. | 5229 __ Drop(2); // Discard type arguments and receiver. |
| 5225 } | 5230 } |
| 5226 | 5231 |
| 5227 } // namespace dart | 5232 } // namespace dart |
| 5228 | 5233 |
| 5229 #undef __ | 5234 #undef __ |
| 5230 | 5235 |
| 5231 #endif // defined TARGET_ARCH_IA32 | 5236 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |