| 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/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
| 9 | 9 |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| (...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1775 | 1775 |
| 1776 // Arg0: OneByteString (receiver). | 1776 // Arg0: OneByteString (receiver). |
| 1777 // Arg1: Start index as Smi. | 1777 // Arg1: Start index as Smi. |
| 1778 // Arg2: End index as Smi. | 1778 // Arg2: End index as Smi. |
| 1779 // The indexes must be valid. | 1779 // The indexes must be valid. |
| 1780 void Intrinsifier::OneByteString_substringUnchecked(Assembler* assembler) { | 1780 void Intrinsifier::OneByteString_substringUnchecked(Assembler* assembler) { |
| 1781 const intptr_t kStringOffset = 3 * kWordSize; | 1781 const intptr_t kStringOffset = 3 * kWordSize; |
| 1782 const intptr_t kStartIndexOffset = 2 * kWordSize; | 1782 const intptr_t kStartIndexOffset = 2 * kWordSize; |
| 1783 const intptr_t kEndIndexOffset = 1 * kWordSize; | 1783 const intptr_t kEndIndexOffset = 1 * kWordSize; |
| 1784 Label fall_through, ok; | 1784 Label fall_through, ok; |
| 1785 __ movq(RSI, Address(RSP, + kEndIndexOffset)); | 1785 __ movq(RSI, Address(RSP, + kStartIndexOffset)); |
| 1786 __ movq(RDI, Address(RSP, + kEndIndexOffset)); | 1786 __ movq(RDI, Address(RSP, + kEndIndexOffset)); |
| 1787 __ orq(RSI, RDI); | 1787 __ orq(RSI, RDI); |
| 1788 __ testq(RSI, Immediate(kSmiTagMask)); | 1788 __ testq(RSI, Immediate(kSmiTagMask)); |
| 1789 __ j(NOT_ZERO, &fall_through); // 'start', 'end' not Smi. | 1789 __ j(NOT_ZERO, &fall_through); // 'start', 'end' not Smi. |
| 1790 | 1790 |
| 1791 __ subq(RDI, Address(RSP, + kStartIndexOffset)); | 1791 __ subq(RDI, Address(RSP, + kStartIndexOffset)); |
| 1792 TryAllocateOnebyteString(assembler, &ok, &fall_through, RDI); | 1792 TryAllocateOnebyteString(assembler, &ok, &fall_through, RDI); |
| 1793 __ Bind(&ok); | 1793 __ Bind(&ok); |
| 1794 // RAX: new string as tagged pointer. | 1794 // RAX: new string as tagged pointer. |
| 1795 // Copy string. | 1795 // Copy string. |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1988 // Set return value to Isolate::current_tag_. | 1988 // Set return value to Isolate::current_tag_. |
| 1989 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); | 1989 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); |
| 1990 __ ret(); | 1990 __ ret(); |
| 1991 } | 1991 } |
| 1992 | 1992 |
| 1993 #undef __ | 1993 #undef __ |
| 1994 | 1994 |
| 1995 } // namespace dart | 1995 } // namespace dart |
| 1996 | 1996 |
| 1997 #endif // defined TARGET_ARCH_X64 | 1997 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |