Skip to content
Browse files

Remove some unused methods.

  • Loading branch information...
1 parent 389f3f6 commit 402fdf2cd9d1d74d218f08e6a7e6904c882739ce @eriksoe eriksoe committed Jan 20, 2014
Showing with 4 additions and 74 deletions.
  1. +0 −2 doc/RuntimeClassHierarchy.md
  2. +1 −13 src/main/java/erjang/ERT.java
  3. +3 −59 src/main/java/erjang/beam/CompilerVisitor.java
View
2 doc/RuntimeClassHierarchy.md
@@ -96,8 +96,6 @@ Subclasses should
- override either `go()` or `go2()`, depending
on whether the implementation might throw Pausable or not.
-<!-- Q: Can ERT.apply_list() be thrown out? -->
-
#### Introspection methods
View
14 src/main/java/erjang/ERT.java
@@ -668,20 +668,8 @@ public EObject invoke(EProc proc, EObject[] args) throws Pausable {
return efun;
}
-
- public static EObject apply_list(EProc proc, EObject mod, EObject fun,
- ESeq seq, int len) throws Pausable {
- EAtom f = fun.testAtom();
- ESeq a = seq.testSeq();
-
- if (f == null || a == null)
- throw ERT.badarg(mod, fun, seq);
-
- EFun efun = resolve_fun(mod, fun, len);
- return efun.apply(proc, a);
- }
- public static EObject apply_last(EProc proc, EObject mod, EObject fun, EObject args) throws Pausable {
+ public static EObject apply_last(EProc proc, EObject mod, EObject fun, EObject args) throws Pausable {
ESeq seq = args.testSeq();
if (seq == null) { throw ERT.badarg(mod, fun, args); }
return apply_list_last(proc, mod, fun, seq, seq.length());
View
62 src/main/java/erjang/beam/CompilerVisitor.java
@@ -3332,10 +3332,8 @@ public void visitCall(ExtFun fun, Arg[] args, boolean is_tail,
ASMFunctionAdapter.this.local_self_call.put(fwa, label);
}
- BuiltInFunction bif = null;
-
- bif = BIFUtil.getMethod(fun.mod.getName(), fun.fun.getName(),
- args, false, false);
+ BuiltInFunction bif = BIFUtil.getMethod(fun.mod.getName(), fun.fun.getName(),
+ args, false, false);
if (bif != null || isExternal || uses_on_load) {
@@ -3813,61 +3811,7 @@ private static void make_constructor(ClassWriter cw, String module_name,
}
}
- private static void make_invoke_method(ClassWriter cw, String outer_name,
- String mname, int arity, boolean proc, int freevars,
- Type returnType, boolean isTailCall) {
- MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "invoke",
- EUtil.getSignature(arity - freevars, true), null, PAUSABLE_EX);
- mv.visitCode();
- if (proc) {
- mv.visitVarInsn(ALOAD, 1);
- }
- for (int i = 0; i < arity - freevars; i++) {
- mv.visitVarInsn(ALOAD, i + 2);
- }
- for (int i = 0; i < freevars; i++) {
- mv.visitVarInsn(ALOAD, 0);
- mv.visitFieldInsn(GETFIELD, outer_name + "$FN_" + mname, "fv" + i,
- EOBJECT_DESC);
- }
- mv.visitMethodInsn(INVOKESTATIC, outer_name, mname,
- EUtil.getSignature(arity, proc, returnType));
-
- if (isTailCall) {
- mv.visitVarInsn(ASTORE, arity + 2);
-
- Label done = new Label();
- Label loop = new Label();
- mv.visitLabel(loop);
- mv.visitVarInsn(ALOAD, arity + 2);
- if (EProc.TAIL_MARKER == null) {
- mv.visitJumpInsn(IFNONNULL, done);
- } else {
- mv.visitFieldInsn(GETSTATIC, EPROC_NAME, "TAIL_MARKER",
- EOBJECT_DESC);
- mv.visitJumpInsn(IF_ACMPNE, done);
- }
-
- // load proc
- mv.visitVarInsn(ALOAD, 1);
- mv.visitFieldInsn(GETFIELD, EPROC_NAME, "tail", EFUN_DESCRIPTOR);
- mv.visitVarInsn(ALOAD, 1);
-
- mv.visitMethodInsn(INVOKEVIRTUAL, EFUN_NAME, "go", GO_DESC);
- mv.visitVarInsn(ASTORE, arity + 2);
-
- mv.visitJumpInsn(GOTO, loop);
-
- mv.visitLabel(done);
- mv.visitVarInsn(ALOAD, arity + 2);
- }
-
- mv.visitInsn(ARETURN);
- mv.visitMaxs(arity + 2, arity + 2);
- mv.visitEnd();
- }
-
- public static void make_invoketail_method(ClassWriter cw,
+ public static void make_invoketail_method(ClassWriter cw,
String full_inner, int arity, int freevars) {
MethodVisitor mv;
mv = cw.visitMethod(ACC_PUBLIC | ACC_FINAL, "invoke_tail",

1 comment on commit 402fdf2

@krestenkrab
Trifork member

:+1:

Please sign in to comment.
Something went wrong with that request. Please try again.