| 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 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1602 // Range check. | 1602 // Range check. |
| 1603 __ cmpq(RCX, FieldAddress(RAX, String::length_offset())); | 1603 __ cmpq(RCX, FieldAddress(RAX, String::length_offset())); |
| 1604 // Runtime throws exception. | 1604 // Runtime throws exception. |
| 1605 __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump); | 1605 __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump); |
| 1606 __ CompareClassId(RAX, kOneByteStringCid); | 1606 __ CompareClassId(RAX, kOneByteStringCid); |
| 1607 __ j(NOT_EQUAL, &try_two_byte_string, Assembler::kNearJump); | 1607 __ j(NOT_EQUAL, &try_two_byte_string, Assembler::kNearJump); |
| 1608 __ SmiUntag(RCX); | 1608 __ SmiUntag(RCX); |
| 1609 __ movzxb(RCX, FieldAddress(RAX, RCX, TIMES_1, OneByteString::data_offset())); | 1609 __ movzxb(RCX, FieldAddress(RAX, RCX, TIMES_1, OneByteString::data_offset())); |
| 1610 __ cmpq(RCX, Immediate(Symbols::kNumberOfOneCharCodeSymbols)); | 1610 __ cmpq(RCX, Immediate(Symbols::kNumberOfOneCharCodeSymbols)); |
| 1611 __ j(GREATER_EQUAL, &fall_through); | 1611 __ j(GREATER_EQUAL, &fall_through); |
| 1612 __ movq(RAX, | 1612 const ExternalLabel symbols_label( |
| 1613 Immediate(reinterpret_cast<uword>(Symbols::PredefinedAddress()))); | 1613 reinterpret_cast<uword>(Symbols::PredefinedAddress())); |
| 1614 __ pushq(PP); |
| 1615 __ LoadPoolPointer(PP); |
| 1616 assembler->set_constant_pool_allowed(true); |
| 1617 __ LoadExternalLabel(RAX, &symbols_label, kNotPatchable, PP); |
| 1618 assembler->set_constant_pool_allowed(false); |
| 1619 __ popq(PP); |
| 1614 __ movq(RAX, Address(RAX, | 1620 __ movq(RAX, Address(RAX, |
| 1615 RCX, | 1621 RCX, |
| 1616 TIMES_8, | 1622 TIMES_8, |
| 1617 Symbols::kNullCharCodeSymbolOffset * kWordSize)); | 1623 Symbols::kNullCharCodeSymbolOffset * kWordSize)); |
| 1618 __ ret(); | 1624 __ ret(); |
| 1619 | 1625 |
| 1620 __ Bind(&try_two_byte_string); | 1626 __ Bind(&try_two_byte_string); |
| 1621 __ CompareClassId(RAX, kTwoByteStringCid); | 1627 __ CompareClassId(RAX, kTwoByteStringCid); |
| 1622 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); | 1628 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); |
| 1623 ASSERT(kSmiTagShift == 1); | 1629 ASSERT(kSmiTagShift == 1); |
| 1624 __ movzxw(RCX, FieldAddress(RAX, RCX, TIMES_1, OneByteString::data_offset())); | 1630 __ movzxw(RCX, FieldAddress(RAX, RCX, TIMES_1, OneByteString::data_offset())); |
| 1625 __ cmpq(RCX, Immediate(Symbols::kNumberOfOneCharCodeSymbols)); | 1631 __ cmpq(RCX, Immediate(Symbols::kNumberOfOneCharCodeSymbols)); |
| 1626 __ j(GREATER_EQUAL, &fall_through); | 1632 __ j(GREATER_EQUAL, &fall_through); |
| 1627 __ movq(RAX, | 1633 __ pushq(PP); |
| 1628 Immediate(reinterpret_cast<uword>(Symbols::PredefinedAddress()))); | 1634 __ LoadPoolPointer(PP); |
| 1635 assembler->set_constant_pool_allowed(true); |
| 1636 __ LoadExternalLabel(RAX, &symbols_label, kNotPatchable, PP); |
| 1637 assembler->set_constant_pool_allowed(false); |
| 1638 __ popq(PP); |
| 1629 __ movq(RAX, Address(RAX, | 1639 __ movq(RAX, Address(RAX, |
| 1630 RCX, | 1640 RCX, |
| 1631 TIMES_8, | 1641 TIMES_8, |
| 1632 Symbols::kNullCharCodeSymbolOffset * kWordSize)); | 1642 Symbols::kNullCharCodeSymbolOffset * kWordSize)); |
| 1633 __ ret(); | 1643 __ ret(); |
| 1634 | 1644 |
| 1635 __ Bind(&fall_through); | 1645 __ Bind(&fall_through); |
| 1636 } | 1646 } |
| 1637 | 1647 |
| 1638 | 1648 |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2003 __ LoadIsolate(RAX); | 2013 __ LoadIsolate(RAX); |
| 2004 __ movq(RAX, Address(RAX, Isolate::current_tag_offset())); | 2014 __ movq(RAX, Address(RAX, Isolate::current_tag_offset())); |
| 2005 __ ret(); | 2015 __ ret(); |
| 2006 } | 2016 } |
| 2007 | 2017 |
| 2008 #undef __ | 2018 #undef __ |
| 2009 | 2019 |
| 2010 } // namespace dart | 2020 } // namespace dart |
| 2011 | 2021 |
| 2012 #endif // defined TARGET_ARCH_X64 | 2022 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |