| Index: runtime/vm/intrinsifier_x64.cc
|
| diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
|
| index 5f3f96d8e5b114a0b0cf5ff58e4b5a6e36ffdc75..52d2fe929a599c407610cbe9b0f14e05f86cbd3d 100644
|
| --- a/runtime/vm/intrinsifier_x64.cc
|
| +++ b/runtime/vm/intrinsifier_x64.cc
|
| @@ -1405,100 +1405,6 @@ bool Intrinsifier::Object_equal(Assembler* assembler) {
|
| }
|
|
|
|
|
| -static intptr_t GetOffsetForField(const char* class_name_p,
|
| - const char* field_name_p) {
|
| - const String& class_name = String::Handle(Symbols::New(class_name_p));
|
| - const String& field_name = String::Handle(Symbols::New(field_name_p));
|
| - const Library& core_lib = Library::Handle(Library::CoreLibrary());
|
| - const Class& cls =
|
| - Class::Handle(core_lib.LookupClassAllowPrivate(class_name));
|
| - ASSERT(!cls.IsNull());
|
| - const Field& field = Field::ZoneHandle(cls.LookupInstanceField(field_name));
|
| - ASSERT(!field.IsNull());
|
| - return field.Offset();
|
| -}
|
| -
|
| -
|
| -static const char* kFixedSizeArrayIteratorClassName = "_FixedSizeArrayIterator";
|
| -
|
| -// Class 'FixedSizeArrayIterator':
|
| -// T next() {
|
| -// return _array[_pos++];
|
| -// }
|
| -// Intrinsify: return _array[_pos++];
|
| -// TODO(srdjan): Throw a 'StateError' exception if the iterator
|
| -// has no more elements.
|
| -bool Intrinsifier::FixedSizeArrayIterator_next(Assembler* assembler) {
|
| - Label fall_through;
|
| - const intptr_t array_offset =
|
| - GetOffsetForField(kFixedSizeArrayIteratorClassName, "_array");
|
| - const intptr_t pos_offset =
|
| - GetOffsetForField(kFixedSizeArrayIteratorClassName, "_pos");
|
| - ASSERT((array_offset >= 0) && (pos_offset >= 0));
|
| - // Receiver is not NULL.
|
| - __ movq(RAX, Address(RSP, + 1 * kWordSize)); // Receiver.
|
| - __ movq(RCX, FieldAddress(RAX, pos_offset)); // Field _pos.
|
| - // '_pos' cannot be greater than array length and therefore is always Smi.
|
| -#if defined(DEBUG)
|
| - Label pos_ok;
|
| - __ testq(RCX, Immediate(kSmiTagMask));
|
| - __ j(ZERO, &pos_ok, Assembler::kNearJump);
|
| - __ Stop("pos must be Smi");
|
| - __ Bind(&pos_ok);
|
| -#endif
|
| - // Check that we are not trying to call 'next' when 'hasNext' is false.
|
| - __ movq(RAX, FieldAddress(RAX, array_offset)); // Field _array.
|
| - __ cmpq(RCX, FieldAddress(RAX, Array::length_offset())); // Range check.
|
| - __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump);
|
| -
|
| - // RCX is Smi, i.e, times 2.
|
| - ASSERT(kSmiTagShift == 1);
|
| - __ movq(RDI, FieldAddress(RAX, RCX, TIMES_4, sizeof(RawArray))); // Result.
|
| - const Immediate value = Immediate(reinterpret_cast<int64_t>(Smi::New(1)));
|
| - __ addq(RCX, value); // _pos++.
|
| - __ j(OVERFLOW, &fall_through, Assembler::kNearJump);
|
| - __ movq(RAX, Address(RSP, + 1 * kWordSize)); // Receiver.
|
| - __ StoreIntoObjectNoBarrier(RAX,
|
| - FieldAddress(RAX, pos_offset),
|
| - RCX); // Store _pos.
|
| - __ movq(RAX, RDI);
|
| - __ ret();
|
| - __ Bind(&fall_through);
|
| - return false;
|
| -}
|
| -
|
| -
|
| -// Class 'FixedSizeArrayIterator':
|
| -// bool get hasNext {
|
| -// return _length > _pos;
|
| -// }
|
| -bool Intrinsifier::FixedSizeArrayIterator_getHasNext(Assembler* assembler) {
|
| - Label fall_through, is_true;
|
| - const Bool& bool_true = Bool::ZoneHandle(Bool::True());
|
| - const Bool& bool_false = Bool::ZoneHandle(Bool::False());
|
| - const intptr_t length_offset =
|
| - GetOffsetForField(kFixedSizeArrayIteratorClassName, "_length");
|
| - const intptr_t pos_offset =
|
| - GetOffsetForField(kFixedSizeArrayIteratorClassName, "_pos");
|
| - __ movq(RAX, Address(RSP, + 1 * kWordSize)); // Receiver.
|
| - __ movq(RCX, FieldAddress(RAX, length_offset)); // Field _length.
|
| - __ movq(RAX, FieldAddress(RAX, pos_offset)); // Field _pos.
|
| - __ movq(RDI, RAX);
|
| - __ orq(RDI, RCX);
|
| - __ testq(RDI, Immediate(kSmiTagMask));
|
| - __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Non-smi _length/_pos.
|
| - __ cmpq(RCX, RAX); // _length > _pos.
|
| - __ j(GREATER, &is_true, Assembler::kNearJump);
|
| - __ LoadObject(RAX, bool_false);
|
| - __ ret();
|
| - __ Bind(&is_true);
|
| - __ LoadObject(RAX, bool_true);
|
| - __ ret();
|
| - __ Bind(&fall_through);
|
| - return false;
|
| -}
|
| -
|
| -
|
| bool Intrinsifier::String_getHashCode(Assembler* assembler) {
|
| Label fall_through;
|
| __ movq(RAX, Address(RSP, + 1 * kWordSize)); // String object.
|
|
|