JavaVM.st
changeset 3048 74535b57b370
parent 2998 220f5d25933a
child 3056 fd92dea7b142
equal deleted inserted replaced
3047:3ac5c037b13d 3048:74535b57b370
  1929     "Modified: / 20-11-2013 / 23:43:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1929     "Modified: / 20-11-2013 / 23:43:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1930 !
  1930 !
  1931 
  1931 
  1932 initializeVM
  1932 initializeVM
  1933 
  1933 
       
  1934     | booter blocker |
       
  1935 
  1934     OperatingSystem initResources.
  1936     OperatingSystem initResources.
  1935 
  1937 
  1936     Java initializeRelease.
  1938     Java initializeRelease.
  1937 
  1939 
  1938     "Java requires a huge stack. Change default to 16 MB.
  1940     "Java requires a huge stack. Change default to 16 MB.
  1978     "/ force re-resolving;
  1980     "/ force re-resolving;
  1979     "/ otherwise, class-inits would not be called
  1981     "/ otherwise, class-inits would not be called
  1980     "/ by resolver ... (sigh)
  1982     "/ by resolver ... (sigh)
  1981 
  1983 
  1982     JavaNativeMethod flushAllCachedNativeMethods.
  1984     JavaNativeMethod flushAllCachedNativeMethods.
  1983     JavaMethod
  1985     JavaMethod allSubInstancesDo: [ :m |
  1984         allSubInstancesDo: [
       
  1985             :m |
       
  1986             m checked: false.
  1986             m checked: false.
  1987             m code: nil.
  1987             m code: nil.
  1988         ].
  1988     ].
  1989     ObjectMemory flushCaches.
  1989     ObjectMemory flushCaches.
  1990 
  1990 
  1991     "/ sigh - must flush inline caches.
  1991     "/ sigh - must flush inline caches.
  1992 
  1992 
  1993     JavaClass startRememberingOrderOfClassInits.
  1993     JavaClass startRememberingOrderOfClassInits.
  2010     self initializeClassReader.
  2010     self initializeClassReader.
  2011     self initializeOpenFileTable.
  2011     self initializeOpenFileTable.
  2012     self initializeReflection.
  2012     self initializeReflection.
  2013     self initializeBaseClasses.
  2013     self initializeBaseClasses.
  2014     self initializePrimitiveClasses.
  2014     self initializePrimitiveClasses.
  2015     Java initSystemClass.
  2015 
  2016     Java initializeCurrentThread.
  2016     "/ Initialization spawns couple of new threads, namely
  2017     self initializeSystemClassLoader.
  2017     "/ finalization handler and signal handler. Those processes
       
  2018     "/ should form their own new process group. 
       
  2019     blocker := Semaphore new.
       
  2020     booter := [
       
  2021         Java initSystemClass.
       
  2022         Java initializeCurrentThread.
       
  2023         self initializeSystemClassLoader.
       
  2024         FinalizationLobby startFinalizationProcessAt: 5.
       
  2025         blocker signal.
       
  2026     ] newProcess.
       
  2027     booter beGroupLeader.
       
  2028     booter resume.
       
  2029     blocker wait.
       
  2030 
  2018     ObjectMemory addDependent: self.
  2031     ObjectMemory addDependent: self.
  2019     StartupTime := OperatingSystem getOSTime.
  2032     StartupTime := OperatingSystem getOSTime.
  2020     FinalizationLobby startFinalizationProcessAt: 5.
  2033 
  2021 
  2034 
  2022 
  2035 
  2023     JavaNativeMethod allInstancesDo:[:e|e nCallsReset ].
  2036     JavaNativeMethod allInstancesDo:[:e|e nCallsReset ].
  2024 
  2037 
  2025     "
  2038     "
  2029     "Created: / 03-01-1998 / 21:29:09 / cg"
  2042     "Created: / 03-01-1998 / 21:29:09 / cg"
  2030     "Modified: / 14-12-1999 / 18:58:56 / cg"
  2043     "Modified: / 14-12-1999 / 18:58:56 / cg"
  2031     "Modified: / 15-10-2010 / 15:27:45 / Jan Kurs <kurs.jan@post.cz>"
  2044     "Modified: / 15-10-2010 / 15:27:45 / Jan Kurs <kurs.jan@post.cz>"
  2032     "Modified: / 24-02-2012 / 13:59:29 / Marcel Hlopko <hlopik@gmail.com>"
  2045     "Modified: / 24-02-2012 / 13:59:29 / Marcel Hlopko <hlopik@gmail.com>"
  2033     "Modified: / 24-02-2012 / 14:37:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
  2046     "Modified: / 24-02-2012 / 14:37:06 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
  2034     "Modified: / 09-12-2013 / 23:22:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2047     "Modified: / 21-03-2014 / 12:38:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2035 !
  2048 !
  2036 
  2049 
  2037 initializeVMIfNoEventThreadRunning
  2050 initializeVMIfNoEventThreadRunning
  2038     |uClass updater p|
  2051     |uClass updater p|
  2039 
  2052