SF.net SVN: jikesrvm:[15730] rvmroot/trunk/MMTk/harness/src/org/mmtk/ harness/lang

View: New views
1 Messages — Rating Filter:   Alert me  

SF.net SVN: jikesrvm:[15730] rvmroot/trunk/MMTk/harness/src/org/mmtk/ harness/lang

by rgarner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Revision: 15730
          http://jikesrvm.svn.sourceforge.net/jikesrvm/?rev=15730&view=rev
Author:   rgarner
Date:     2009-07-21 04:11:55 +0000 (Tue, 21 Jul 2009)

Log Message:
-----------
Refactor to remove duplication of data

Modified Paths:
--------------
    rvmroot/trunk/MMTk/harness/src/org/mmtk/harness/lang/Declaration.java
    rvmroot/trunk/MMTk/harness/src/org/mmtk/harness/lang/parser/SymbolTable.java

Modified: rvmroot/trunk/MMTk/harness/src/org/mmtk/harness/lang/Declaration.java
===================================================================
--- rvmroot/trunk/MMTk/harness/src/org/mmtk/harness/lang/Declaration.java 2009-07-21 03:59:52 UTC (rev 15729)
+++ rvmroot/trunk/MMTk/harness/src/org/mmtk/harness/lang/Declaration.java 2009-07-21 04:11:55 UTC (rev 15730)
@@ -23,22 +23,15 @@
   /** Name of the variable */
   private final Symbol symbol;
 
-  /** Initial value - actually holds the value for the lifetime of the variable */
-  private final Value initial;
-
   /** Stack frame slot */
   private final int slot;
 
   /**
    * Constructor
-   *
-   * @param name
-   * @param initial
-   * @param slot
+   * @param symbol The symbol to declare
    */
-  public Declaration(Symbol symbol, Value initial) {
+  public Declaration(Symbol symbol) {
     this.symbol = symbol;
-    this.initial = initial;
     this.slot = symbol.getLocation();
   }
 
@@ -51,7 +44,7 @@
   }
 
   public Value getInitial() {
-    return initial;
+    return symbol.getType().initialValue();
   }
 
   public int getSlot() {

Modified: rvmroot/trunk/MMTk/harness/src/org/mmtk/harness/lang/parser/SymbolTable.java
===================================================================
--- rvmroot/trunk/MMTk/harness/src/org/mmtk/harness/lang/parser/SymbolTable.java 2009-07-21 03:59:52 UTC (rev 15729)
+++ rvmroot/trunk/MMTk/harness/src/org/mmtk/harness/lang/parser/SymbolTable.java 2009-07-21 04:11:55 UTC (rev 15730)
@@ -80,7 +80,7 @@
       throw new RuntimeException("Symbol "+name+" already defined");
     Symbol symbol = new Symbol(this,name,type);
     table.put(name, symbol);
-    stackMap.add(new Declaration(symbol,type.initialValue()));
+    stackMap.add(new Declaration(symbol));
   }
 
   /**


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Jikesrvm-commits mailing list
Jikesrvm-commits@...
https://lists.sourceforge.net/lists/listinfo/jikesrvm-commits