Skip to content

Commit

Permalink
Merges release 0.4
Browse files Browse the repository at this point in the history
Release 0.4 completely refactors the VM logic and
brings new instruction API that allows us to extract
semantic information from method bytecodes.

Later this will help to deduce the possible control
flow and perform a lot of optimizations. This should
literally boost the VM performance to a new level.

Also huge amount of work was done in terms of code
organization, readability and maintainability.

* develop: (290 commits)
  Renames standart_set -> standard_set
  Fixes compilation of MethodCompiler::getSkipOffset
  Installs llvm 3.3 under osx
  Bumps version in `--version`
  Moves some methods from instructions.h into stapi.h
  Replaces get_current_dir_name with getcwd
  Fixes compilation of Timer.cpp not on Linux
  Removes double compilation of some cpp files
  Prepares env and compilers
  Fixes primitive::stringAt
  Bumps version of debian package
  Bumps version upto 0.4
  Adds --mm_type into man page
  Fixes llvm version in README and shows how to build unit tests
  Fixes comments in JITRuntime.cpp
  Fixes outdated comments with m_targetToBlockMap
  Makes more functions in Timer.h be const
  Fixes library linkage order
  Removes trash comments from MethodCompiler
  Removes trash comments from ControlGraphVisualizer
  ...
  • Loading branch information
0x7CFE committed Aug 16, 2015
2 parents 4ca757b + 9b72b7b commit e1ffb3d
Show file tree
Hide file tree
Showing 91 changed files with 8,278 additions and 5,939 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*man -diff
ChangeLog -diff
tests/data/ -diff
63 changes: 63 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
language: cpp

compiler:
- gcc
- clang

os:
- linux
- osx

sudo: false
cache:
apt: true
directories:
- $HOME/.cache/pip
addons:
apt:
packages:
- g++-multilib
- linux-libc-dev:i386
- libreadline-dev:i386
- llvm-3.3-dev:i386

notifications:
email: false

branches:
only:
- master
- develop
- /^.*travis.*$/

matrix:
allow_failures:
- os: osx

env:
matrix: # fix all scripts (e.g. install-dependencies.sh) if you rename LLVM_USE[On/Off]
- USE_LLVM=Off
BUILD_TYPE=Debug
- USE_LLVM=Off
BUILD_TYPE=Release
- USE_LLVM=On
BUILD_TYPE=Debug
- USE_LLVM=On
BUILD_TYPE=Release
- USE_LLVM=Off
BUILD_TYPE=Coverage

before_install:
- source .travis/${TRAVIS_OS_NAME}/before_install.sh

before_script:
- mkdir -p build
- cd build
- cmake .. -DUSE_LLVM=$USE_LLVM -DBUILD_TESTS=On -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSITE="${TRAVIS_OS_NAME}@Travis" -DBUILDNAME="${TRAVIS_BRANCH}_${CXX}_LLVM_${USE_LLVM}_${BUILD_TYPE}"

script:
- cmake --build . -- all --keep-going
- cmake --build . --target check

after_success:
- if [ ${CXX} == g++ ] && [ ${BUILD_TYPE} == Coverage ]; then ~/.local/bin/coveralls --repo_token "INxVunXhVXbQWjVbwoIisKeXSJqCRGnI2" --exclude build/tests/gtest -E ".*CMake.*CompilerId.c" --gcov-options "\-lp" -r ../; fi
3 changes: 3 additions & 0 deletions .travis/linux/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

pip install --user cpp-coveralls
12 changes: 12 additions & 0 deletions .travis/osx/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

if [[ "${CC}" == "gcc" ]]; then
export CC=gcc-4.8
export CXX=g++-4.8
fi

function brew_upgrade { brew outdated $1 || brew upgrade $1; }

brew update
brew install readline
brew install llvm33
87 changes: 58 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ cmake_minimum_required(VERSION 2.8.4)

set (CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_SOURCE_DIR}/cmake/variables.cmake")
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set (LLVM_PACKAGE_VERSION 3.3)

project(llst-project)
project(llst)

find_package(Threads REQUIRED QUIET)
find_package(READLINE)
find_package(TINFO)
find_package(LLVM 3.3 EXACT)
find_package(LLVM ${LLVM_PACKAGE_VERSION} EXACT)
find_package(POD2MAN)
find_package(GZIP REQUIRED)

Expand All @@ -19,32 +19,25 @@ option(USE_POD2MAN "Should we use pod2man to build the documentation (we will cr
if (USE_LLVM)
if (LLVM_FOUND)
message(STATUS "Using LLVM ${LLVM_VERSION}")
set (CMAKE_C_FLAGS "${LLVM_C_FLAGS} ${CMAKE_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${LLVM_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
set (CMAKE_EXE_LINKER_FLAGS "${LLVM_LD_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")

# LLVM generates loads of warnings...
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")

set (CMAKE_CXX_FLAGS "${LLVM_CPP_FLAGS} ${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
set (LLVM_LIBS_TO_LINK ${LLVM_LIBS})
link_directories(${LLVM_LIB_DIR})
add_definitions(-DLLVM)
else()
message(FATAL_ERROR "\nInstall llvm-3.3-dev:i386 and try again.")
message(FATAL_ERROR "\nInstall llvm-${LLVM_PACKAGE_VERSION}-dev:i386 and try again.")
endif()
else()
message(STATUS "LLVM is disabled")
unset(LLVM_LIBS_TO_LINK)
endif()

if (USE_READLINE)
if (READLINE_FOUND AND TINFO_FOUND)
if (READLINE_FOUND)
message(STATUS "Using readline library")
set_source_files_properties(src/CompletionEngine.cpp PROPERTIES COMPILE_DEFINITIONS USE_READLINE)
set (READLINE_LIBS_TO_LINK ${READLINE_LIBRARIES} ${TINFO_LIBRARIES})
set (READLINE_LIBS_TO_LINK ${READLINE_LIBRARIES})
else()
if(NOT TINFO_FOUND)
message(SEND_ERROR "Library readline depends on tinfo.\nYou may configure with -DUSE_READLINE=OFF.")
endif()
if(NOT READLINE_FOUND)
message(SEND_ERROR "Library readline is not found.\nYou may configure with -DUSE_READLINE=OFF.")
endif()
Expand Down Expand Up @@ -73,43 +66,77 @@ else()
endif()


option(BUILD_TESTS "Should we build tests?" OFF)

if (BUILD_TESTS)
enable_testing()
configure_file( "${CMAKE_SOURCE_DIR}/cmake/CTestCustom.cmake.in" "${CMAKE_BINARY_DIR}/CTestCustom.cmake" @ONLY)
set (CTEST_SUBMIT_RETRY_DELAY 0 CACHE STRING "How long to wait between timed-out CTest submissions.")
set (CTEST_SUBMIT_RETRY_COUNT 0 CACHE STRING "How many times to retry timed-out CTest submissions.")
include(CTest)
add_subdirectory(tests)
endif()

add_subdirectory(doc)
add_subdirectory(image)
add_subdirectory(src)
add_subdirectory(include)
include_directories(include)

add_library(stapi
src/ParsedBytecode.cpp
src/ParsedMethod.cpp
src/ParsedBlock.cpp

src/ControlGraph.cpp
src/ControlGraphVisualizer.cpp
)

set(MM_CPP_FILES
src/BakerMemoryManager.cpp
src/GenerationalMemoryManager.cpp
src/NonCollectMemoryManager.cpp
)
if (USE_LLVM)
list(APPEND MM_CPP_FILES src/LLVMMemoryManager.cpp)
endif()

add_library(memory_managers ${MM_CPP_FILES})

# Base set of sources needed in every build
set(CPP_FILES
add_library(standard_set
src/vm.cpp
src/args.cpp
src/BakerMemoryManager.cpp
src/CompletionEngine.cpp
src/GenerationalMemoryManager.cpp
src/Image.cpp
src/main.cpp
src/NonCollectMemoryManager.cpp
src/primitives.cpp
src/TDictionary.cpp
src/TInstruction.cpp
src/TSymbol.cpp
src/vm.cpp

src/TSmalltalkInstruction.cpp
src/InstructionDecoder.cpp

src/Timer.cpp
src/GCLogger.cpp
)

if (USE_LLVM)
# LLVM specific sources
list(APPEND CPP_FILES
src/LLVMMemoryManager.cpp
add_library(jit
src/MethodCompiler.cpp
src/JITRuntime.cpp
src/llstPass.cpp
src/llstDebuggingPass.cpp
)
endif()

add_executable(llst ${CPP_FILES})
target_link_libraries(llst ${LLVM_LIBS_TO_LINK} ${READLINE_LIBS_TO_LINK} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
add_executable(llst src/main.cpp)
add_dependencies(llst image)

if (USE_LLVM)
target_link_libraries(llst jit ${LLVM_LIBS} ${LLVM_LD_FLAGS})
endif()
target_link_libraries(llst standard_set memory_managers stapi ${READLINE_LIBS_TO_LINK} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})

set(changelog_compressed "${CMAKE_CURRENT_BINARY_DIR}/changelog.gz")
gzip_compress("compress_changelog" "${CMAKE_CURRENT_SOURCE_DIR}/ChangeLog" ${changelog_compressed})

Expand All @@ -126,7 +153,7 @@ set (CPACK_DEBIAN_PACKAGE_DESCRIPTION # The format of Description: http://www.de
")
set (CPACK_PACKAGE_CONTACT "info@llst.org")
set (CPACK_PACKAGE_VERSION_MAJOR "0")
set (CPACK_PACKAGE_VERSION_MINOR "3")
set (CPACK_PACKAGE_VERSION_MINOR "4")
set (CPACK_PACKAGE_VERSION_PATCH "0")
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set (CPACK_SOURCE_GENERATOR "TGZ")
Expand All @@ -135,8 +162,10 @@ set (CPACK_STRIP_FILES "llst")


set (CPACK_GENERATOR "DEB")
set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://llst.org")
set (CPACK_DEBIAN_PACKAGE_MAINTAINER "Team <info@llst.org>")
set (CPACK_DEBIAN_PACKAGE_DEPENDS "libc6")
set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
set (CPACK_DEBIAN_PACKAGE_DEPENDS "libc6:i386, libgcc1:i386, libstdc++6:i386, libreadline6:i386, libtinfo5:i386")

include(CPack)

Expand Down
6 changes: 6 additions & 0 deletions CTestConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set(CTEST_PROJECT_NAME "LLST")
set(CTEST_NIGHTLY_START_TIME "00:00:00 UTC")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "my.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=LLST")
set(CTEST_DROP_SITE_CDASH TRUE)
Loading

0 comments on commit e1ffb3d

Please sign in to comment.