| Index: runtime/vm/assembler_ia32.cc
|
| diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
|
| index a62ce8114255ea45efa66d726cbc84bf47408c1b..7bd7d49e553ee56214ee3f3a71a2082a5c2c8d5a 100644
|
| --- a/runtime/vm/assembler_ia32.cc
|
| +++ b/runtime/vm/assembler_ia32.cc
|
| @@ -1562,6 +1562,37 @@ void Assembler::EmitGenericShift(int rm,
|
| }
|
|
|
|
|
| +void Assembler::LoadClassOfObject(Register result,
|
| + Register object,
|
| + Register scratch) {
|
| + ASSERT(scratch != result);
|
| + LoadClassIndexOfObject(scratch, object);
|
| +
|
| + movl(result, FieldAddress(CTX, Context::isolate_offset()));
|
| + const intptr_t table_offset_in_isolate =
|
| + Isolate::class_table_offset() + ClassTable::table_offset();
|
| + movl(result, Address(result, table_offset_in_isolate));
|
| + movl(result, Address(result, scratch, TIMES_4, 0));
|
| +}
|
| +
|
| +
|
| +void Assembler::LoadClassIndexOfObject(Register result, Register object) {
|
| + ASSERT(RawObject::kClassTagBit == 16);
|
| + ASSERT(RawObject::kClassTagSize == 16);
|
| + const intptr_t class_id_offset = Object::tags_offset() +
|
| + RawObject::kClassTagBit / kBitsPerByte;
|
| + movzxw(result, FieldAddress(object, class_id_offset));
|
| +}
|
| +
|
| +
|
| +void Assembler::CompareClassOfObject(Register object,
|
| + const Class& clazz,
|
| + Register scratch) {
|
| + LoadClassIndexOfObject(scratch, object);
|
| + cmpl(scratch, Immediate(clazz.index()));
|
| +}
|
| +
|
| +
|
| void Assembler::Comment(const char* comment) {
|
| if (FLAG_code_comments) {
|
| comments_.Add(new CodeComment(buffer_.GetPosition(),
|
|
|