}
public static String valueOf(double val) {
- char[] chararray=new char[10];
+ char[] chararray=new char[20];
String s=new String();
s.offset=0;
s.count=convertdoubletochar(val, chararray);
public static native void deepArrayCopy(Object dst, Object src);
+ public static native void Assert(boolean status);
+
/* Only used for microbenchmark testing of SingleTM version */
public static native void logevent(int event);
public static native void logevent();
public static native void flushToFile(int threadid);
/* Only used for microbenchmark testing of SingleTM version */
-
}
#include "sandbox.h"
#include "tm.h"
#include <stdio.h>
+#include "methodheaders.h"
+#include "runtime.h"
__thread int transaction_check_counter;
__thread jmp_buf aborttrans;
__thread int abortenabled;
transaction_check_counter=*counter_reset_pointer;
}
+#ifdef D___System______Assert____Z
+CALL11(___System______Assert____Z, int ___status___, int ___status___) {
+ if (!___status___) {
+ if (abortenabled&&checktrans()) {
+#ifdef TRANSSTATS
+ numTransAbort++;
+#endif
+ freenewobjs();
+ objstrReset();
+ t_chashreset();
+#ifdef READSET
+ rd_t_chashreset();
+#endif
+#ifdef DELAYCOMP
+ dc_t_chashreset();
+ ptrstack.count=0;
+ primstack.count=0;
+ branchstack.count=0;
+#ifdef STMARRAY
+ arraystack.count=0;
+#endif
+#endif
+ _longjmp(aborttrans, 1);
+ }
+ printf("Assertion violation\n");
+ *((int *)(NULL)); //force stack trace error
+ }
+}
+#endif
+
/* Do sandboxing */
void errorhandler(int sig, struct sigcontext ctx) {
// printf("Error\n");
exit(-1);
#endif
}
+
+#ifndef SANDBOX
+#ifdef D___System______Assert____Z
+ void CALL11(___System______Assert____Z, int ___status___, int ___status___) {
+ if (!___status___) {
+ printf("Assertion violation\n");
+ *((int *)(NULL)); //force stack trace error
+ }
+ }
+#endif
+#endif