aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/compiler
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2004-08-02 18:50:41 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2004-08-02 18:50:41 +0000
commit3b946e08d56d6f0327ef5d501f9f2c5363e0f544 (patch)
tree9897b7bf5d2e34b26c27a6a5351fa8572ff800f9 /src/main/javassist/compiler
parentf4a78cf275e5a1a8f81fed70d73f6273f6f9150f (diff)
downloadjavassist-3b946e08d56d6f0327ef5d501f9f2c5363e0f544.tar.gz
javassist-3b946e08d56d6f0327ef5d501f9f2c5363e0f544.zip
javassist.expr.NewArray has been implemented.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@120 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/compiler')
-rw-r--r--src/main/javassist/compiler/Javac.java8
-rw-r--r--src/main/javassist/compiler/JvstCodeGen.java16
2 files changed, 19 insertions, 5 deletions
diff --git a/src/main/javassist/compiler/Javac.java b/src/main/javassist/compiler/Javac.java
index 216d0198..67d0cef5 100644
--- a/src/main/javassist/compiler/Javac.java
+++ b/src/main/javassist/compiler/Javac.java
@@ -323,6 +323,7 @@ public class Javac {
* parameters. $args represents an array of all the parameters.
* It also makes $$ available as a parameter list of method call.
* $0 can represent a local variable other than THIS (variable 0).
+ * $class is also made available.
*
* <p>This must be called before calling <code>compileStmnt()</code> and
* <code>compileExpr()</code>. The correct value of
@@ -332,6 +333,8 @@ public class Javac {
* @param varNo the register number of $0 (use0 is true)
* or $1 (otherwise).
* @param target the type of $0 (it can be null if use0 is false).
+ * It is used as the name of the type represented
+ * by $class.
* @param isStatic true if the method in which the compiled bytecode
* is embedded is static.
*/
@@ -345,14 +348,17 @@ public class Javac {
/**
* Prepares to use cast $r, $w, $_, and $type.
+ * $type is made to represent the specified return type.
* It also enables to write a return statement with a return value
* for void method.
*
* <p>If the return type is void, ($r) does nothing.
* The type of $_ is java.lang.Object.
*
+ * @param type the return type.
* @param useResultVar true if $_ is used.
* @return -1 or the variable index assigned to $_.
+ * @see #recordType(CtClass)
*/
public int recordReturnType(CtClass type, boolean useResultVar)
throws CompileError
@@ -365,6 +371,8 @@ public class Javac {
/**
* Prepares to use $type. Note that recordReturnType() overwrites
* the value of $type.
+ *
+ * @param t the type represented by $type.
*/
public void recordType(CtClass t) {
gen.recordType(t);
diff --git a/src/main/javassist/compiler/JvstCodeGen.java b/src/main/javassist/compiler/JvstCodeGen.java
index 6c78f477..6800a9c8 100644
--- a/src/main/javassist/compiler/JvstCodeGen.java
+++ b/src/main/javassist/compiler/JvstCodeGen.java
@@ -458,7 +458,7 @@ public class JvstCodeGen extends MemberCodeGen {
}
/**
- * Makes method parameters $0, $1, ..., $args, and $$ available.
+ * Makes method parameters $0, $1, ..., $args, $$, and $class available.
* $0 is equivalent to THIS if the method is not static. Otherwise,
* if the method is static, then $0 is not available.
*/
@@ -472,15 +472,20 @@ public class JvstCodeGen extends MemberCodeGen {
}
/**
- * Makes method parameters $0, $1, ..., $args, and $$ available.
+ * Makes method parameters $0, $1, ..., $args, $$, and $class available.
* $0 is available only if use0 is true. It might not be equivalent
* to THIS.
*
- * @paaram use0 true if $0 is used.
+ * @param params the parameter types (the types of $1, $2, ..)
+ * @param prefix it must be "$" (the first letter of $0, $1, ...)
+ * @param paramVarName it must be "$args"
+ * @param paramsName it must be "$$"
+ * @param use0 true if $0 is used.
* @param paramBase the register number of $0 (use0 is true)
* or $1 (otherwise).
* @param target the class of $0. If use0 is false, target
- * can be null.
+ * can be null. The value of "target" is also used
+ * as the name of the type represented by $class.
* @param isStatic true if the method in which the compiled bytecode
* is embedded is static.
*/
@@ -499,7 +504,8 @@ public class JvstCodeGen extends MemberCodeGen {
paramVarBase = paramBase;
useParam0 = use0;
- param0Type = MemberResolver.jvmToJavaName(target);
+ if (target != null)
+ param0Type = MemberResolver.jvmToJavaName(target);
inStaticMethod = isStatic;
varNo = paramBase;