PR148 again: don't defuse IF_LCMPxx
[cacao.git] / src / vm / jit / stack.c
index 16bba39e18f888ff701c75df576e01f4fadbc52d..40810e0d22ddf122b2e81a3b5b8131987b116a74 100644 (file)
 #include "arch.h"
 #include "md-abi.h"
 
-#include "mm/memory.h"
+#include "mm/memory.hpp"
 
-#include "native/native.h"
+#include "native/native.hpp"
 
-#include "toolbox/logging.h"
+#include "toolbox/logging.hpp"
 
 #include "vm/jit/builtin.hpp"
 #include "vm/exceptions.hpp"
 #include "vm/global.h"
 #include "vm/options.h"
-#include "vm/resolve.h"
+#include "vm/resolve.hpp"
 #include "vm/string.hpp"
 #include "vm/types.h"
 
@@ -54,7 +54,7 @@
 #include "vm/jit/abi.h"
 #include "vm/jit/cfg.h"
 #include "vm/jit/codegen-common.hpp"
-#include "vm/jit/parse.h"
+#include "vm/jit/parse.hpp"
 #include "vm/jit/show.hpp"
 
 #if defined(ENABLE_DISASSEMBLER)
@@ -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: