OSDN Git Service

lejos_NXJ_win32_0_6_0beta.zip
[nxt-jsp/lejos_nxj.git] / nxtOSEK / lejos_nxj / src / nxtvm / javavm / op_other.hc
index 3868e6f..f3fff19 100644 (file)
@@ -5,17 +5,32 @@
 case OP_ATHROW:
   tempStackWord = pop_ref();
   if (tempStackWord == JNULL)
+    goto LABEL_NULLPTR_EXCEPTION;
+  thrownException = word2obj (tempStackWord);
+  goto LABEL_THROW_EXCEPTION;
+
+case OP_MONITORENTER:
   {
-    throw_exception (nullPointerException);
-    goto LABEL_ENGINELOOP;
+    Object *obj = word2obj(pop_ref());
+    SAVE_REGS();
+    enter_monitor (currentThread, obj);
+    LOAD_REGS();
   }
-  throw_exception (word2obj (tempStackWord));
-  goto LABEL_ENGINELOOP;
-case OP_MONITORENTER:
-  enter_monitor (currentThread, word2obj(pop_ref()));
   goto LABEL_ENGINELOOP;
+
 case OP_MONITOREXIT:
-  exit_monitor (currentThread, word2obj(pop_ref()));
+  {
+    Object *obj = word2obj(pop_ref());
+    SAVE_REGS();
+    exit_monitor (currentThread, obj);
+    LOAD_REGS();
+  }
+  goto LABEL_ENGINELOOP;
+
+LABEL_THROW_EXCEPTION:
+  SAVE_REGS();
+  throw_exception( thrownException);
+  LOAD_REGS();
   goto LABEL_ENGINELOOP;
 
 // Notes: