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 // The intrinsic code below is executed before a method has built its frame. | 5 // The intrinsic code below is executed before a method has built its frame. |
6 // The return address is on the stack and the arguments below it. | 6 // The return address is on the stack and the arguments below it. |
7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. | 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. |
8 // Each intrinsification method returns true if the corresponding | 8 // Each intrinsification method returns true if the corresponding |
9 // Dart method was intrinsified. | 9 // Dart method was intrinsified. |
10 | 10 |
(...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1642 __ j(NOT_EQUAL, &fall_through); | 1642 __ j(NOT_EQUAL, &fall_through); |
1643 __ SmiUntag(EBX); | 1643 __ SmiUntag(EBX); |
1644 __ movzxb(EAX, FieldAddress(EAX, EBX, TIMES_1, OneByteString::data_offset())); | 1644 __ movzxb(EAX, FieldAddress(EAX, EBX, TIMES_1, OneByteString::data_offset())); |
1645 __ SmiTag(EAX); | 1645 __ SmiTag(EAX); |
1646 __ ret(); | 1646 __ ret(); |
1647 __ Bind(&fall_through); | 1647 __ Bind(&fall_through); |
1648 return false; | 1648 return false; |
1649 } | 1649 } |
1650 | 1650 |
1651 | 1651 |
1652 bool Intrinsifier::String_isEmpty(Assembler* assembler) { | 1652 bool Intrinsifier::String_getIsEmpty(Assembler* assembler) { |
1653 Label is_true; | 1653 Label is_true; |
1654 const Bool& bool_true = Bool::ZoneHandle(Bool::True()); | 1654 const Bool& bool_true = Bool::ZoneHandle(Bool::True()); |
1655 const Bool& bool_false = Bool::ZoneHandle(Bool::False()); | 1655 const Bool& bool_false = Bool::ZoneHandle(Bool::False()); |
1656 // Get length. | 1656 // Get length. |
1657 __ movl(EAX, Address(ESP, + 1 * kWordSize)); // String object. | 1657 __ movl(EAX, Address(ESP, + 1 * kWordSize)); // String object. |
1658 __ movl(EAX, FieldAddress(EAX, String::length_offset())); | 1658 __ movl(EAX, FieldAddress(EAX, String::length_offset())); |
1659 __ cmpl(EAX, Immediate(Smi::RawValue(0))); | 1659 __ cmpl(EAX, Immediate(Smi::RawValue(0))); |
1660 __ j(EQUAL, &is_true, Assembler::kNearJump); | 1660 __ j(EQUAL, &is_true, Assembler::kNearJump); |
1661 __ LoadObject(EAX, bool_false); | 1661 __ LoadObject(EAX, bool_false); |
1662 __ ret(); | 1662 __ ret(); |
1663 __ Bind(&is_true); | 1663 __ Bind(&is_true); |
1664 __ LoadObject(EAX, bool_true); | 1664 __ LoadObject(EAX, bool_true); |
1665 __ ret(); | 1665 __ ret(); |
1666 return true; | 1666 return true; |
1667 } | 1667 } |
1668 | 1668 |
1669 #undef __ | 1669 #undef __ |
1670 } // namespace dart | 1670 } // namespace dart |
1671 | 1671 |
1672 #endif // defined TARGET_ARCH_IA32 | 1672 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |