Index: src/runtime/lookup-asm/lookup-asm-mips64-n64-elf.S ================================================================== --- src/runtime/lookup-asm/lookup-asm-mips64-n64-elf.S +++ src/runtime/lookup-asm/lookup-asm-mips64-n64-elf.S @@ -27,11 +27,14 @@ .section .text .macro generate_lookup name not_found \name: beqz $a0, 0f - ld $t0, 0($a0) + andi $t0, $a0, 1 + bnez $t0, .Ltagged_pointer_\name + + ld $t0, ($a0) ld $t0, 64($t0) .Lmain_\name: #ifdef OF_BIG_ENDIAN # ifdef OF_SELUID24 @@ -42,11 +45,11 @@ #else # ifdef OF_SELUID24 lbu $t1, 2($a1) # endif lbu $t2, 1($a1) - lbu $t3, 0($a1) + lbu $t3, ($a1) #endif #ifdef OF_SELUID24 sll $t1, $t1, 3 #endif @@ -53,16 +56,16 @@ sll $t2, $t2, 3 sll $t3, $t3, 3 #ifdef OF_SELUID24 daddu $t0, $t0, $t1 - ld $t0, 0($t0) + ld $t0, ($t0) #endif daddu $t0, $t0, $t2 - ld $t0, 0($t0) + ld $t0, ($t0) daddu $t0, $t0, $t3 - ld $t0, 0($t0) + ld $t0, ($t0) beqz $t0, 1f move $v0, $t0 jr $ra @@ -78,18 +81,32 @@ lui $t0, %hi(%neg(%gp_rel(\name))) daddu $t0, $t0, $t9 daddiu $t0, $t0, %lo(%neg(%gp_rel(\name))) ld $t9, %got_disp(\not_found)($t0) jr $t9 + +.Ltagged_pointer_\name: + and $t0, $a0, 0xE + dsll $t0, $t0, 2 + + lui $t1, %hi(%neg(%gp_rel(\name))) + daddu $t1, $t1, $t9 + daddiu $t1, $t1, %lo(%neg(%gp_rel(\name))) + ld $t1, %got_disp(objc_tagged_pointer_classes)($t1) + daddu $t0, $t1, $t0 + ld $t0, ($t0) + ld $t0, 64($t0) + + b .Lmain_\name .type \name, %function .size \name, .-\name .endm .macro generate_lookup_super name lookup \name: move $t0, $a0 - ld $a0, 0($a0) + ld $a0, ($a0) beqz $a0, 0f ld $t0, 8($t0) ld $t0, 64($t0)