Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.2737
Browse files Browse the repository at this point in the history
CoInterpreter: Improve on the new simpler invoke interpreter scheme by including
the relevant return address so that the C stack looks properly connected after
reentering interpret.  This depends on getReturnAddress being defined in C.
Both MSVC and GCC (and those that support its builtins such as clang and ICC)
provide builtins/intrinsics for accessing the return address, so we don't bother
to implement it in the Cogit.

The implementation of getReturnAddress is in sq.h, not sqPlatformSpecific.h to
reduce duplication.  But if the current implementations in terms of MSVC or GCC
instrinsics don't apply, one may override in sqPlatformSpecific.h.

Windows builds:
Make most of the windows build makefiles switch hit between the cygwin/mingw
and the MSVC variants depending on a variable set by MSVC command prompts.
Hence to build using MSVC simply run make in an MSVC prompt.
  • Loading branch information
eliotmiranda committed Apr 1, 2020
1 parent acc4638 commit a9208a7
Show file tree
Hide file tree
Showing 85 changed files with 2,923 additions and 1,879 deletions.
618 changes: 309 additions & 309 deletions build.win32x86/common/Makefile

Large diffs are not rendered by default.

30 changes: 18 additions & 12 deletions build.win32x86/newspeak.cog.spur/Makefile
@@ -1,12 +1,18 @@
#############################################################################
# Makefile for Win32 Cog Spur Newspeak VM using gcc-3.4.x and cygwin
# Do make init to allow make -n to function.
#############################################################################

# The name of the VM to build
VM:=nsvm
VM_NAME:=Newspeak Virtual Machine

VMSRCDIR:= ../../nsspursrc/vm

include ../common/Makefile
#############################################################################
# Makefile for Win32 Cog Spur Newspeak VM using gcc-3.4.x and cygwin
# Do make init to allow make -n to function.
#############################################################################

# The name of the VM to build
VM:=nsvm
VM_NAME:=Newspeak Virtual Machine

VMSRCDIR:= ../../nsspursrc/vm

# This variable is set by VS Native Tools Command Prompts, not for cygwin wins
VSCMD_ARG_HOST_ARCH := $(shell echo $$VSCMD_ARG_HOST_ARCH)
ifeq ($(VSCMD_ARG_HOST_ARCH),)
include ../common/Makefile
else
include ../common/Makefile.msvc
endif
30 changes: 18 additions & 12 deletions build.win32x86/newspeak.stack.spur/Makefile
@@ -1,12 +1,18 @@
#############################################################################
# Makefile for Win32 Stack Spur Newspeak VM using gcc-3.4.x and cygwin
# Do make init to allow make -n to function.
#############################################################################

# The name of the VM to build
VM:=nsvm
VM_NAME:=Newspeak Virtual Machine

VMSRCDIR:= ../../nsspurstacksrc/vm

include ../common/Makefile
#############################################################################
# Makefile for Win32 Stack Spur Newspeak VM using gcc-3.4.x and cygwin
# Do make init to allow make -n to function.
#############################################################################

# The name of the VM to build
VM:=nsvm
VM_NAME:=Newspeak Virtual Machine

VMSRCDIR:= ../../nsspurstacksrc/vm

# This variable is set by VS Native Tools Command Prompts, not for cygwin wins
VSCMD_ARG_HOST_ARCH := $(shell echo $$VSCMD_ARG_HOST_ARCH)
ifeq ($(VSCMD_ARG_HOST_ARCH),)
include ../common/Makefile
else
include ../common/Makefile.msvc
endif
62 changes: 31 additions & 31 deletions build.win32x86/pharo.cog.spur/Makefile
@@ -1,32 +1,32 @@
#############################################################################
# Makefile for Win32 Cog Spur PharoVM using gcc and cygwin
# Do make init to allow make -n to function.
#############################################################################

VM:=Pharo
VM_NAME:=Pharo Virtual Machine

VMSRCDIR:=../../spursrc/vm
COGDEFS:= -DPharoVM=1

THIRDPARTYLIBS:=pkgconfig openssl libssh2 libgit2 libsdl2 zlib libpng freetype2 pixman cairo libgcc

include ../common/Makefile

