From 13395dd946d5dd45c70c47a7ee6b651be2831152 Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Tue, 31 Jul 2012 02:24:58 +0200 Subject: [PATCH] merging with latest svn changes --- cygwinbuild/HowToBuild | 13 ++-- cygwinbuild/plugins.ext | 2 +- cygwinbuild/plugins.int | 2 +- macbuild/HowToBuild | 9 ++- macbuild/plugins.ext | 2 +- macbuild/plugins.int | 2 +- nsbuild/cygwinbuild/HowToBuild | 13 ++-- nsbuild/cygwinbuild/plugins.ext | 2 +- nsbuild/cygwinbuild/plugins.int | 2 +- nsbuild/macbuild/plugins.int | 2 +- nsbuild/unixbuild/HowToBuild | 2 + nsbuild/unixbuild/bld/plugins.ext | 2 +- nsbuild/unixbuild/bld/plugins.int | 2 +- nscogbuild/cygwinbuild/HowToBuild | 14 +++-- nscogbuild/cygwinbuild/plugins.ext | 2 +- nscogbuild/cygwinbuild/plugins.int | 2 +- nscogbuild/macbuild/plugins.int | 2 +- nscogbuild/unixbuild/HowToBuild | 4 +- nscogbuild/unixbuild/bld/mvm | 6 ++ nscogbuild/unixbuild/bld/plugins.ext | 2 +- nscogbuild/unixbuild/bld/plugins.int | 2 +- platforms/Cross/vm/dispdbg.h | 22 +++++++ platforms/Cross/vm/sqVirtualMachine.c | 39 ++++++++++++ platforms/Mac OS/vm/Developer/sqGnu.h | 61 +++++++++++++++++- platforms/Mac OS/vm/sqMacMain.c | 2 + platforms/Mac OS/vm/sqMacUIEventsUniversal.c | 2 + .../Mac OS/vm/sqMacUnixCommandLineInterface.c | 5 ++ platforms/unix/vm/sqGnu.h | 60 +++++++++++++++++- platforms/unix/vm/sqUnixITimerHeartbeat.c | 34 +++++++--- .../unix/vm/sqUnixITimerTickerHeartbeat.c | 34 +++++++--- platforms/unix/vm/sqUnixMain.c | 10 ++- platforms/win32/vm/sqGnu.h | 62 ++++++++++++++++++- platforms/win32/vm/sqWin32Intel.c | 10 ++- platforms/win32/vm/sqWin32Window.c | 3 +- scripts/mkvmarchives | 2 +- stackbuild/cygwinbuild/HowToBuild | 14 +++-- stackbuild/cygwinbuild/plugins.ext | 2 +- stackbuild/cygwinbuild/plugins.int | 2 +- stackbuild/macbuild/HowToBuild | 2 + stackbuild/macbuild/plugins.ext | 2 +- stackbuild/macbuild/plugins.int | 2 +- unixbuild/HowToBuild | 14 +++-- unixbuild/bld/mvm | 6 ++ unixbuild/bld/plugins.ext | 2 +- unixbuild/bld/plugins.int | 2 +- unixbuild/mtbld/mvm | 6 ++ unixbuild/mtbld/plugins.ext | 2 +- unixbuild/mtbld/plugins.int | 2 +- 48 files changed, 415 insertions(+), 78 deletions(-) diff --git a/cygwinbuild/HowToBuild b/cygwinbuild/HowToBuild index 0991b6c..52facc4 100644 --- a/cygwinbuild/HowToBuild +++ b/cygwinbuild/HowToBuild @@ -30,6 +30,8 @@ CYGWIN_NT-5.1 mcstalkerxp 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 Cygwin 4. At the end of this process you should have a brand new Croquet VM in the cygwinbuild/build/vm folder (make sure you copy Croquet.map along with it) +N.B. The plugin set is defined by plugins.ext and plugins.int in the build dir. + 3a. The cygwin makefile supports building three VM configurations, product, assert and debug, building product by default. To build a configuration simply type make configuration, e.g. @@ -64,9 +66,10 @@ need to first build bochs. WARNING: No one has tried to build the plugin on Win32. You are on your own but your efforts will be warmly welcomed. First check-out the processor simulator source tree containing Bochs: svn co http://www.squeakvm.org/svn/squeak/branches/Cog/processors -Then build (on the Mac the following works) - $ cd ROOT/processors/IA32/bochs +Then build the libraries winbochs/{cpu/libcpu.a,disasm/libdisasm.a,fpu/libfpu.a} + $ cd ROOT/processors/IA32/winbochs $ ./conf.COG - $ ./makeem - $ cd ROOT/macbuild/BochsIA32Plugin - $ xcodebuild + $ ../bochs/makeem +and build the plugin either via make (for the entire VM) or just + $ cd ROOT/cygwinbuild + $ make build/vm/BochsIA32Plugin.dll diff --git a/cygwinbuild/plugins.ext b/cygwinbuild/plugins.ext index b37379b..a72bb54 100644 --- a/cygwinbuild/plugins.ext +++ b/cygwinbuild/plugins.ext @@ -1,4 +1,4 @@ -# List of external plugins. +# Copied, perhaps edited, from ../src/examplePlugins.ext EXTERNAL_PLUGINS = \ BochsIA32Plugin \ SqueakFFIPrims \ diff --git a/cygwinbuild/plugins.int b/cygwinbuild/plugins.int index 18adf31..512cc49 100644 --- a/cygwinbuild/plugins.int +++ b/cygwinbuild/plugins.int @@ -1,4 +1,4 @@ -# Automatically generated makefile include for internal plugins +# Copied, perhaps edited, from ../src/examplePlugins.int INTERNAL_PLUGINS = \ ADPCMCodecPlugin \ AsynchFilePlugin \ diff --git a/macbuild/HowToBuild b/macbuild/HowToBuild index 42d443f..081427a 100644 --- a/macbuild/HowToBuild +++ b/macbuild/HowToBuild @@ -28,12 +28,15 @@ BochsIA32Plugin/BochsIA32Plugin.xcodeproj project and to build that you'll need to first build bochs. First check-out the processor simulator source tree containing Bochs: svn co http://www.squeakvm.org/svn/squeak/branches/Cog/processors -Then build using - $ cd ROOT/processors/IA32/bochs +Then build the libraries macbochs/{cpu/libcpu.a,disasm/libdisasm.a,fpu/libfpu.a} + $ cd ROOT/processors/IA32/macbochs $ ./conf.COG - $ ./makeem + $ ../bochs/makeem +Then build the plugin: $ cd ROOT/macbuild/BochsIA32Plugin $ xcodebuild 4. At the end of this process you should have a brand new Croquet.app in the macbuild folder (or Fast.app Assert.app and Debug.app if you've used mvm). + +N.B. The plugin set is defined by plugins.ext and plugins.int in the build dir. diff --git a/macbuild/plugins.ext b/macbuild/plugins.ext index 9bf3202..4f31874 100644 --- a/macbuild/plugins.ext +++ b/macbuild/plugins.ext @@ -1,4 +1,4 @@ -# Automatically generated makefile include for external plugins +# Copied, perhaps edited, from ../src/examplePlugins.ext EXTERNAL_PLUGINS = \ BochsIA32Plugin \ CroquetPlugin \ diff --git a/macbuild/plugins.int b/macbuild/plugins.int index 600aba4..ab7f8b9 100644 --- a/macbuild/plugins.int +++ b/macbuild/plugins.int @@ -1,4 +1,4 @@ -# Automatically generated makefile include for internal plugins +# Copied, perhaps edited, from ../src/examplePlugins.int INTERNAL_PLUGINS = \ ADPCMCodecPlugin \ AsynchFilePlugin \ diff --git a/nsbuild/cygwinbuild/HowToBuild b/nsbuild/cygwinbuild/HowToBuild index fd84bd8..6e37bab 100644 --- a/nsbuild/cygwinbuild/HowToBuild +++ b/nsbuild/cygwinbuild/HowToBuild @@ -30,6 +30,8 @@ CYGWIN_NT-5.1 mcstalkerxp 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 Cygwin 4. At the end of this process you should have a brand new Croquet VM in the cygwinbuild/build/vm folder (make sure you copy Croquet.map along with it) +N.B. The plugin set is defined by plugins.ext and plugins.int in the build dir. + 3a. The cygwin makefile supports building three VM configurations, product, assert and debug, building product by default. To build a configuration simply type make configuration, e.g. @@ -64,9 +66,10 @@ need to first build bochs. WARNING: No one has tried to build the plugin on Win32. You are on your own but your efforts will be warmly welcomed. First check-out the processor simulator source tree containing Bochs: svn co http://www.squeakvm.org/svn/squeak/branches/Cog/processors -Then build (on the Mac the following works) - $ cd ROOT/processors/IA32/bochs +Then build the libraries winbochs/{cpu/libcpu.a,disasm/libdisasm.a,fpu/libfpu.a} + $ cd ROOT/processors/IA32/winbochs $ ./conf.COG - $ ./makeem - $ cd ROOT/macbuild/BochsIA32Plugin - $ xcodebuild + $ ../bochs/makeem +and build the plugin either via make (for the entire VM) or just + $ cd ROOT/nsbuild/cygwinbuild + $ make build/vm/BochsIA32Plugin.dll diff --git a/nsbuild/cygwinbuild/plugins.ext b/nsbuild/cygwinbuild/plugins.ext index 61b13b3..24e7c7b 100644 --- a/nsbuild/cygwinbuild/plugins.ext +++ b/nsbuild/cygwinbuild/plugins.ext @@ -1,2 +1,2 @@ -# List of external plugins. +# Copied, perhaps edited, from ../../nssrc/examplePlugins.ext EXTERNAL_PLUGINS = diff --git a/nsbuild/cygwinbuild/plugins.int b/nsbuild/cygwinbuild/plugins.int index 5a57e8f..393383c 100644 --- a/nsbuild/cygwinbuild/plugins.int +++ b/nsbuild/cygwinbuild/plugins.int @@ -1,4 +1,4 @@ -# Automatically generated makefile include for internal plugins +# Copied, perhaps edited, from ../../nssrc/examplePlugins.int INTERNAL_PLUGINS = \ AsynchFilePlugin \ BMPReadWriterPlugin \ diff --git a/nsbuild/macbuild/plugins.int b/nsbuild/macbuild/plugins.int index 2631618..37004c8 100644 --- a/nsbuild/macbuild/plugins.int +++ b/nsbuild/macbuild/plugins.int @@ -1,4 +1,4 @@ -# Automatically generated makefile include for external plugins +# Copied, perhaps edited, from ../../nssrc/examplePlugins.int INTERNAL_PLUGINS = \ AsynchFilePlugin \ BMPReadWriterPlugin \ diff --git a/nsbuild/unixbuild/HowToBuild b/nsbuild/unixbuild/HowToBuild index f29e6f6..31f6198 100644 --- a/nsbuild/unixbuild/HowToBuild +++ b/nsbuild/unixbuild/HowToBuild @@ -23,6 +23,8 @@ How to build the Newspeak VM on Unix 4. At the end of it you'll get a new VM in the path provided via -prefix +N.B. The plugin set is defined by plugins.ext and plugins.int in the build dir. + 3a. For an assert-enabled VM do ../../../platforms/unix/config/configure --without-vm-display-fbdev --without-npsqueak --with-src=nssrc --disable-cogit CFLAGS="-g -O1 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNO_VM_PROFILE=1 -DDEBUGVM=0" LIBS=-lpthread diff --git a/nsbuild/unixbuild/bld/plugins.ext b/nsbuild/unixbuild/bld/plugins.ext index 5ecf350..557812e 100644 --- a/nsbuild/unixbuild/bld/plugins.ext +++ b/nsbuild/unixbuild/bld/plugins.ext @@ -1,2 +1,2 @@ -# List of external plugins. +# Copied, perhaps edited, from ../../../nssrc/examplePlugins.ext EXTERNAL_PLUGINS = \ diff --git a/nsbuild/unixbuild/bld/plugins.int b/nsbuild/unixbuild/bld/plugins.int index 7865868..7db5065 100644 --- a/nsbuild/unixbuild/bld/plugins.int +++ b/nsbuild/unixbuild/bld/plugins.int @@ -1,4 +1,4 @@ -# Automatically generated makefile include for external plugins +# Copied, perhaps edited, from ../../../nssrc/examplePlugins.int INTERNAL_PLUGINS = \ AsynchFilePlugin \ BMPReadWriterPlugin \ diff --git a/nscogbuild/cygwinbuild/HowToBuild b/nscogbuild/cygwinbuild/HowToBuild index fd84bd8..254095e 100644 --- a/nscogbuild/cygwinbuild/HowToBuild +++ b/nscogbuild/cygwinbuild/HowToBuild @@ -30,6 +30,9 @@ CYGWIN_NT-5.1 mcstalkerxp 1.5.24(0.156/4/2) 2007-01-31 10:57 i686 Cygwin 4. At the end of this process you should have a brand new Croquet VM in the cygwinbuild/build/vm folder (make sure you copy Croquet.map along with it) +N.B. The plugin set is defined by plugins.ext and plugins.int in the build dir. + + 3a. The cygwin makefile supports building three VM configurations, product, assert and debug, building product by default. To build a configuration simply type make configuration, e.g. @@ -64,9 +67,10 @@ need to first build bochs. WARNING: No one has tried to build the plugin on Win32. You are on your own but your efforts will be warmly welcomed. First check-out the processor simulator source tree containing Bochs: svn co http://www.squeakvm.org/svn/squeak/branches/Cog/processors -Then build (on the Mac the following works) - $ cd ROOT/processors/IA32/bochs +Then build the libraries winbochs/{cpu/libcpu.a,disasm/libdisasm.a,fpu/libfpu.a} + $ cd ROOT/processors/IA32/winbochs $ ./conf.COG - $ ./makeem - $ cd ROOT/macbuild/BochsIA32Plugin - $ xcodebuild + $ ../bochs/makeem +and build the plugin either via make (for the entire VM) or just + $ cd ROOT/nscogbuild/cygwinbuild + $ make build/vm/BochsIA32Plugin.dll diff --git a/nscogbuild/cygwinbuild/plugins.ext b/nscogbuild/cygwinbuild/plugins.ext index 61b13b3..e5ec84c 100644 --- a/nscogbuild/cygwinbuild/plugins.ext +++ b/nscogbuild/cygwinbuild/plugins.ext @@ -1,2 +1,2 @@ -# List of external plugins. +# Copied, perhaps edited, from ../../nscogsrc/examplePlugins.ext EXTERNAL_PLUGINS = diff --git a/nscogbuild/cygwinbuild/plugins.int b/nscogbuild/cygwinbuild/plugins.int index 5a57e8f..76d2279 100644 --- a/nscogbuild/cygwinbuild/plugins.int +++ b/nscogbuild/cygwinbuild/plugins.int @@ -1,4 +1,4 @@ -# Automatically generated makefile include for internal plugins +# Copied, perhaps edited, from ../../nscogsrc/examplePlugins.int INTERNAL_PLUGINS = \ AsynchFilePlugin \ BMPReadWriterPlugin \ diff --git a/nscogbuild/macbuild/plugins.int b/nscogbuild/macbuild/plugins.int index 2631618..ca63592 100644 --- a/nscogbuild/macbuild/plugins.int +++ b/nscogbuild/macbuild/plugins.int @@ -1,4 +1,4 @@ -# Automatically generated makefile include for external plugins +# Copied, perhaps edited, from ../../nscogsrc/examplePlugins.int INTERNAL_PLUGINS = \ AsynchFilePlugin \ BMPReadWriterPlugin \ diff --git a/nscogbuild/unixbuild/HowToBuild b/nscogbuild/unixbuild/HowToBuild index f3a7fd6..f780ee8 100644 --- a/nscogbuild/unixbuild/HowToBuild +++ b/nscogbuild/unixbuild/HowToBuild @@ -15,7 +15,7 @@ How to build the Newspeak VM on Unix reading this in unixbuild its likely you've already got the sources) svn co http://www.squeakvm.org/svn/squeak/branches/Cog/platforms svn co http://www.squeakvm.org/svn/squeak/branches/Cog/src - svn co http://www.squeakvm.org/svn/squeak/branches/Cog/nsbuild + svn co http://www.squeakvm.org/svn/squeak/branches/Cog/nscogbuild 3. Open a shell, cd into the unixbuild/bld directory and execute ../../../platforms/unix/config/configure --with-src=nscogsrc CFLAGS="-g -O2 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1 -DDEBUGVM=0" LIBS="-lpthread -luuid" make install prefix=WhereYouWantTheVmToGo @@ -25,6 +25,8 @@ How to build the Newspeak VM on Unix 4. At the end of it you'll get a new VM in the path provided via -prefix +N.B. The plugin set is defined by plugins.ext and plugins.int in the build dir. + 3a. For an assert-enabled VM do ../../../platforms/unix/config/configure --without-vm-display-fbdev --without-npsqueak --with-src=nscogsrc CFLAGS="-g -O1 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1 -DDEBUGVM=0" LIBS="-lpthread -luuid" diff --git a/nscogbuild/unixbuild/bld/mvm b/nscogbuild/unixbuild/bld/mvm index 2c3b559..3102d2a 100755 --- a/nscogbuild/unixbuild/bld/mvm +++ b/nscogbuild/unixbuild/bld/mvm @@ -5,6 +5,12 @@ case `gcc -v 2>&1 | grep version | sed 's/gcc version *//'` in *) OPT=-O2;; esac +echo -n "clean? " +read a +case $a in +n|no|N|NO) echo "ok but this isn't safe!!";; +*) make reallyclean +esac test -f config.h || ../../../platforms/unix/config/configure --with-src=nscogsrc --without-vm-display-fbdev --without-npsqueak CFLAGS="-g $OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1 -DDEBUGVM=0" LIBS="-lpthread -luuid" ../../../scripts/nukeversion rm -rf ../../../nsvmlinux diff --git a/nscogbuild/unixbuild/bld/plugins.ext b/nscogbuild/unixbuild/bld/plugins.ext index 5ecf350..f4c7ea4 100644 --- a/nscogbuild/unixbuild/bld/plugins.ext +++ b/nscogbuild/unixbuild/bld/plugins.ext @@ -1,2 +1,2 @@ -# List of external plugins. +# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.ext EXTERNAL_PLUGINS = \ diff --git a/nscogbuild/unixbuild/bld/plugins.int b/nscogbuild/unixbuild/bld/plugins.int index 7865868..3c5b0f7 100644 --- a/nscogbuild/unixbuild/bld/plugins.int +++ b/nscogbuild/unixbuild/bld/plugins.int @@ -1,4 +1,4 @@ -# Automatically generated makefile include for external plugins +# Copied, perhaps edited, from ../../../nscogsrc/examplePlugins.int INTERNAL_PLUGINS = \ AsynchFilePlugin \ BMPReadWriterPlugin \ diff --git a/platforms/Cross/vm/dispdbg.h b/platforms/Cross/vm/dispdbg.h index 51feab7..bda8f59 100644 --- a/platforms/Cross/vm/dispdbg.h +++ b/platforms/Cross/vm/dispdbg.h @@ -134,6 +134,28 @@ warning("invalidInstructionPointerinMethod"); \ if (sendTrace > 1) printCallStack(); \ } while (0) +#elif MULTIPLEBYTECODESETS /* maintain byteCount & check for valid instruction pointer */ +# if defined(SQ_USE_GLOBAL_STRUCT) /* define only in interpreter */ +static FILE *bct = 0; +void openBytecodeTraceFile(char *fn) +{ if (!(bct = fopen(fn,"r"))) perror("fopen"); } +void closeBytecodeTraceFile() { if (bct) { fclose(bct); bct = 0; } } +# endif +# define bytecodeDispatchDebugHook() do { char line[64], expected[64]; \ + /* print byteCount pc byteCode(hex) stackPtr */ \ + sprintf(expected, "%ld: %d %d(%x) %d %s\n", \ + ++GIV(byteCount), localIP-GIV(method)-3, currentBytecode, currentBytecode, \ + (localFP-localSP)/sizeof(sqInt)-5, bytecodeNameTable[currentBytecode]); \ + printf(expected); \ + if (bct) { \ + fgets(line, sizeof(line) - 1, bct); \ + if (strcmp(line,expected)) \ + warning("bytecode trace mismatch"); \ + } \ + if (0) printFrameWithSP(localFP,localSP); \ + if (!ValidInstructionPointerCheck()) \ + warning("invalidInstructionPointerinMethod"); \ + } while (0) #elif 0 /* print current frame & instruction pointer on every bytecode. */ # define bytecodeDispatchDebugHook() do { \ printFrameWithSP(localFP,localSP); \ diff --git a/platforms/Cross/vm/sqVirtualMachine.c b/platforms/Cross/vm/sqVirtualMachine.c index 5890ca5..1834e5c 100755 --- a/platforms/Cross/vm/sqVirtualMachine.c +++ b/platforms/Cross/vm/sqVirtualMachine.c @@ -560,3 +560,42 @@ popOutputFile() } *stdout = stdoutStack[stdoutStackIdx--]; } + +void +printPhaseTime(int phase) +{ + static int printTimes; + static usqLong lastusecs; + usqLong nowusecs, usecs; + + if (phase == 1) { + time_t nowt; + struct tm nowtm; + printTimes = 1; + nowt = time(0); + nowtm = *localtime(&nowt); + printf("started at %s", asctime(&nowtm)); + lastusecs = ioUTCMicrosecondsNow(); + return; + } + + if (!printTimes) return; + + nowusecs = ioUTCMicrosecondsNow(); + usecs = nowusecs - lastusecs; + lastusecs = nowusecs; +#define m 1000000ULL +#define k 1000ULL +#define ul(v) (unsigned long)(v) + if (phase == 2) + printf("loaded in %lu.%03lus\n", ul(usecs/m), ul((usecs % m + k/2)/k)); + if (phase == 3) { + printTimes = 0; /* avoid repeated printing if error during exit */ + if (usecs >= 1ULL<<32) + printf("ran for a long time\n"); + else + printf("ran for %lu.%03lus\n", ul(usecs/m), ul((usecs % m + k/2)/k)); + } +#undef m +#undef k +} diff --git a/platforms/Mac OS/vm/Developer/sqGnu.h b/platforms/Mac OS/vm/Developer/sqGnu.h index 983d27a..75cfbeb 100644 --- a/platforms/Mac OS/vm/Developer/sqGnu.h +++ b/platforms/Mac OS/vm/Developer/sqGnu.h @@ -54,7 +54,65 @@ #define PPC_REG_JUMP #endif #define PRIM_DISPATCH goto *jumpTable[GIV(primitiveIndex)] -#define JUMP_TABLE \ + +#if MULTIPLEBYTECODESETS +# define JUMP_TABLE \ + static void *jumpTable[512]= { \ + &&_0, &&_1, &&_2, &&_3, &&_4, &&_5, &&_6, &&_7, &&_8, &&_9, \ + &&_10, &&_11, &&_12, &&_13, &&_14, &&_15, &&_16, &&_17, &&_18, &&_19, \ + &&_20, &&_21, &&_22, &&_23, &&_24, &&_25, &&_26, &&_27, &&_28, &&_29, \ + &&_30, &&_31, &&_32, &&_33, &&_34, &&_35, &&_36, &&_37, &&_38, &&_39, \ + &&_40, &&_41, &&_42, &&_43, &&_44, &&_45, &&_46, &&_47, &&_48, &&_49, \ + &&_50, &&_51, &&_52, &&_53, &&_54, &&_55, &&_56, &&_57, &&_58, &&_59, \ + &&_60, &&_61, &&_62, &&_63, &&_64, &&_65, &&_66, &&_67, &&_68, &&_69, \ + &&_70, &&_71, &&_72, &&_73, &&_74, &&_75, &&_76, &&_77, &&_78, &&_79, \ + &&_80, &&_81, &&_82, &&_83, &&_84, &&_85, &&_86, &&_87, &&_88, &&_89, \ + &&_90, &&_91, &&_92, &&_93, &&_94, &&_95, &&_96, &&_97, &&_98, &&_99, \ + &&_100, &&_101, &&_102, &&_103, &&_104, &&_105, &&_106, &&_107, &&_108, &&_109, \ + &&_110, &&_111, &&_112, &&_113, &&_114, &&_115, &&_116, &&_117, &&_118, &&_119, \ + &&_120, &&_121, &&_122, &&_123, &&_124, &&_125, &&_126, &&_127, &&_128, &&_129, \ + &&_130, &&_131, &&_132, &&_133, &&_134, &&_135, &&_136, &&_137, &&_138, &&_139, \ + &&_140, &&_141, &&_142, &&_143, &&_144, &&_145, &&_146, &&_147, &&_148, &&_149, \ + &&_150, &&_151, &&_152, &&_153, &&_154, &&_155, &&_156, &&_157, &&_158, &&_159, \ + &&_160, &&_161, &&_162, &&_163, &&_164, &&_165, &&_166, &&_167, &&_168, &&_169, \ + &&_170, &&_171, &&_172, &&_173, &&_174, &&_175, &&_176, &&_177, &&_178, &&_179, \ + &&_180, &&_181, &&_182, &&_183, &&_184, &&_185, &&_186, &&_187, &&_188, &&_189, \ + &&_190, &&_191, &&_192, &&_193, &&_194, &&_195, &&_196, &&_197, &&_198, &&_199, \ + &&_200, &&_201, &&_202, &&_203, &&_204, &&_205, &&_206, &&_207, &&_208, &&_209, \ + &&_210, &&_211, &&_212, &&_213, &&_214, &&_215, &&_216, &&_217, &&_218, &&_219, \ + &&_220, &&_221, &&_222, &&_223, &&_224, &&_225, &&_226, &&_227, &&_228, &&_229, \ + &&_230, &&_231, &&_232, &&_233, &&_234, &&_235, &&_236, &&_237, &&_238, &&_239, \ + &&_240, &&_241, &&_242, &&_243, &&_244, &&_245, &&_246, &&_247, &&_248, &&_249, \ + &&_250, &&_251, &&_252, &&_253, &&_254, &&_255, &&_256, &&_257, &&_258, &&_259, \ + &&_260, &&_261, &&_262, &&_263, &&_264, &&_265, &&_266, &&_267, &&_268, &&_269, \ + &&_270, &&_271, &&_272, &&_273, &&_274, &&_275, &&_276, &&_277, &&_278, &&_279, \ + &&_280, &&_281, &&_282, &&_283, &&_284, &&_285, &&_286, &&_287, &&_288, &&_289, \ + &&_290, &&_291, &&_292, &&_293, &&_294, &&_295, &&_296, &&_297, &&_298, &&_299, \ + &&_300, &&_301, &&_302, &&_303, &&_304, &&_305, &&_306, &&_307, &&_308, &&_309, \ + &&_310, &&_311, &&_312, &&_313, &&_314, &&_315, &&_316, &&_317, &&_318, &&_319, \ + &&_320, &&_321, &&_322, &&_323, &&_324, &&_325, &&_326, &&_327, &&_328, &&_329, \ + &&_330, &&_331, &&_332, &&_333, &&_334, &&_335, &&_336, &&_337, &&_338, &&_339, \ + &&_340, &&_341, &&_342, &&_343, &&_344, &&_345, &&_346, &&_347, &&_348, &&_349, \ + &&_350, &&_351, &&_352, &&_353, &&_354, &&_355, &&_356, &&_357, &&_358, &&_359, \ + &&_360, &&_361, &&_362, &&_363, &&_364, &&_365, &&_366, &&_367, &&_368, &&_369, \ + &&_370, &&_371, &&_372, &&_373, &&_374, &&_375, &&_376, &&_377, &&_378, &&_379, \ + &&_380, &&_381, &&_382, &&_383, &&_384, &&_385, &&_386, &&_387, &&_388, &&_389, \ + &&_390, &&_391, &&_392, &&_393, &&_394, &&_395, &&_396, &&_397, &&_398, &&_399, \ + &&_400, &&_401, &&_402, &&_403, &&_404, &&_405, &&_406, &&_407, &&_408, &&_409, \ + &&_410, &&_411, &&_412, &&_413, &&_414, &&_415, &&_416, &&_417, &&_418, &&_419, \ + &&_420, &&_421, &&_422, &&_423, &&_424, &&_425, &&_426, &&_427, &&_428, &&_429, \ + &&_430, &&_431, &&_432, &&_433, &&_434, &&_435, &&_436, &&_437, &&_438, &&_439, \ + &&_440, &&_441, &&_442, &&_443, &&_444, &&_445, &&_446, &&_447, &&_448, &&_449, \ + &&_450, &&_451, &&_452, &&_453, &&_454, &&_455, &&_456, &&_457, &&_458, &&_459, \ + &&_460, &&_461, &&_462, &&_463, &&_464, &&_465, &&_466, &&_467, &&_468, &&_469, \ + &&_470, &&_471, &&_472, &&_473, &&_474, &&_475, &&_476, &&_477, &&_478, &&_479, \ + &&_480, &&_481, &&_482, &&_483, &&_484, &&_485, &&_486, &&_487, &&_488, &&_489, \ + &&_490, &&_491, &&_492, &&_493, &&_494, &&_495, &&_496, &&_497, &&_498, &&_499, \ + &&_500, &&_501, &&_502, &&_503, &&_504, &&_505, &&_506, &&_507, &&_508, &&_509, \ + &&_510, &&_511 \ + } PPC_REG_JUMP; +#else /* MULTIPLEBYTECODESETS */ +# define JUMP_TABLE \ void *jumpTable[256]= { \ &&_0, &&_1, &&_2, &&_3, &&_4, &&_5, &&_6, &&_7, &&_8, &&_9, \ &&_10, &&_11, &&_12, &&_13, &&_14, &&_15, &&_16, &&_17, &&_18, &&_19, \ @@ -83,6 +141,7 @@ &&_240, &&_241, &&_242, &&_243, &&_244, &&_245, &&_246, &&_247, &&_248, &&_249, \ &&_250, &&_251, &&_252, &&_253, &&_254, &&_255 \ } PPC_REG_JUMP; +#endif /* MULTIPLEBYTECODESETS */ #define PRIM_TABLE \ static void *jumpTable[700]= { \ &&_0, &&_1, &&_2, &&_3, &&_4, &&_5, &&_6, &&_7, &&_8, &&_9, \ diff --git a/platforms/Mac OS/vm/sqMacMain.c b/platforms/Mac OS/vm/sqMacMain.c index 95c949c..558b7a9 100644 --- a/platforms/Mac OS/vm/sqMacMain.c +++ b/platforms/Mac OS/vm/sqMacMain.c @@ -526,6 +526,8 @@ int ioExit(void) { return ioExitWithErrorCode(0); } sqInt ioExitWithErrorCode(int ec) { + extern void printPhaseTime(int); + printPhaseTime(3); UnloadScrap(); ioShutdownAllModules(); if (!gSqueakHeadless || gSqueakBrowserWasHeadlessButMadeFullScreen) diff --git a/platforms/Mac OS/vm/sqMacUIEventsUniversal.c b/platforms/Mac OS/vm/sqMacUIEventsUniversal.c index 53aec82..be98297 100644 --- a/platforms/Mac OS/vm/sqMacUIEventsUniversal.c +++ b/platforms/Mac OS/vm/sqMacUIEventsUniversal.c @@ -1493,7 +1493,9 @@ EventLoopEventHandler(EventHandlerCallRef inHandlerCallRef, { // Run our event loop until quitNow is set. #pragma unused(inHandlerCallRef,inEvent,inUserData) + extern void printPhaseTime(int); SetUpCarbonEvent(); + printPhaseTime(2); interpret(); //Note the application under carbon event mgr starts running here return 0; } diff --git a/platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c b/platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c index 32d3184..59f094b 100644 --- a/platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c +++ b/platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c @@ -164,6 +164,10 @@ static int parseArgument(int argc, char **argv) extern int blockOnError; blockOnError = true; return 1; } + else if (!strcmp(argv[0], "-timephases")) { + extern void printPhaseTime(int); + printPhaseTime(1); + return 1; } #if (STACKVM || NewspeakVM) && !COGVM else if (!strcmp(argv[0], "-sendtrace")) { extern sqInt sendTrace; sendTrace = 1; return 1; } #endif @@ -272,6 +276,7 @@ static void printUsage(void) printf("\nCommon