Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of https://github.com/trifork/erjang

  • Loading branch information...
commit e7c5cc19f422281e06552161dcee34c4c2117fff 2 parents 186b7b6 + 6ab2ac7
Gregory Burd authored
View
14 src/main/java/erjang/beam/interpreter/Interpreter.template
@@ -199,9 +199,11 @@ public class Interpreter extends AbstractInterpreter {
int argCnt = args.length;
EObject[] reg = getRegs(proc); //??
for (int i=0; i<argCnt; i++) {reg[i] = args[i];} //??
+ /*
if (log.isLoggable(Level.FINER)) {
for (int i=0; i<argCnt; i++) log.finer("INT| arg#"+i+"="+args[i]);
}
+ */
return interpret(proc, start_pc, reg);
}
@@ -212,16 +214,18 @@ public class Interpreter extends AbstractInterpreter {
} else {
int argCnt = len;
for (int i=0; i<argCnt; i++) {reg[i] = args[i];} //??
+ /*
if (log.isLoggable(Level.FINER)) {
for (int i=0; i<argCnt; i++) log.finer("INT| arg#"+i+"="+args[i]);
}
+ */
return interpret(proc, start_pc, reg);
}
}
/** Local call - with given PC and register array */
public EObject invoke_local(final EProc proc, final EObject[] reg, int argCnt, int pc) throws Pausable {
- log.fine("INT| invoking "+name+"@"+pc+"...");
+ //log.fine("INT| invoking "+name+"@"+pc+"...");
return interpret(proc, pc, reg);
}
@@ -250,14 +254,16 @@ public class Interpreter extends AbstractInterpreter {
}
last_pc = pc;
final int opcode = code[pc++];
+ /*
if (log.isLoggable(Level.FINEST)) {
log.finest("STACK| "); for (int i=0; i<=sp; i++) {log.finest(" "+i+":"+stack[i]);} log.finest("");
}
log.finer("INTP|"+proc.self_handle()+" (pc="+(pc-1)+"; sp="+sp+")"+opcode+" "+reg[0]);
+ */
switch (opcode) {
case ENSURE_REG_CAPACITY: {
int max_x = code[pc++];
- log.finer("INTP|"+proc.self_handle()+" Ensure reg capacity: "+max_x);
+ //log.finer("INTP|"+proc.self_handle()+" Ensure reg capacity: "+max_x);
reg = ensureCapacity(reg, max_x);
} break;
@@ -309,15 +315,17 @@ public class Interpreter extends AbstractInterpreter {
}
public EObject invoke(final EProc proc, final EObject[] args) throws Pausable {
- log.fine("INT| Closure invoked @ "+start_pc);
+ // log.fine("INT| Closure invoked @ "+start_pc);
int argCnt = args.length;
int envCnt = env.length;
EObject[] reg = new EObject[1024]; //??
for (int i=0; i<argCnt; i++) {reg[i] = args[i];} //??
for (int i=0; i<envCnt; i++) {reg[argCnt+i] = env[i];}
+ /*
if (log.isLoggable(Level.FINER)) {
for (int i=0; i<argCnt+envCnt; i++) log.finer("INT| reg#"+i+"="+reg[i]);
}
+ */
return interpret(proc, start_pc, reg);
}
}
View
3  src/main/java/erjang/beam/interpreter/ops.spec
@@ -200,6 +200,9 @@ apply arity:
call_fun arity:
PRE_CALL(); int ary=GET(arity); reg[0] = ((EFun)reg[ary]).invoke(proc, reg, 0, ary); POST_CALL();
+i_call_fun_last arity:
+ PRE_CALL(); int ary=GET(arity); return ((EFun)reg[ary]).invoke(proc, reg, 0, ary);
+
%class II(i1:I i2:I)
apply_last arity dealloc:
STACK_DEALLOC(GET(dealloc)); int ary = GET(arity); EFun fun = ERT.resolve_fun(reg[ary], reg[ary+1], ary); PRE_CALL(); return fun.invoke(proc, REGS_AS_ARRAY(ary));
Please sign in to comment.
Something went wrong with that request. Please try again.