| Index: runtime/vm/intrinsifier_ia32.cc
|
| ===================================================================
|
| --- runtime/vm/intrinsifier_ia32.cc (revision 1406)
|
| +++ runtime/vm/intrinsifier_ia32.cc (working copy)
|
| @@ -78,6 +78,7 @@
|
| V(StringBase, get:length, String_getLength) \
|
| V(StringBase, charCodeAt, String_charCodeAt) \
|
| V(StringBase, hashCode, String_hashCode) \
|
| + V(StringBase, isEmpty, String_isEmpty) \
|
|
|
| #define __ assembler->
|
|
|
| @@ -945,6 +946,24 @@
|
| return false;
|
| }
|
|
|
| +
|
| +static bool String_isEmpty(Assembler* assembler) {
|
| + Label is_true;
|
| + const Bool& bool_true = Bool::ZoneHandle(Bool::True());
|
| + const Bool& bool_false = Bool::ZoneHandle(Bool::False());
|
| + // Get length.
|
| + __ movl(EAX, Address(ESP, + 1 * kWordSize)); // String object.
|
| + __ movl(EAX, FieldAddress(EAX, String::length_offset()));
|
| + __ cmpl(EAX, Immediate(Smi::RawValue(0)));
|
| + __ j(EQUAL, &is_true, Assembler::kNearJump);
|
| + __ LoadObject(EAX, bool_false);
|
| + __ ret();
|
| + __ Bind(&is_true);
|
| + __ LoadObject(EAX, bool_true);
|
| + __ ret();
|
| + return true;
|
| +}
|
| +
|
| #undef __
|
|
|
|
|
|
|