PR148 again: don't defuse IF_LCMPxx
[cacao.git] / src / vm / jit / stack.c
index 8c7ad97c3c9bab8c95dca5327998f05532f08eeb..40810e0d22ddf122b2e81a3b5b8131987b116a74 100644 (file)
 #include "arch.h"
 #include "md-abi.h"
 
-#include "mm/memory.h"
+#include "mm/memory.hpp"
 
 #include "native/native.hpp"
 
-#include "toolbox/logging.h"
+#include "toolbox/logging.hpp"
 
 #include "vm/jit/builtin.hpp"
 #include "vm/exceptions.hpp"
@@ -93,9 +93,6 @@
 #endif
 
 
-#define MIN(a,b)  (((a) < (b)) ? (a) : (b))
-
-
 /* For returnAddresses we use a field of the typeinfo to store from which  */
 /* subroutine the returnAddress will return, if used.                      */
 /* XXX It would be nicer to use typeinfo.typeclass, but the verifier seems */
@@ -2340,6 +2337,10 @@ icmd_NOP:
                                                sd.jd->returnblock = sd.bptr;
                                                break;
 
+                                       case ICMD_BREAKPOINT:
+                                               OP0_0;
+                                               break;
+
 
                                                /* pop 0 push 1 const */
 
@@ -4002,7 +4003,15 @@ icmd_DUP_X2:
                                                break;
 normal_LCMP:
 #endif /* SUPPORT_LONG_CMP_CONST */
-                                                       OP2_1(TYPE_LNG, TYPE_LNG, TYPE_INT);
+                                               bte = builtintable_get_internal(BUILTIN_lcmp);
+
+                                               iptr->opc            = ICMD_BUILTIN;
+                                               iptr->flags.bits    &= INS_FLAG_ID_MASK;
+                                               iptr->sx.s23.s3.bte  = bte;
+                                               /* iptr->line is already set */
+                                               code_unflag_leafmethod(code);
+                                               goto icmd_BUILTIN;
+
                                                break;
 
                                        case ICMD_FCMPL: