gnu.kawa.functions
Class CompileArith

java.lang.Object
  extended by gnu.kawa.functions.CompileArith
All Implemented Interfaces:
Inlineable

public class CompileArith
extends java.lang.Object
implements Inlineable


Field Summary
static CompileArith $Mn
           
static CompileArith $Pl
           
 
Method Summary
static boolean appropriateIntConstant(Expression[] args, int iarg, InlineCalls visitor)
           
static boolean appropriateLongConstant(Expression[] args, int iarg, InlineCalls visitor)
           
 void compile(ApplyExp exp, Compilation comp, Target target)
           
 boolean compileIntNum(Expression arg1, Expression arg2, int kind1, int kind2, Compilation comp)
           
static CompileArith forBitwise(java.lang.Object proc)
           
static CompileArith forDiv(java.lang.Object proc)
           
static CompileArith forMul(java.lang.Object proc)
           
 int getReturnKind(Expression[] args)
          This actually returns the "promoted argument type".
static int getReturnKind(int kind1, int kind2, int op)
           
 Type getReturnType(Expression[] args)
           
static Expression pairwise(Procedure proc, Expression rproc, Expression[] args, InlineCalls visitor)
          Convert (PROC A B C) to (PROC (PROC A B) C) etc.
 int primitiveOpcode()
           
static Expression validateApplyAdd(AddOp proc, ApplyExp exp, InlineCalls visitor)
           
static Expression validateApplyArithOp(ApplyExp exp, InlineCalls visitor, Type required, Procedure proc)
           
static Expression validateApplyDiv(DivideOp proc, ApplyExp exp, InlineCalls visitor)
           
static Expression validateApplyNot(ApplyExp exp, int kind, InlineCalls visitor)
           
static Expression validateApplyNumberCompare(ApplyExp exp, InlineCalls visitor, Type required, Procedure proc)
           
static Expression validateApplyNumberPredicate(ApplyExp exp, InlineCalls visitor, Type required, Procedure proc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

$Pl

public static CompileArith $Pl

$Mn

public static CompileArith $Mn
Method Detail

forMul

public static CompileArith forMul(java.lang.Object proc)

forDiv

public static CompileArith forDiv(java.lang.Object proc)

forBitwise

public static CompileArith forBitwise(java.lang.Object proc)

appropriateIntConstant

public static boolean appropriateIntConstant(Expression[] args,
                                             int iarg,
                                             InlineCalls visitor)

appropriateLongConstant

public static boolean appropriateLongConstant(Expression[] args,
                                              int iarg,
                                              InlineCalls visitor)

validateApplyArithOp

public static Expression validateApplyArithOp(ApplyExp exp,
                                              InlineCalls visitor,
                                              Type required,
                                              Procedure proc)

compile

public void compile(ApplyExp exp,
                    Compilation comp,
                    Target target)
Specified by:
compile in interface Inlineable

compileIntNum

public boolean compileIntNum(Expression arg1,
                             Expression arg2,
                             int kind1,
                             int kind2,
                             Compilation comp)

getReturnKind

public static int getReturnKind(int kind1,
                                int kind2,
                                int op)

getReturnKind

public int getReturnKind(Expression[] args)
This actually returns the "promoted argument type". The result kind is different for divide.


getReturnType

public Type getReturnType(Expression[] args)

validateApplyAdd

public static Expression validateApplyAdd(AddOp proc,
                                          ApplyExp exp,
                                          InlineCalls visitor)

validateApplyDiv

public static Expression validateApplyDiv(DivideOp proc,
                                          ApplyExp exp,
                                          InlineCalls visitor)

validateApplyNot

public static Expression validateApplyNot(ApplyExp exp,
                                          int kind,
                                          InlineCalls visitor)

validateApplyNumberCompare

public static Expression validateApplyNumberCompare(ApplyExp exp,
                                                    InlineCalls visitor,
                                                    Type required,
                                                    Procedure proc)

primitiveOpcode

public int primitiveOpcode()

pairwise

public static Expression pairwise(Procedure proc,
                                  Expression rproc,
                                  Expression[] args,
                                  InlineCalls visitor)
Convert (PROC A B C) to (PROC (PROC A B) C) etc.


validateApplyNumberPredicate

public static Expression validateApplyNumberPredicate(ApplyExp exp,
                                                      InlineCalls visitor,
                                                      Type required,
                                                      Procedure proc)