summaryrefslogtreecommitdiff
path: root/sources/scalac/backend/jvm/GenJVMBCELPhase.java
diff options
context:
space:
mode:
Diffstat (limited to 'sources/scalac/backend/jvm/GenJVMBCELPhase.java')
-rw-r--r--sources/scalac/backend/jvm/GenJVMBCELPhase.java45
1 files changed, 28 insertions, 17 deletions
diff --git a/sources/scalac/backend/jvm/GenJVMBCELPhase.java b/sources/scalac/backend/jvm/GenJVMBCELPhase.java
index 4ef402fd86..3d1b50a77e 100644
--- a/sources/scalac/backend/jvm/GenJVMBCELPhase.java
+++ b/sources/scalac/backend/jvm/GenJVMBCELPhase.java
@@ -9,31 +9,42 @@
package scalac.backend.jvm;
import scalac.Global;
-import scalac.Unit;
+import scalac.Phase;
import scalac.PhaseDescriptor;
-import scalac.ApplicationError;
+import scalac.Unit;
-public class GenJVMBCELPhase extends PhaseDescriptor {
+/**
+ * Phase to generate Java bytecodes using the BCEL library.
+ *
+ * @author Michel Schinz
+ * @version 1.0
+ */
- public String name () {
- return "genjvm-bcel";
- }
+public class GenJVMBCELPhase extends Phase {
- public String description () {
- return "generate JVM bytecodes";
- }
+ //########################################################################
+ // Private Fields
- public String taskDescription() {
- return "generated JVM code";
- }
+ /** The tree to code translator */
+ private final GenJVMBCEL translator;
+
+ //########################################################################
+ // Public Constructors
- public void apply(Global global) {
- for (int i = 0; i < global.units.length; i++)
- apply(global.units[i]);
+ /** Initializes this instance. */
+ public GenJVMBCELPhase(Global global, PhaseDescriptor descriptor) {
+ super(global, descriptor);
+ this.translator = new GenJVMBCEL(global);
}
- public void apply(Unit unit) {
- new GenJVMBCEL(unit.global).translate(unit);
+ //########################################################################
+ // Public Methods
+
+ /** Applies this phase to the given compilation units. */
+ public void apply(Unit[] units) {
+ for (int i = 0; i < units.length; i++) translator.translate(units[i]);
}
+
+ //########################################################################
}