# third-party libraries
#
include ../third-party/Makefile.pkgconfig
include ../third-party/Makefile.freetype2
include ../third-party/Makefile.openssl
include ../third-party/Makefile.libssh2
include ../third-party/Makefile.libgit2
include ../third-party/Makefile.libsdl2
include ../third-party/Makefile.zlib
include ../third-party/Makefile.pixman
include ../third-party/Makefile.libpng
include ../third-party/Makefile.cairo
include ../third-party/Makefile.libgcc

# Since SDLDisplayPlugin will be included as internal plugin, we need to add the library to the path
# add to the end to allow thirdparty vars to be defined.
#############################################################################
# Makefile for Win32 Cog Spur PharoVM using gcc and cygwin
# Do make init to allow make -n to function.
#############################################################################

VM:=Pharo
VM_NAME:=Pharo Virtual Machine

VMSRCDIR:=../../spursrc/vm
COGDEFS:= -DPharoVM=1

THIRDPARTYLIBS:=pkgconfig openssl libssh2 libgit2 libsdl2 zlib libpng freetype2 pixman cairo libgcc

include ../common/Makefile

# third-party libraries
#
include ../third-party/Makefile.pkgconfig
include ../third-party/Makefile.freetype2
include ../third-party/Makefile.openssl
include ../third-party/Makefile.libssh2
include ../third-party/Makefile.libgit2
include ../third-party/Makefile.libsdl2
include ../third-party/Makefile.zlib
include ../third-party/Makefile.pixman
include ../third-party/Makefile.libpng
include ../third-party/Makefile.cairo
include ../third-party/Makefile.libgcc

# Since SDLDisplayPlugin will be included as internal plugin, we need to add the library to the path
# add to the end to allow thirdparty vars to be defined.
STDLIBS+= -L$(THIRDPARTYOUTDIR)/lib -lSDL2
68 changes: 34 additions & 34 deletions build.win32x86/pharo.sista.spur/Makefile
@@ -1,34 +1,34 @@
#############################################################################
# Makefile for Win32 Cog Spur PharoVM using gcc and cygwin
# Do make init to allow make -n to function.
#############################################################################

VM:=Pharo
VM_NAME:=Pharo Virtual Machine

VMSRCDIR:=../../spursistasrc/vm
COGDEFS:= -DPharoVM=1

THIRDPARTYLIBS:=pkgconfig openssl libssh2 libgit2 libsdl2 zlib libpng freetype2 pixman cairo libgcc

COMPILER_TO_USE:=clang

include ../common/Makefile

# third-party libraries
#
include ../third-party/Makefile.pkgconfig
include ../third-party/Makefile.freetype2
include ../third-party/Makefile.openssl
include ../third-party/Makefile.libssh2
include ../third-party/Makefile.libgit2
include ../third-party/Makefile.libsdl2
include ../third-party/Makefile.zlib
include ../third-party/Makefile.pixman
include ../third-party/Makefile.libpng
include ../third-party/Makefile.cairo
include ../third-party/Makefile.libgcc

# Since SDLDisplayPlugin will be included as internal plugin, we need to add the library to the path
# add to the end to allow thirdparty vars to be defined.
STDLIBS+= -L$(THIRDPARTYOUTDIR)/lib -lSDL2
#############################################################################
# Makefile for Win32 Cog Spur PharoVM using gcc and cygwin
# Do make init to allow make -n to function.
#############################################################################

VM:=Pharo
VM_NAME:=Pharo Virtual Machine

VMSRCDIR:=../../spursistasrc/vm
COGDEFS:= -DPharoVM=1

THIRDPARTYLIBS:=pkgconfig openssl libssh2 libgit2 libsdl2 zlib libpng freetype2 pixman cairo libgcc

COMPILER_TO_USE:=clang

include ../common/Makefile

# third-party libraries
#
include ../third-party/Makefile.pkgconfig
include ../third-party/Makefile.freetype2
include ../third-party/Makefile.openssl
include ../third-party/Makefile.libssh2
include ../third-party/Makefile.libgit2
include ../third-party/Makefile.libsdl2
include ../third-party/Makefile.zlib
include ../third-party/Makefile.pixman
include ../third-party/Makefile.libpng
include ../third-party/Makefile.cairo
include ../third-party/Makefile.libgcc

