[Vm-dev] platforms/unix/vm *.c vs platform and build type

Eliot Miranda eliot.miranda at gmail.com
Sun May 29 02:26:01 UTC 2016


Hi Tim,

On Sat, May 28, 2016 at 6:43 PM, gettimothy <gettimothy at zoho.com> wrote:

>
> Does a matrix exist that maps
> ls -1 Cog/platforms/unix/vm/*.c
> aio.c
> debug.c
> dlfcn-dyld.c
> mac-alias.c
> osExports.c
> sqUnixCharConv.c
> sqUnixEvent.c
> sqUnixExternalPrims.c
> sqUnixHeartbeat.c
> sqUnixITimerHeartbeat.c
> sqUnixITimerTickerHeartbeat.c
> sqUnixMain.c
> sqUnixMemory.c
> sqUnixSpurMemory.c
> sqUnixThreads.c
> sqUnixVMProfile.c
>
> to build type and platform?
>
> If not, I will assemble one by hand, but I don't want to duplicate work
> that has already been done.
>
> For example...
>
> linux32x86 squeak.cog.v3 builds fine with sqUnixMemory.c however
> squeak.cog.spur requires sqUnixSpurMemory.c
>
> I suspect all the relationships are encoded in the configure and mvm
> scripts. If they are documented elsewhere, it will save some work.
>

Actually in the Makefiles, and in tests on manifest defines in the
sources.  So...in e.g. build.macos32x86/common/Makefile.vm you find
...
OSXCOMMONDIR:=$(PLATDIR)/iOS/vm/Common
...
XEX:=%/sqSqueakMainApplication+screen.m %/sqMacV2Window.m \
     %/SqViewBitmapConversion.m %/sqSqueakOSXCGView.m
OSXSRC=$(wildcard $(OSXDIR)/*.c) $(wildcard $(OSXDIR)/*.m) \
        $(wildcard $(OSXCOMMONDIR)/*.c) $(wildcard $(OSXCOMMONDIR)/*.m) \
        $(wildcard $(OSXCLASSESDIR)/*.c) $(wildcard $(OSXCLASSESDIR)/*.m)
OSXSRC:=$(filter-out $(XEX),$(OSXSRC)) UNIXSRC:=$(addprefix
$(UNIXVMDIR)/,aio.c sqUnixHeartbeat.c sqUnixSpurMemory.c \
                     sqUnixThreads.c sqUnixVMProfile.c)

and in platforms/unix/vm/sqUnixSpurMemory.c you find

#if SPURVM
...
#endif

and in platforms/iOS//vm/Common/sqMacV2Memory.c you find
#include "sq.h"
#if !SPURVM
...
#endif


So that on the Mac v3 sqUnixSpurMemory..o is empty and sqMacV2Memory..o is
not, but on the Mac Spur vice verse.

Likewise for platforms/unix/vm/sqUnixSpurMemory.c &
platforms/unix/vm/sqUnixMemory.c.  Use the source Luke!

Which is to say that I try and use manifest constants defined in
*src/vm/interp.h to define which features to include.  e.g. Compare
src/v/interp.h with spursrc/vm/interp.h:

McStalker.oscogvm$ diff {src,spursrc}/vm/interp.h
10c10
< #define BaseHeaderSize 4
---
> #define BaseHeaderSize 8
35a36
> #define SPURVM 1

or spursrc/vm/interp.h with spur64src/vm/interp.h

2c2
<       CCodeGeneratorGlobalStructure VMMaker.oscog-eem.948 uuid:
9323b2ad-f5cf-4aca-8f31-67eb5616ccca
---
>       CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1580 uuid:
2b856f5e-e0b4-44bb-b23d-07561132f8c8
8c8
< #define SQ_VI_BYTES_PER_WORD 4
---
> #define SQ_VI_BYTES_PER_WORD 8
11,12c11,12
< #define BytesPerOop 4
< #define BytesPerWord 4
---
> #define BytesPerOop 8
> #define BytesPerWord 8
32,33c32,33
< #define MinSmallInteger -1073741824
< #define MaxSmallInteger 1073741823
---
> #define MinSmallInteger -1152921504606846976
> #define MaxSmallInteger 1152921504606846975

or spursrc/vm/interp.h with nsspursrc/vm/interp.h
McStalker.oscogvm$ diff {spursrc,nsspursrc}/vm/interp.h
34a35,37
> #define NewspeakVM 1
> #define MULTIPLEBYTECODESETS 1
>

etc.

Putting stuff in config files is sadistic.  I wouldn't do that.  It needs
to be in the source.


-- 
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160528/f1007fc3/attachment.htm


More information about the Vm-dev mailing list