%def op_instance_of():
% slow_path = add_slow_path(op_instance_of_slow_path) /* instance-of vA, vB, class@CCCC */
// Fast-path which gets the class from thread-local cache.
% fetch_from_thread_cache("%rsi", miss_label=".L"+opcode+"_init")
.L${opcode}_start:
movzbl rINSTbl,%edi
sarl $$4,%edi # edi<- B
GET_VREG %edi %rdi # edi<- vB (object)
andb $$0xf,rINSTbl # rINST<- A
testl %edi, %edi
je .L${opcode}_set_vreg
// Fast path without read barriers.
POISON_HEAP_REF esi // Poison class reference for in-memory comparison.
cmpl MIRROR_OBJECT_CLASS_OFFSET(%edi), %esi
jne ${slow_path}
.L${opcode}_set_one:
movl $$1, %edi
.L${opcode}_set_vreg:
SET_VREG %edi, rINSTq
.L${opcode}_resume:
ADVANCE_PC_FETCH_AND_GOTO_NEXT 2
%def op_instance_of_slow_path():
UNPOISON_HEAP_REF esi // Unpoison class reference poisoned in main path.
// Go slow path if we are marking. Checking now allows
// not going to slow path if the super class hierarchy check fails.
cmpq $$0, rSELF:THREAD_READ_BARRIER_MARK_REG00_OFFSET
jne 4f
testl $$MIRROR_CLASS_IS_INTERFACE_FLAG, MIRROR_CLASS_ACCESS_FLAGS_OFFSET(%rsi)
jne 5f
movl MIRROR_OBJECT_CLASS_OFFSET(%edi), %eax
UNPOISON_HEAP_REF eax
cmpl $$0, MIRROR_CLASS_COMPONENT_TYPE_OFFSET(%rsi)
jne 3f 1:
movl MIRROR_CLASS_SUPER_CLASS_OFFSET(%eax), %eax
UNPOISON_HEAP_REF eax
cmpl %eax, %esi
je .L${opcode}_set_one
testl %eax, %eax
jne 1b 2:
SET_VREG $$0, rINSTq # fp[A] <- value
jmp .L${opcode}_resume 3:
movl MIRROR_CLASS_COMPONENT_TYPE_OFFSET(%eax), %eax
UNPOISON_HEAP_REF eax
// Check if object is an array.
testl %eax, %eax
je 2b
movl MIRROR_CLASS_COMPONENT_TYPE_OFFSET(%esi), %ecx
UNPOISON_HEAP_REF ecx
cmpl $$0, MIRROR_CLASS_SUPER_CLASS_OFFSET(%ecx)
jne 5f
cmpw $$0, MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET(%ecx)
jne 2b
// %ecx is Object[]
// Check if the object is a primitive array.
xorl %ecx, %ecx
cmpw $$0, MIRROR_CLASS_OBJECT_PRIMITIVE_TYPE_OFFSET(%eax)
sete %cl
SET_VREG %ecx, rINSTq
jmp .L${opcode}_resume 4:
// 06 is %rsi
call art_quick_read_barrier_mark_reg06 5:
EXPORT_PC
call artInstanceOfFromCode
SET_VREG %eax, rINSTq # fp[A] <- value
jmp .L${opcode}_resume
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.