# Since SDLDisplayPlugin will be included as internal plugin, we need to add the library to the path
# add to the end to allow thirdparty vars to be defined.
STDLIBS+= -L$(THIRDPARTYOUTDIR)/lib -lSDL2
74 changes: 37 additions & 37 deletions build.win32x86/pharo.stack.spur/Makefile
@@ -1,38 +1,38 @@
#############################################################################
# Makefile for Win32 Stack Spur PharoVM using gcc and cygwin
# Do make init to allow make -n to function.
#############################################################################

VM:=Pharo
VM_NAME:=Pharo Virtual Machine

VMSRCDIR:=../../spurstacksrc/vm
# NOTES:
# STACK_ALIGN_BYTES=16 is needed in mingw and FFI (and I suppose on other modules too).
# ALLOCA_LIES_SO_USE_GETSP=0 Some compilers return the stack address+4 on alloca function,
# then FFI module needs to adjust that. It is NOT the case of mingw.
# For more information see this thread: http://forum.world.st/There-are-something-fishy-with-FFI-plugin-td4584226.html
#COGDEFS:= -DPharoVM=1 -DSTACK_ALIGN_BYTES=16 -DALLOCA_LIES_SO_USE_GETSP=0
COGDEFS:= -DPharoVM=1

THIRDPARTYLIBS:=pkgconfig openssl libssh2 libgit2 libsdl2 zlib libpng freetype2 pixman cairo libgcc

include ../common/Makefile

# third-party libraries
#
include ../third-party/Makefile.pkgconfig
include ../third-party/Makefile.freetype2
include ../third-party/Makefile.openssl
include ../third-party/Makefile.libssh2
include ../third-party/Makefile.libgit2
include ../third-party/Makefile.libsdl2
include ../third-party/Makefile.zlib
include ../third-party/Makefile.pixman
include ../third-party/Makefile.libpng
include ../third-party/Makefile.cairo
include ../third-party/Makefile.libgcc

# Since SDLDisplayPlugin will be included as internal plugin, we need to add the library to the path
# add to the end to allow thirdparty vars to be defined.
#############################################################################
# Makefile for Win32 Stack Spur PharoVM using gcc and cygwin
# Do make init to allow make -n to function.
#############################################################################

VM:=Pharo
VM_NAME:=Pharo Virtual Machine

VMSRCDIR:=../../spurstacksrc/vm
# NOTES:
# STACK_ALIGN_BYTES=16 is needed in mingw and FFI (and I suppose on other modules too).
# ALLOCA_LIES_SO_USE_GETSP=0 Some compilers return the stack address+4 on alloca function,
# then FFI module needs to adjust that. It is NOT the case of mingw.
# For more information see this thread: http://forum.world.st/There-are-something-fishy-with-FFI-plugin-td4584226.html
#COGDEFS:= -DPharoVM=1 -DSTACK_ALIGN_BYTES=16 -DALLOCA_LIES_SO_USE_GETSP=0
COGDEFS:= -DPharoVM=1

THIRDPARTYLIBS:=pkgconfig openssl libssh2 libgit2 libsdl2 zlib libpng freetype2 pixman cairo libgcc

include ../common/Makefile

# third-party libraries
#
include ../third-party/Makefile.pkgconfig
include ../third-party/Makefile.freetype2
include ../third-party/Makefile.openssl
include ../third-party/Makefile.libssh2
include ../third-party/Makefile.libgit2
include ../third-party/Makefile.libsdl2
include ../third-party/Makefile.zlib
include ../third-party/Makefile.pixman
include ../third-party/Makefile.libpng
include ../third-party/Makefile.cairo
include ../third-party/Makefile.libgcc

# Since SDLDisplayPlugin will be included as internal plugin, we need to add the library to the path
# add to the end to allow thirdparty vars to be defined.
STDLIBS+= -L$(THIRDPARTYOUTDIR)/lib -lSDL2
6 changes: 6 additions & 0 deletions build.win32x86/squeak.cog.spur.lowcode/Makefile
Expand Up @@ -9,4 +9,10 @@ VMSRCDIR:=../../spurlowcodesrc/vm
COGDEFS:=
COMPILER_TO_USE:=clang

