logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Nice/src/gnu/expr InstantiateProc.java,1.3,1.4 ConstructorExp.java,1.5,1.6 : msg#00097

Subject: Nice/src/gnu/expr InstantiateProc.java,1.3,1.4 ConstructorExp.java,1.5,1.6 ClassExp.java,1.16,1.17
Update of /cvsroot/nice/Nice/src/gnu/expr
In directory sc8-pr-cvs1:/tmp/cvs-serv16555/src/gnu/expr

Modified Files:
        InstantiateProc.java ConstructorExp.java ClassExp.java 
Log Message:
Load custom constructors form the bytecode of compiled packages.


Index: InstantiateProc.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/gnu/expr/InstantiateProc.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** InstantiateProc.java        14 Dec 2003 16:52:32 -0000      1.3
--- InstantiateProc.java        15 Dec 2003 02:40:16 -0000      1.4
***************
*** 27,31 ****
--- 27,37 ----
    public InstantiateProc (Method constructor)
    {
+     this(constructor, 0);
+   }
+ 
+   public InstantiateProc (Method constructor, int dummyArgs)
+   {
      this.constructor = constructor;
+     this.dummyArgs = dummyArgs;
    }
  
***************
*** 37,40 ****
--- 43,47 ----
    private Method constructor;
    private ConstructorExp method;
+   private int dummyArgs;
  
    public void compile (ApplyExp exp, Compilation comp, Target target)
***************
*** 56,61 ****
      // Add dummy arguments to match the bytecode constructor.
      if (method !=null)
!       for (int i = 0; i < method.dummyArgs; i++)
!         code.emitPushInt(0);
  
      code.emitInvokeSpecial(constructor);
--- 63,69 ----
      // Add dummy arguments to match the bytecode constructor.
      if (method !=null)
!       dummyArgs = method.dummyArgs;
!     for (int i = 0; i < dummyArgs; i++)
!       code.emitPushInt(0);
  
      code.emitInvokeSpecial(constructor);

Index: ConstructorExp.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/gnu/expr/ConstructorExp.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ConstructorExp.java 14 Dec 2003 16:52:32 -0000      1.5
--- ConstructorExp.java 15 Dec 2003 02:40:16 -0000      1.6
***************
*** 87,90 ****
--- 87,92 ----
        ("<init>", args, Type.void_type, Access.PUBLIC);
      primMethods = new Method[] { method };
+ 
+     addAttributes(method);
    }
  

Index: ClassExp.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/gnu/expr/ClassExp.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** ClassExp.java       27 Nov 2003 00:21:19 -0000      1.16
--- ClassExp.java       15 Dec 2003 02:40:16 -0000      1.17
***************
*** 100,104 ****
          Method m = instanceType.getDeclaredMethod
            (method.getName(), method.getArgTypes());
!         if (m != null)
            {
              m.eraseCode();
--- 100,104 ----
          Method m = instanceType.getDeclaredMethod
            (method.getName(), method.getArgTypes());
!         if (m != null && ! m.isConstructor())
            {
              m.eraseCode();




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/


<Prev in Thread] Current Thread [Next in Thread>