[Bug 61] New: Allow simple static initializers in core classes

[email protected]
Newsgroups gmane.comp.java.vm.sablevm.bugs
Message-ID <[email protected]>
http://sablevm.org/bugs/show_bug.cgi?id=61

           Summary: Allow simple static initializers in core classes
           Product: SableVM
           Version: staging
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: default
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]


This problem currently touches these three classes:

java/lang/Class.java
java/lang/Throwable.java
java/io/Serializable.java

For compatibility with Sun's JDK classes define their serialVersionUID.
In these classes these fields, like:

  private static final long serialVersionUID = 3206093459760846163L;

are currently commeted out.  This is because currently used java compilers
generate static initalizers to initialize value of these fields while
SableVM does not allow some most basic classes to have any static initializers
that would need to be executed during bootstrap phase.  Such restrictive
approach has its reasons (there's no place to discuss it here).

The probable solution would be to allow execution of static initalizers
during bootstrap but only if they contain very basic bytecodes (i.e. no
method calls).  We could have a flag "early bootstrap" that would be
checked in prepare_code() to impose additional check on what bytecodes
are being prepared.

Etienne, what do you think?  Do you see any problems with such approach?



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are the QA contact for the bug, or are watching the QA contact.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.