.Lbad_arg:
ldr r0, strBadEntryPoint
+0: add r0, pc
@ r1 holds value of entryPoint
bl printf
bl dvmAbort
.fnend
.size dvmMterpStdRun, .-dvmMterpStdRun
+strBadEntryPoint:
+ .word PCREL_REF(.LstrBadEntryPoint,0b)
.global dvmMterpStdBail
.type dvmMterpStdBail, %function
ldmfd sp!, {r4-r10,fp,pc} @ restore 9 regs and return
-/*
- * String references.
- */
-strBadEntryPoint:
- .word .LstrBadEntryPoint
-
.global dvmAsmInstructionStart
.type dvmAsmInstructionStart, %function
add r2, rFP, r2, lsl #2 @ r2<- &fp[A]
ldmia r3, {r0-r1} @ r0/r1<- fp[B]
FETCH_ADVANCE_INST(1) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
stmia r2, {r0-r1} @ fp[A]<- r0/r1
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
/* ------------------------------ */
add r2, rFP, r2, lsl #2 @ r2<- &fp[AAAA]
ldmia r3, {r0-r1} @ r0/r1<- fp[BBBB]
FETCH_ADVANCE_INST(3) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
stmia r2, {r0-r1} @ fp[AAAA]<- r0/r1
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
/* ------------------------------ */
add r2, rFP, r2, lsl #2 @ r2<- &fp[AA]
ldmia r3, {r0-r1} @ r0/r1<- retval.j
FETCH_ADVANCE_INST(1) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
stmia r2, {r0-r1} @ fp[AA]<- r0/r1
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
/* ------------------------------ */
cmp r0, #0 @ not yet resolved?
beq .LOP_CONST_STRING_resolve
FETCH_ADVANCE_INST(2) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
SET_VREG(r0, r9) @ vAA<- r0
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
/* ------------------------------ */
cmp r0, #0
beq .LOP_CONST_STRING_JUMBO_resolve
FETCH_ADVANCE_INST(3) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
SET_VREG(r0, r9) @ vAA<- r0
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
/* ------------------------------ */
cmp r0, #0 @ not yet resolved?
beq .LOP_CONST_CLASS_resolve
FETCH_ADVANCE_INST(2) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
SET_VREG(r0, r9) @ vAA<- r0
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
/* ------------------------------ */
cmp r0, #0 @ failed?
beq common_exceptionThrown @ yup, handle the exception
FETCH_ADVANCE_INST(2) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
SET_VREG(r0, r9) @ vAA<- r0
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
/* continuation for OP_CONST_STRING_JUMBO */
cmp r0, #0 @ failed?
beq common_exceptionThrown @ yup, handle the exception
FETCH_ADVANCE_INST(3) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
SET_VREG(r0, r9) @ vAA<- r0
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
/* continuation for OP_CONST_CLASS */
cmp r0, #0 @ failed?
beq common_exceptionThrown @ yup, handle the exception
FETCH_ADVANCE_INST(2) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
SET_VREG(r0, r9) @ vAA<- r0
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
/* continuation for OP_CHECK_CAST */
#endif
.LOP_NEW_INSTANCE_end:
FETCH_ADVANCE_INST(2) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
SET_VREG(r0, r3) @ vAA<- r0
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
#if defined(WITH_JIT)
mov r1, rPC
bl dvmJitEndTraceSelect @ (self, pc)
FETCH_ADVANCE_INST(2) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
SET_VREG(r9, r10) @ vAA<- new object
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
#endif
*/
.LOP_FILLED_NEW_ARRAY_notimpl:
ldr r0, .L_strFilledNewArrayNotImpl_OP_FILLED_NEW_ARRAY
+3: add r0, pc
bl dvmThrowInternalError
b common_exceptionThrown
*/
.L_strFilledNewArrayNotImpl_OP_FILLED_NEW_ARRAY:
- .word .LstrFilledNewArrayNotImpl
+ .word PCREL_REF(.LstrFilledNewArrayNotImpl,3b)
/* continuation for OP_FILLED_NEW_ARRAY_RANGE */
*/
.LOP_FILLED_NEW_ARRAY_RANGE_notimpl:
ldr r0, .L_strFilledNewArrayNotImpl_OP_FILLED_NEW_ARRAY_RANGE
+3: add r0, pc
bl dvmThrowInternalError
b common_exceptionThrown
*/
.L_strFilledNewArrayNotImpl_OP_FILLED_NEW_ARRAY_RANGE:
- .word .LstrFilledNewArrayNotImpl
+ .word PCREL_REF(.LstrFilledNewArrayNotImpl,3b)
/* continuation for OP_CMPL_FLOAT */
GOTO_OPCODE(ip) @ jump to next instruction
.LOP_APUT_OBJECT_skip_check:
FETCH_ADVANCE_INST(2) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
str r9, [r10, #offArrayObject_contents] @ vBB[vCC]<- vAA
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
.LOP_APUT_OBJECT_throw:
@ The types don't match. We need to throw an ArrayStoreException.
GET_VREG(r0, r1) @ r0<- fp[A]
beq common_errNullObject @ object was null
FETCH_ADVANCE_INST(2) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
@ no-op @ releasing store
str r0, [r9, r3] @ obj.field (8/16/32 bits)<- r0
@ no-op
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
/* continuation for OP_IPUT_WIDE */
ldr r2, [rSELF, #offThread_cardTable] @ r2<- card table base
beq common_errNullObject @ object was null
FETCH_ADVANCE_INST(2) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
@ no-op @ releasing store
str r0, [r9, r3] @ obj.field (32 bits)<- r0
@ no-op
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
cmp r0, #0 @ stored a null reference?
strneb r2, [r2, r9, lsr #GC_CARD_SHIFT] @ mark card if not
GOTO_OPCODE(ip) @ jump to next instruction
GET_VREG(r0, r1) @ r0<- fp[A]
beq common_errNullObject @ object was null
FETCH_ADVANCE_INST(2) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
@ no-op @ releasing store
str r0, [r9, r3] @ obj.field (8/16/32 bits)<- r0
@ no-op
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
/* continuation for OP_IPUT_BYTE */
GET_VREG(r0, r1) @ r0<- fp[A]
beq common_errNullObject @ object was null
FETCH_ADVANCE_INST(2) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
@ no-op @ releasing store
str r0, [r9, r3] @ obj.field (8/16/32 bits)<- r0
@ no-op
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
/* continuation for OP_IPUT_CHAR */
GET_VREG(r0, r1) @ r0<- fp[A]
beq common_errNullObject @ object was null
FETCH_ADVANCE_INST(2) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
@ no-op @ releasing store
str r0, [r9, r3] @ obj.field (8/16/32 bits)<- r0
@ no-op
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
/* continuation for OP_IPUT_SHORT */
GET_VREG(r0, r1) @ r0<- fp[A]
beq common_errNullObject @ object was null
FETCH_ADVANCE_INST(2) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
@ no-op @ releasing store
str r0, [r9, r3] @ obj.field (8/16/32 bits)<- r0
@ no-op
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
/* continuation for OP_SGET */
GET_VREG(r0, r1) @ r0<- fp[A]
beq common_errNullObject @ object was null
FETCH_ADVANCE_INST(2) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
SMP_DMB_ST @ releasing store
str r0, [r9, r3] @ obj.field (8/16/32 bits)<- r0
SMP_DMB
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
GOTO_OPCODE(ip) @ jump to next instruction
/* continuation for OP_SGET_VOLATILE */
ldr r0, [rFP, ip, lsl #2] @ r0<- vC
0:
ldr rINST, .LOP_EXECUTE_INLINE_table @ table of InlineOperation
+5: add rINST, pc
ldr pc, [rINST, r10, lsl #4] @ sizeof=16, "func" is first entry
@ (not reached)
.LOP_EXECUTE_INLINE_table:
- .word gDvmInlineOpsTable
+ .word PCREL_REF(gDvmInlineOpsTable,5b)
/* continuation for OP_EXECUTE_INLINE_RANGE */
GET_VREG(r0, ip) @ r0<- vBase[0]
0:
ldr r9, .LOP_EXECUTE_INLINE_RANGE_table @ table of InlineOperation
+5: add r9, pc
ldr pc, [r9, r10, lsl #4] @ sizeof=16, "func" is first entry
@ (not reached)
.LOP_EXECUTE_INLINE_RANGE_table:
- .word gDvmInlineOpsTable
+ .word PCREL_REF(gDvmInlineOpsTable,5b)
/* continuation for OP_INVOKE_OBJECT_INIT_RANGE */
ldr r2, [rSELF, #offThread_cardTable] @ r2<- card table base
beq common_errNullObject @ object was null
FETCH_ADVANCE_INST(2) @ advance rPC, load rINST
- GET_INST_OPCODE(ip) @ extract opcode from rINST
SMP_DMB_ST @ releasing store
str r0, [r9, r3] @ obj.field (32 bits)<- r0
SMP_DMB
+ GET_INST_OPCODE(ip) @ extract opcode from rINST
cmp r0, #0 @ stored a null reference?
strneb r2, [r2, r9, lsr #GC_CARD_SHIFT] @ mark card if not
GOTO_OPCODE(ip) @ jump to next instruction
cmp lr, #0 @ any special SubModes active?
bne 11f @ go handle them if so
- mov lr, pc @ set return addr
- ldr pc, [r2, #offMethod_nativeFunc] @ pc<- methodToCall->nativeFunc
+ ldr ip, [r2, #offMethod_nativeFunc] @ pc<- methodToCall->nativeFunc
+ blx ip
7:
@ native return; r10=newSaveArea
ldmfd sp, {r0-r3} @ refresh. NOTE: no sp autoincrement
@ Call the native method
- mov lr, pc @ set return addr
- ldr pc, [r2, #offMethod_nativeFunc] @ pc<- methodToCall->nativeFunc
+ ldr ip, [r2, #offMethod_nativeFunc] @ pc<- methodToCall->nativeFunc
+ blx ip
@ Restore the pre-call arguments
ldmfd sp!, {r0-r3} @ r2<- methodToCall (others unneeded)
ldr r3, [r3, #offClassObject_descriptor]
@
ldr r2, strExceptionNotCaughtLocally
+0: add r2, pc
ldr r1, strLogTag
+1: add r1, pc
mov r0, #3 @ LOG_DEBUG
bl __android_log_print
#endif
bl dvmReleaseTrackedAlloc @ release the exception
b common_gotoBail @ bail out
+strExceptionNotCaughtLocally:
+ .word PCREL_REF(.LstrExceptionNotCaughtLocally,0b)
+strLogTag:
+ .word PCREL_REF(.LstrLogTag,1b)
/*
* Exception handling, calls through "glue code".
common_errDivideByZero:
EXPORT_PC()
ldr r0, strDivideByZero
+0: add r0, pc
bl dvmThrowArithmeticException
b common_exceptionThrown
+strDivideByZero:
+ .word PCREL_REF(.LstrDivideByZero,0b)
+
/*
* Attempt to allocate an array with a negative size.
* On entry: length in r1
.macro SQUEAK num
common_squeak\num:
stmfd sp!, {r0, r1, r2, r3, ip, lr}
- ldr r0, strSqueak
+ ldr r0, strSqueak\num
+0: add r0, pc
mov r1, #\num
bl printf
ldmfd sp!, {r0, r1, r2, r3, ip, lr}
bx lr
+
+strSqueak\num:
+ .word PCREL_REF(.LstrSqueak,0b)
.endm
SQUEAK 0
stmfd sp!, {r0, r1, r2, r3, ip, lr}
mov r1, r0
ldr r0, strSqueak
+0: add r0, pc
bl printf
ldmfd sp!, {r0, r1, r2, r3, ip, lr}
bx lr
+strSqueak:
+ .word PCREL_REF(.LstrSqueak,0b)
+
/*
* Print a newline, preserving registers.
*/
common_printNewline:
stmfd sp!, {r0, r1, r2, r3, ip, lr}
ldr r0, strNewline
+0: add r0, pc
bl printf
ldmfd sp!, {r0, r1, r2, r3, ip, lr}
bx lr
+strNewline:
+ .word PCREL_REF(.LstrNewline,0b)
+
/*
* Print the 32-bit quantity in r0 as a hex value, preserving registers.
*/
stmfd sp!, {r0, r1, r2, r3, ip, lr}
mov r1, r0
ldr r0, strPrintHex
+0: add r0, pc
bl printf
ldmfd sp!, {r0, r1, r2, r3, ip, lr}
bx lr
+strPrintHex:
+ .word PCREL_REF(.LstrPrintHex,0b)
+
/*
* Print the 64-bit quantity in r0-r1, preserving registers.
*/
mov r3, r1
mov r2, r0
ldr r0, strPrintLong
+0: add r0, pc
bl printf
ldmfd sp!, {r0, r1, r2, r3, ip, lr}
bx lr
+strPrintLong:
+ .word PCREL_REF(.LstrPrintLong,0b)
+
/*
* Print full method info. Pass the Method* in r0. Preserves regs.
*/
#endif
-/*
- * String references, must be close to the code that uses them.
- */
- .align 2
-strDivideByZero:
- .word .LstrDivideByZero
-strLogTag:
- .word .LstrLogTag
-strExceptionNotCaughtLocally:
- .word .LstrExceptionNotCaughtLocally
-
-strNewline:
- .word .LstrNewline
-strSqueak:
- .word .LstrSqueak
-strPrintHex:
- .word .LstrPrintHex
-strPrintLong:
- .word .LstrPrintLong
/*
* Zero-terminated ASCII string data.