Merge change 8867
* changes:
Fix for 1857865: Need x86 implementation for OP_THROW_VERIFICATION_ERROR
diff --git a/vm/mterp/config-x86 b/vm/mterp/config-x86
index d315a1c..b7139ca 100644
--- a/vm/mterp/config-x86
+++ b/vm/mterp/config-x86
@@ -33,7 +33,6 @@
# opcode list; argument to op-start is default directory
op-start x86
- op OP_THROW_VERIFICATION_ERROR c
op-end
# arch-specific entry point to interpreter
diff --git a/vm/mterp/out/InterpAsm-x86.S b/vm/mterp/out/InterpAsm-x86.S
index 2df6c20..52007b0 100644
--- a/vm/mterp/out/InterpAsm-x86.S
+++ b/vm/mterp/out/InterpAsm-x86.S
@@ -5806,17 +5806,27 @@
/* ------------------------------ */
.balign 64
.L_OP_THROW_VERIFICATION_ERROR: /* 0xed */
- /* (stub) */
+/* File: x86/OP_THROW_VERIFICATION_ERROR.S */
+ /*
+ * Handle a throw-verification-error instruction. This throws an
+ * exception for an error discovered during verification. The
+ * exception is indicated by AA, with some detail provided by BBBB.
+ */
+ /* op AA, ref@BBBB */
GET_GLUE(%ecx)
- SAVE_PC_TO_GLUE(%ecx) # only need to export these two
- SAVE_FP_TO_GLUE(%ecx) # only need to export these two
- movl %ecx,OUT_ARG0(%esp) # glue is first arg to function
- call dvmMterp_OP_THROW_VERIFICATION_ERROR # do the real work
- GET_GLUE(%ecx)
- LOAD_PC_FROM_GLUE(%ecx) # retrieve updated values
- LOAD_FP_FROM_GLUE(%ecx) # retrieve updated values
- FETCH_INST()
- GOTO_NEXT
+ movzwl 2(rPC),%eax # eax<- BBBB
+ movl offGlue_method(%ecx),%ecx # ecx<- glue->method
+ EXPORT_PC()
+ movzbl rINST_HI,rINST_FULL # rINST_FULL<- AA
+ movl %eax,OUT_ARG2(%esp) # arg2<- BBBB
+ movl rINST_FULL,OUT_ARG1(%esp) # arg1<- AA
+ movl %ecx,OUT_ARG0(%esp) # arg0<- method
+ SPILL(rPC)
+ call dvmThrowVerificationError # call(method, kind, ref)
+ UNSPILL(rPC)
+ jmp common_exceptionThrown # handle exception
+
+
/* ------------------------------ */
.balign 64
.L_OP_EXECUTE_INLINE: /* 0xee */
diff --git a/vm/mterp/out/InterpC-x86.c b/vm/mterp/out/InterpC-x86.c
index b17e530..9de3324 100644
--- a/vm/mterp/out/InterpC-x86.c
+++ b/vm/mterp/out/InterpC-x86.c
@@ -1185,15 +1185,6 @@
FINISH(2);
-/* File: c/OP_THROW_VERIFICATION_ERROR.c */
-HANDLE_OPCODE(OP_THROW_VERIFICATION_ERROR)
- EXPORT_PC();
- vsrc1 = INST_AA(inst);
- ref = FETCH(1); /* class/field/method ref */
- dvmThrowVerificationError(curMethod, vsrc1, ref);
- GOTO_exceptionThrown();
-OP_END
-
/* File: c/gotoTargets.c */
/*
* C footer. This has some common code shared by the various targets.
diff --git a/vm/mterp/x86/OP_THROW_VERIFICATION_ERROR.S b/vm/mterp/x86/OP_THROW_VERIFICATION_ERROR.S
index d59eb1a..c3b5063 100644
--- a/vm/mterp/x86/OP_THROW_VERIFICATION_ERROR.S
+++ b/vm/mterp/x86/OP_THROW_VERIFICATION_ERROR.S
@@ -1,4 +1,20 @@
%verify executed
- /* TODO */
- call dvmAbort
+ /*
+ * Handle a throw-verification-error instruction. This throws an
+ * exception for an error discovered during verification. The
+ * exception is indicated by AA, with some detail provided by BBBB.
+ */
+ /* op AA, ref@BBBB */
+ GET_GLUE(%ecx)
+ movzwl 2(rPC),%eax # eax<- BBBB
+ movl offGlue_method(%ecx),%ecx # ecx<- glue->method
+ EXPORT_PC()
+ movzbl rINST_HI,rINST_FULL # rINST_FULL<- AA
+ movl %eax,OUT_ARG2(%esp) # arg2<- BBBB
+ movl rINST_FULL,OUT_ARG1(%esp) # arg1<- AA
+ movl %ecx,OUT_ARG0(%esp) # arg0<- method
+ SPILL(rPC)
+ call dvmThrowVerificationError # call(method, kind, ref)
+ UNSPILL(rPC)
+ jmp common_exceptionThrown # handle exception