# This variable is set by VS Native Tools Command Prompts, not for cygwin wins
VSCMD_ARG_HOST_ARCH := $(shell echo $$VSCMD_ARG_HOST_ARCH)
ifeq ($(VSCMD_ARG_HOST_ARCH),)
include ../common/Makefile
else
include ../common/Makefile.msvc
endif
24 changes: 15 additions & 9 deletions build.win32x86/squeak.cog.spur/Makefile
@@ -1,9 +1,15 @@
#############################################################################
# Makefile for Win32 Cog Spur Squeak VM using gcc-3.4.x and cygwin
# Do make init to allow make -n to function.
#############################################################################

VM:=Squeak
VMSRCDIR:=../../spursrc/vm

include ../common/Makefile
#############################################################################
# Makefile for Win32 Cog Spur Squeak VM using gcc-3.4.x and cygwin
# Do make init to allow make -n to function.
#############################################################################

VM:=Squeak
VMSRCDIR:=../../spursrc/vm

# This variable is set by VS Native Tools Command Prompts, not for cygwin wins
VSCMD_ARG_HOST_ARCH := $(shell echo $$VSCMD_ARG_HOST_ARCH)
ifeq ($(VSCMD_ARG_HOST_ARCH),)
include ../common/Makefile
else
include ../common/Makefile.msvc
endif
24 changes: 15 additions & 9 deletions build.win32x86/squeak.cog.v3/Makefile
@@ -1,9 +1,15 @@
#############################################################################
# Makefile for Win32 Cog Squeak VM using gcc-3.4.x and cygwin
# Do make init to allow make -n to function.
#############################################################################

VM:=Squeak
VMSRCDIR:=../../src/vm

include ../common/Makefile
#############################################################################
# Makefile for Win32 Cog Squeak VM using gcc-3.4.x and cygwin
# Do make init to allow make -n to function.
#############################################################################

VM:=Squeak
VMSRCDIR:=../../src/vm

# This variable is set by VS Native Tools Command Prompts, not for cygwin wins
VSCMD_ARG_HOST_ARCH := $(shell echo $$VSCMD_ARG_HOST_ARCH)
ifeq ($(VSCMD_ARG_HOST_ARCH),)
include ../common/Makefile
else
include ../common/Makefile.msvc
endif
28 changes: 17 additions & 11 deletions build.win32x86/squeak.sista.spur/Makefile
@@ -1,11 +1,17 @@
#############################################################################
# Makefile for Win32 Cog Spur Squeak VM using gcc-3.4.x and cygwin
# Do make init to allow make -n to function.
#############################################################################

VM:=Squeak
VMSRCDIR:=../../spursistasrc/vm

COMPILER_TO_USE:=clang

include ../common/Makefile
#############################################################################
# Makefile for Win32 Cog Spur Squeak VM using gcc-3.4.x and cygwin
# Do make init to allow make -n to function.
#############################################################################

VM:=Squeak
VMSRCDIR:=../../spursistasrc/vm

COMPILER_TO_USE:=clang

# This variable is set by VS Native Tools Command Prompts, not for cygwin wins
VSCMD_ARG_HOST_ARCH := $(shell echo $$VSCMD_ARG_HOST_ARCH)
ifeq ($(VSCMD_ARG_HOST_ARCH),)
include ../common/Makefile
else
include ../common/Makefile.msvc
endif
24 changes: 15 additions & 9 deletions build.win32x86/squeak.stack.spur/Makefile
@@ -1,9 +1,15 @@
#############################################################################
# Makefile for Win32 Stack Spur Squeak VM using gcc-3.4.x and cygwin
# Do make init to allow make -n to function.
#############################################################################

VM:=Squeak
VMSRCDIR:=../../spurstacksrc/vm

include ../common/Makefile
#############################################################################
# Makefile for Win32 Stack Spur Squeak VM using gcc-3.4.x and cygwin
# Do make init to allow make -n to function.
#############################################################################

VM:=Squeak
VMSRCDIR:=../../spurstacksrc/vm

# This variable is set by VS Native Tools Command Prompts, not for cygwin wins
VSCMD_ARG_HOST_ARCH := $(shell echo $$VSCMD_ARG_HOST_ARCH)
ifeq ($(VSCMD_ARG_HOST_ARCH),)
include ../common/Makefile
else
include ../common/Makefile.msvc
endif

0 comments on commit a9208a7

Please sign in to comment.