Commit a983fd74 authored by Julian Kranz's avatar Julian Kranz

Jgdrr

Gdrr

- Continued to implement jgdrr (bug fixes)
- Continued to implement gdrr (bug fixes)
parent 876a479a
......@@ -81,8 +81,8 @@ static gdrr_sem_var_t *gdrr_convert_sem_address(__obj sem_address_obj,
struct gdrr_config *config) {
__obj rec = __DECON(sem_address_obj);
__obj size = __RECORD_SELECT(rec, ___id);
__obj address = __RECORD_SELECT(rec, ___offset);
__obj size = __RECORD_SELECT(rec, ___size);
__obj address = __RECORD_SELECT(rec, ___address);
return config->callbacks.sem_address.sem_address(config->closure,
__CASETAGINT(size), gdrr_convert_sem_linear(address, config));
......
......@@ -553,7 +553,7 @@ static gdrr_sem_stmt_t *sem_assign(void *closure, gdrr_sem_var_t *lhs,
static gdrr_sem_stmt_t *sem_load(void *closure, gdrr_sem_var_t *lhs,
__word size, gdrr_sem_address_t *address) {
jobject ret = java_method_call(closure, "sem_load", 3, (jobject)lhs,
(jobject)size, (jobject)address);
java_long_create(closure, (long)size), (jobject)address);
return (gdrr_sem_stmt_t*)ret;
}
static gdrr_sem_stmt_t *sem_store(void *closure, gdrr_sem_var_t *lhs,
......@@ -618,7 +618,11 @@ JNICALL Java_rnati_NativeInterface_decodeAndTranslateNative(JNIEnv *env,
}
blob[i] = c & 0xff;
}
done: __decode(__decode__, blob, i, &insn);
done:;
__obj state = __createState(blob, i, 0, 0);
insn = __runMonadicNoArg(__decode__, &state);
if(___isNil(insn))
__fatal("decode failed");
else {
......@@ -627,7 +631,7 @@ JNICALL Java_rnati_NativeInterface_decodeAndTranslateNative(JNIEnv *env,
printf("---------------------------\n");
__obj r = __translate(__translate__, insn);
__obj r = __runMonadicOneArg(__translate__, &state, insn);
if(___isNil(r))
__fatal("translate failed");
else {
......
......@@ -22,6 +22,9 @@ public class Variable implements IVariable {
@Override
public String toString() {
return id + "@" + offset;
if(offset > 0)
return id + "@" + offset;
else
return id.toString();
}
}
......@@ -23,6 +23,6 @@ public class BranchStatement extends Statement {
@Override
public String toString() {
return "goto[" + hint + "] " + target + ";";
return "goto[" + hint + "] " + target;
}
}
......@@ -30,6 +30,6 @@ public class LoadStatement extends Statement {
@Override
public String toString() {
return lhs + " =: " + size + " *" + address;
return lhs + " =:" + size + " *" + address;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment