| 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/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/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
| 9 | 9 |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| (...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1429 } | 1429 } |
| 1430 | 1430 |
| 1431 | 1431 |
| 1432 static const char* kFixedSizeArrayIteratorClassName = "_FixedSizeArrayIterator"; | 1432 static const char* kFixedSizeArrayIteratorClassName = "_FixedSizeArrayIterator"; |
| 1433 | 1433 |
| 1434 // Class 'FixedSizeArrayIterator': | 1434 // Class 'FixedSizeArrayIterator': |
| 1435 // T next() { | 1435 // T next() { |
| 1436 // return _array[_pos++]; | 1436 // return _array[_pos++]; |
| 1437 // } | 1437 // } |
| 1438 // Intrinsify: return _array[_pos++]; | 1438 // Intrinsify: return _array[_pos++]; |
| 1439 // TODO(srdjan): Throw a 'NoMoreElementsException' exception if the iterator | 1439 // TODO(srdjan): Throw a 'StateError' exception if the iterator |
| 1440 // has no more elements. | 1440 // has no more elements. |
| 1441 bool Intrinsifier::FixedSizeArrayIterator_next(Assembler* assembler) { | 1441 bool Intrinsifier::FixedSizeArrayIterator_next(Assembler* assembler) { |
| 1442 Label fall_through; | 1442 Label fall_through; |
| 1443 const intptr_t array_offset = | 1443 const intptr_t array_offset = |
| 1444 GetOffsetForField(kFixedSizeArrayIteratorClassName, "_array"); | 1444 GetOffsetForField(kFixedSizeArrayIteratorClassName, "_array"); |
| 1445 const intptr_t pos_offset = | 1445 const intptr_t pos_offset = |
| 1446 GetOffsetForField(kFixedSizeArrayIteratorClassName, "_pos"); | 1446 GetOffsetForField(kFixedSizeArrayIteratorClassName, "_pos"); |
| 1447 ASSERT((array_offset >= 0) && (pos_offset >= 0)); | 1447 ASSERT((array_offset >= 0) && (pos_offset >= 0)); |
| 1448 // Receiver is not NULL. | 1448 // Receiver is not NULL. |
| 1449 __ movq(RAX, Address(RSP, + 1 * kWordSize)); // Receiver. | 1449 __ movq(RAX, Address(RSP, + 1 * kWordSize)); // Receiver. |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1567 __ LoadObject(RAX, bool_true); | 1567 __ LoadObject(RAX, bool_true); |
| 1568 __ ret(); | 1568 __ ret(); |
| 1569 return true; | 1569 return true; |
| 1570 } | 1570 } |
| 1571 | 1571 |
| 1572 #undef __ | 1572 #undef __ |
| 1573 | 1573 |
| 1574 } // namespace dart | 1574 } // namespace dart |
| 1575 | 1575 |
| 1576 #endif // defined TARGET_ARCH_X64 | 1576 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |