From f9abf1d9fbdc20c72cf9e36cd9df3dc26d9a5c5f Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Fri, 22 Nov 2013 23:58:24 +0400 Subject: [PATCH 01/44] Adds `make package_source` Issue: #43 --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 754b6f4..d208d27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,3 +80,13 @@ add_custom_command( ) add_custom_target(image ALL DEPENDS ${IMAGE_DIR}/LittleSmalltalk.image) + + +set (CPACK_PACKAGE_VERSION_MAJOR "0") +set (CPACK_PACKAGE_VERSION_MINOR "2") +set (CPACK_PACKAGE_VERSION_PATCH "0") +set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") +set (CPACK_SOURCE_GENERATOR "TGZ") +set (CPACK_SOURCE_IGNORE_FILES "build/;\\\\.kdev4.*;\\\\.git/;\\\\.hgignore") + +include(CPack) From ba784d20c089fd0383be5d820ed5794330a184d5 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Sat, 23 Nov 2013 00:05:37 +0400 Subject: [PATCH 02/44] Adds `make package` Issue: #43 --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d208d27..ce71ac8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,12 +81,16 @@ add_custom_command( add_custom_target(image ALL DEPENDS ${IMAGE_DIR}/LittleSmalltalk.image) +install(TARGETS llst DESTINATION bin) +set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "LLVM powered Little Smalltalk") +set (CPACK_PACKAGE_CONTACT "info@llst.org") set (CPACK_PACKAGE_VERSION_MAJOR "0") set (CPACK_PACKAGE_VERSION_MINOR "2") set (CPACK_PACKAGE_VERSION_PATCH "0") set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set (CPACK_SOURCE_GENERATOR "TGZ") set (CPACK_SOURCE_IGNORE_FILES "build/;\\\\.kdev4.*;\\\\.git/;\\\\.hgignore") +set (CPACK_GENERATOR "DEB") include(CPack) From 3c7393a4a03e6feeac026b80e263bb99b3162800 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Sat, 23 Nov 2013 17:05:17 +0400 Subject: [PATCH 03/44] Fix LICENSE due to `http://www.debian.org/doc/debian-policy/ch-docs.html#s-copyrightfile` Issue: #43 --- CMakeLists.txt | 2 ++ LICENSE | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce71ac8..6272a1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,6 +82,8 @@ add_custom_command( add_custom_target(image ALL DEPENDS ${IMAGE_DIR}/LittleSmalltalk.image) install(TARGETS llst DESTINATION bin) +install(FILES LICENSE DESTINATION share/doc/${PROJECT_NAME} RENAME copyright) + set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "LLVM powered Little Smalltalk") set (CPACK_PACKAGE_CONTACT "info@llst.org") diff --git a/LICENSE b/LICENSE index 1f09e95..c615b23 100644 --- a/LICENSE +++ b/LICENSE @@ -17,6 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with LLST. If not, see . +On Debian systems, the complete text of the GNU Library +General Public License can be found in `/usr/share/common-licenses/GPL-3'. LLST is based on the Little Smalltalk version 5: From bf9ea71ce42bad232983891d7cf7babc7e130d4d Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Sat, 23 Nov 2013 17:35:25 +0400 Subject: [PATCH 04/44] Fixes a lot of lintian warnings -strips executable -adds maintainer -adds dependencies -changes the name of the project Issue: #43 --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6272a1e..79a5062 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.8) -project(llst_project) +project(llst-project) if (LLVM) if(LLVM_VERSION) @@ -93,6 +93,11 @@ set (CPACK_PACKAGE_VERSION_PATCH "0") set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set (CPACK_SOURCE_GENERATOR "TGZ") set (CPACK_SOURCE_IGNORE_FILES "build/;\\\\.kdev4.*;\\\\.git/;\\\\.hgignore") +set (CPACK_STRIP_FILES "llst") + + set (CPACK_GENERATOR "DEB") +set (CPACK_DEBIAN_PACKAGE_MAINTAINER "Team ") +set (CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libreadline6-dev") include(CPack) From 2b60d4d7b51178546f7c4c47e79931470f4e0e4d Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Wed, 27 Nov 2013 04:09:34 +0400 Subject: [PATCH 05/44] Adds an empty man for llst Issue: #43 --- .gitattributes | 1 + CMakeLists.txt | 1 + doc/llst.1.en.gz | Bin 0 -> 1791 bytes doc/llst.1.en.pod | 15 +++++++++++++++ 4 files changed, 17 insertions(+) create mode 100644 .gitattributes create mode 100644 doc/llst.1.en.gz create mode 100644 doc/llst.1.en.pod diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5669134 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*man -diff diff --git a/CMakeLists.txt b/CMakeLists.txt index 79a5062..ceea8a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,7 @@ add_custom_target(image ALL DEPENDS ${IMAGE_DIR}/LittleSmalltalk.image) install(TARGETS llst DESTINATION bin) install(FILES LICENSE DESTINATION share/doc/${PROJECT_NAME} RENAME copyright) +install(FILES doc/llst.1.en.gz DESTINATION share/man/man1/ RENAME llst.1.gz) set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "LLVM powered Little Smalltalk") diff --git a/doc/llst.1.en.gz b/doc/llst.1.en.gz new file mode 100644 index 0000000000000000000000000000000000000000..ed04710f0bfcbafbacdc13de38c9bf9e5d8a7dce GIT binary patch literal 1791 zcmV2mFnG@raxCYVOifP0IEy$PTK0FXhUGTZk0z2OKFfW|a?ave#0Pr&-M{qLuzXIF zi~xDZb8RY#jCq{Q)q*Fq;^eW!kW>gx*3AtJ3j>m5iHxk{rKS=^H7rYG-OUu%PkbIG zwB-2=?#Cqg7um1^NuysHRubUH$#wr@Z-uxLI#2u;L~ijv)Ql<`9F}Ax(inCvSk64j zbCNkrLG@HHebXgG-}! z8yq8+g%TNoyK_dNP+9Ovra*dTH`lIfB)Q-@57L~|Dpk3g0e8v5Nbzp;-dBc>4B}rh zMF95RAfzqH(;(<*q$HIKgiq~Cy-R@AwXh21f<|vokr$bhYaaa4MJfdhr;)ofx|Y2( z+=bD#Gs6{Kr@dLXUD3yJ?Gz=%Q9|yYZUeRv0Rw5;0B$yrjw~!G)SKxhrgi!5sA#=0 z?f9L81z9^Wjq4Ofece@g3gLfBb{|;MTl_6t|J!gUCE6Cwsl!1GWzuYJsoOmYVXsq$ zqKsMY{?)K}^fUrrU6aS|*Lo0OLsnOGe_vN*7!}xNcAN{3Wt;>uSe2bnsf%{nC2?KhM=EOfGK)XHx;rSTRKB3NOK*R;b+*vJ}Z-{{M+mrTgBr*)gWC^jyWJy zi=uXAk*kJGlMbeep?YI85Mh$fzYtGg4h&2a80PalSG88wb0{MmnAY^N)u9DvI923C zk)oIh?v=fdtqHc^UaW|5)+!rPE6`Atl9=TWFh*DL$G4{{DmT|>2hVw zzG}t7VxC8~bxbEGy}r}ypU~v}_=mC_ejfcqN0!qn=k5h(In>-13I0!1Kq|LEe@N9t z$h-J0F}(Cd%2+PN#(2mFg+J#AhbL2HPR$TKWOQ=$VA)(G^&WV2S$V98JF-sV9eF|4 zVU7Hi+`!(Ezk$3dBcX4rC$Oez7hTiEABs9CUOPprbzs?tacfWCcYFH!d)nUYDSK1u z+Bhr9dz|Uu|G(ZEbsYlug!Dv@Ps^@TV1mXC^O?=C->6qtA^^Y+5}>Lw2phMC1Iboc6i8fz{4V zEzW+^pnkWmGxN31mGNk7fSlvla0ACR7i;vG0@6GCmYsF!tg;QlXO*yR$2#ngRc`=0 zHtON`)oi8GOl2TWMcW?Z`CykmlzL1cj*a5L=^eJz+rmy2+s=b&g(2FG5_UFLD4E0F zu~A{Am6EL_L(^6o7`TsgF>-x2$k9>iFfh&zJgsd|ti>-`9&# z*;zcgzOuR=lr6wNHJEnmC`O~ft)uIJSI4%_UK>!T2dG5_#;i#i-ej{BqZ6`nqE@5 zrl!-k54%W<^Itsu`j&(LS67oMouyt8V`}Knl=6DMsBVUiejJe+EuRV@!vNo5iVZFf zqZM0=-T7jj;k!(q{(y%L?)C>RG#dEuOi8hmtSQE`OP%PKJNFie{<8BoHmIAq{BUE) zI6lYle4SiU^TY7{d9$HCal7~ynZ)>VowDeGmSHXnAjHhW2LUhH&(0^K+wskGeEp#e z%cXvrJvngSs3x6WpIr~|_%9_V=jSxMnq2RT?RHBUyvQJd?-QmjR575p3n{ZfulK3o hxo;&=PvEI%Wl`44cphb`FAI6v_#gW~Dw2B-001dfh`|5= literal 0 HcmV?d00001 diff --git a/doc/llst.1.en.pod b/doc/llst.1.en.pod new file mode 100644 index 0000000..5c1910a --- /dev/null +++ b/doc/llst.1.en.pod @@ -0,0 +1,15 @@ +#pod2man --section=1 --center="LLST Documentation" --release=0.2 --name=llst ./doc/llst.1.en.pod | gzip -9 > ./doc/llst.1.en.gz +=head1 NAME + +llst - a SmallTalk virtual machine + +=head1 DESCRIPTION + +TODO: + + +=head1 SEE ALSO + +POD examples: L + +=cut From 62e21c900122b72681020054102eda90938717db Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Thu, 28 Nov 2013 21:56:48 +0400 Subject: [PATCH 06/44] Adds the help about llst args To display it run `./llst --help`. Issue: #33 --- include/args.h | 1 + src/args.cpp | 11 +++++++++++ src/main.cpp | 7 ++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/include/args.h b/include/args.h index 349281e..cc7aab6 100644 --- a/include/args.h +++ b/include/args.h @@ -49,6 +49,7 @@ struct args { } void parse(int argc, char **argv); + static std::string getHelp(); }; #endif \ No newline at end of file diff --git a/src/args.cpp b/src/args.cpp index 5ae4953..0e1b15c 100644 --- a/src/args.cpp +++ b/src/args.cpp @@ -103,3 +103,14 @@ void args::parse(int argc, char **argv) } } } + +std::string args::getHelp() +{ + return + "Usage: llst [options] path-to-image\n" + "Options:\n" + " -h, --heap Starting of the heap in bytes\n" + " -H, --heap_max Maximum allowed heap size\n" + " -i, --image Path to image\n" + " --help Display this information and quit"; +} diff --git a/src/main.cpp b/src/main.cpp index 0f285c3..ff49c9f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -54,6 +54,11 @@ int main(int argc, char **argv) { llstArgs.parse(argc, argv); + if (llstArgs.showHelp) { + std::cout << args::getHelp() << std::endl; + return EXIT_SUCCESS; + } + #if defined(LLVM) std::auto_ptr memoryManager(new LLVMMemoryManager()); #else @@ -150,5 +155,5 @@ int main(int argc, char **argv) { runtime.printStat(); #endif - return 0; + return EXIT_SUCCESS; } From 91de7eef46b4a6c34786eda5e66580dcd7ecfd32 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Mon, 2 Dec 2013 17:11:49 +0400 Subject: [PATCH 07/44] Adds bash completion for llst installed with deb Issue: #43 --- CMakeLists.txt | 3 ++- misc/bash-completion.sh | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 misc/bash-completion.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index ceea8a0..086b83a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,13 +84,14 @@ add_custom_target(image ALL DEPENDS ${IMAGE_DIR}/LittleSmalltalk.image) install(TARGETS llst DESTINATION bin) install(FILES LICENSE DESTINATION share/doc/${PROJECT_NAME} RENAME copyright) install(FILES doc/llst.1.en.gz DESTINATION share/man/man1/ RENAME llst.1.gz) +install(FILES misc/bash-completion.sh DESTINATION share/bash-completion/completions RENAME llst) set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "LLVM powered Little Smalltalk") set (CPACK_PACKAGE_CONTACT "info@llst.org") set (CPACK_PACKAGE_VERSION_MAJOR "0") set (CPACK_PACKAGE_VERSION_MINOR "2") -set (CPACK_PACKAGE_VERSION_PATCH "0") +set (CPACK_PACKAGE_VERSION_PATCH "1") set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set (CPACK_SOURCE_GENERATOR "TGZ") set (CPACK_SOURCE_IGNORE_FILES "build/;\\\\.kdev4.*;\\\\.git/;\\\\.hgignore") diff --git a/misc/bash-completion.sh b/misc/bash-completion.sh new file mode 100644 index 0000000..df9ecf4 --- /dev/null +++ b/misc/bash-completion.sh @@ -0,0 +1,20 @@ +# bash completion for llst(1) + +_llst() +{ + local cur prev words cword + _init_completion -s || return + + case $prev in + -i|--image) + _filedir + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + fi +} && +complete -F _llst llst From 13c46afc87bd0a8528d77bfd8d3e5a8cd0cfeb64 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Tue, 3 Dec 2013 13:00:36 +0200 Subject: [PATCH 08/44] Fixes error with undeclared 'EXIT_SUCCESS' for RPi Issue: #46 --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.cpp b/src/main.cpp index ff49c9f..53138d6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include From 73874fb5553887a14d0341d12684757dc5696dcd Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Tue, 3 Dec 2013 17:22:45 +0400 Subject: [PATCH 09/44] Adds EOL to args.h Issue: #46 --- include/args.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/args.h b/include/args.h index cc7aab6..1f8b0f0 100644 --- a/include/args.h +++ b/include/args.h @@ -52,4 +52,4 @@ struct args static std::string getHelp(); }; -#endif \ No newline at end of file +#endif From 6f6ffd493f5fd7c4e9ef1210b482e9f17d0780c2 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Tue, 3 Dec 2013 20:45:39 +0400 Subject: [PATCH 10/44] Adds `#include ` to resolve type FILE Issue: #46 --- src/CompletionEngine.cpp | 4 +++- src/vm.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/CompletionEngine.cpp b/src/CompletionEngine.cpp index 794122e..00673ef 100644 --- a/src/CompletionEngine.cpp +++ b/src/CompletionEngine.cpp @@ -32,9 +32,11 @@ * along with LLST. If not, see . */ -#include +#include #include +#include + std::auto_ptr CompletionEngine::s_instance(new CompletionEngine); static char* smalltalk_generator(const char* text, int state) { diff --git a/src/vm.cpp b/src/vm.cpp index 5a803a1..78a79fe 100644 --- a/src/vm.cpp +++ b/src/vm.cpp @@ -33,12 +33,13 @@ */ +#include +#include #include -#include -#include #include -#include #include +#include +#include #include #include From 27a78000d341b749ba8edfeae1f7140ac144706e Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Tue, 3 Dec 2013 22:51:24 +0400 Subject: [PATCH 11/44] Requires CMake 2.8.4 due to cygwin warnings Issue: #46 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ceea8a0..2bf6a03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(llst-project) From 013055093f62f63c51194b885f12db0b3ce26b2b Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Sat, 7 Dec 2013 16:50:06 +0400 Subject: [PATCH 12/44] Fixes llvm asserts for Arch Linux Issue: #46 --- src/JITRuntime.cpp | 2 +- src/llstPass.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/JITRuntime.cpp b/src/JITRuntime.cpp index 71eac4f..17a7b04 100644 --- a/src/JITRuntime.cpp +++ b/src/JITRuntime.cpp @@ -457,7 +457,7 @@ void JITRuntime::patchHotMethods() // Cleaning up the function m_executionEngine->freeMachineCodeForFunction(methodFunction); - methodFunction->getBasicBlockList().clear(); + methodFunction->deleteBody(); // Compiling function from scratch outs() << "Recompiling method for patching: " << methodFunction->getName().str() << "\n"; diff --git a/src/llstPass.cpp b/src/llstPass.cpp index c3fd136..55a9630 100644 --- a/src/llstPass.cpp +++ b/src/llstPass.cpp @@ -113,7 +113,7 @@ bool LLSTPass::isPotentialGCFunction(Function* F) if (F->isIntrinsic()) return false; - if ( F->getGC() ) + if ( F->hasGC() ) return true; return false; } From 88a480f9d4df6b066b801f2383645d3efc4f2254 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Sat, 7 Dec 2013 17:06:40 +0400 Subject: [PATCH 13/44] Fixes compilation warnings for Arch Linux Issue: #46 --- CMakeLists.txt | 2 +- include/types.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bf6a03..7e61b84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ if (LLVM) add_definitions(-DLLVM) endif() -set (CMAKE_CXX_FLAGS "${LLVM_CXX_FLAGS} -Wall -fexceptions -frtti -Wno-cast-qual") +set (CMAKE_CXX_FLAGS "${LLVM_CXX_FLAGS} -Wall -fexceptions -frtti -Wno-pedantic -Wno-cast-qual") set (CMAKE_CXX_FLAGS_DEBUG "-g -ggdb -O0") set (CMAKE_CXX_FLAGS_RELEASE "-O3") diff --git a/include/types.h b/include/types.h index 3599986..1163739 100644 --- a/include/types.h +++ b/include/types.h @@ -167,7 +167,7 @@ struct TByteObject : public TObject { uint8_t* getBytes() { return bytes; } const uint8_t* getBytes() const { return bytes; } - const uint8_t getByte(uint32_t index) const { return bytes[index]; } + const uint8_t& getByte(uint32_t index) const { return bytes[index]; } uint8_t& operator [] (uint32_t index) { return bytes[index]; } void putByte(uint32_t index, uint8_t value) { bytes[index] = value; } From 44bdcca9c8bbad2a3144af1b62ce65b01fdd0647 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Sun, 22 Dec 2013 02:00:22 +0400 Subject: [PATCH 14/44] Replaces `typedef int32_t TInteger` with a real class Issue: #51 --- include/types.h | 28 +++++++++++------- include/vm.h | 8 ++--- src/Image.cpp | 5 ++-- src/JITRuntime.cpp | 14 ++++----- src/MethodCompiler.cpp | 2 +- src/main.cpp | 6 ++-- src/primitives.cpp | 67 ++++++++++++++++++++---------------------- src/vm.cpp | 54 ++++++++++++++++------------------ 8 files changed, 92 insertions(+), 92 deletions(-) diff --git a/include/types.h b/include/types.h index 3599986..819ad4e 100644 --- a/include/types.h +++ b/include/types.h @@ -40,6 +40,7 @@ #include #include #include +#include struct TClass; struct TObject; @@ -51,18 +52,25 @@ struct TMethod; inline std::size_t correctPadding(std::size_t size) { return (size + sizeof(void*) - 1) & ~(sizeof(void*) - 1); } //inline size_t correctPadding(size_t size) { return (size + 3) & ~3; } -// This is a special interpretation of Smalltalk's SmallInteger // VM handles the special case when object pointer has lowest bit set to 1 // In that case pointer is treated as explicit 31 bit integer equal to (value >> 1) -// Any operation should be done using SmalltalkVM::getIntegerValue() and SmalltalkVM::newInteger() -// Explicit type cast should be strictly avoided for the sake of design and stability -// TODO May be we should refactor TInteger to a class which provides cast operators. -typedef int32_t TInteger; - -// Helper functions for TInteger operation -inline bool isSmallInteger(const TObject* value) { return reinterpret_cast(value) & 1; } -inline int32_t getIntegerValue(TInteger value) { return (value >> 1); } -inline TInteger newInteger(int32_t value) { return (value << 1) | 1; } +inline bool isSmallInteger(const TObject* value) { return reinterpret_cast(value) & 1; } + +// This is a special interpretation of Smalltalk's SmallInteger +// The class is binary compatible with the TObject* +class TInteger { +public: + TInteger(int32_t value) : m_value(newInteger(value)) { } + TInteger(const TObject* value) : m_value(isSmallInteger(value) ? value : throw std::bad_cast()) { } + + operator int32_t() const { return getIntegerValue(m_value); } + operator TObject*() const { return const_cast(m_value); } +private: + const TObject* m_value; +protected: + static int32_t getIntegerValue(const TObject* value) { return reinterpret_cast(value) >> 1; } + static TObject* newInteger(int32_t value) { return reinterpret_cast((value << 1) | 1); } +}; // Helper struct used to hold object size and special // status flags packed in a 4 bytes space. TSize is used diff --git a/include/vm.h b/include/vm.h index f0c4aa7..44f5e4f 100644 --- a/include/vm.h +++ b/include/vm.h @@ -81,13 +81,13 @@ class SmalltalkVM { hptr returnedValue; void loadPointers() { - bytePointer = getIntegerValue(currentContext->bytePointer); - stackTop = getIntegerValue(currentContext->stackTop); + bytePointer = currentContext->bytePointer; + stackTop = currentContext->stackTop; } void storePointers() { - currentContext->bytePointer = newInteger(bytePointer); - currentContext->stackTop = newInteger(stackTop); + currentContext->bytePointer = bytePointer; + currentContext->stackTop = stackTop; } void stackPush(TObject* object); diff --git a/src/Image.cpp b/src/Image.cpp index 71fe3ff..b56e59f 100644 --- a/src/Image.cpp +++ b/src/Image.cpp @@ -165,8 +165,7 @@ TObject* Image::readObject() uint32_t value = m_imagePointer[0] | (m_imagePointer[1] << 8) | (m_imagePointer[2] << 16) | (m_imagePointer[3] << 24); m_imagePointer += sizeof(uint32_t); - TInteger newObject = newInteger(value); // FIXME endianness - return reinterpret_cast(newObject); + return TInteger(value); // FIXME endianness } case byteObject: { @@ -298,7 +297,7 @@ void Image::ImageWriter::writeObject(std::ofstream& os, TObject* object) switch (type) { case inlineInteger: { - uint32_t integer = getIntegerValue(reinterpret_cast(object)); + uint32_t integer = TInteger(object); os.write(reinterpret_cast(&integer), sizeof(integer)); } break; case byteObject: { diff --git a/src/JITRuntime.cpp b/src/JITRuntime.cpp index 71eac4f..66c0f35 100644 --- a/src/JITRuntime.cpp +++ b/src/JITRuntime.cpp @@ -207,8 +207,8 @@ TBlock* JITRuntime::createBlock(TContext* callingContext, uint8_t argLocation, u // Creating new context object and inheriting context variables // NOTE We do not allocating stack because it's not used in LLVM hptr newBlock = m_softVM->newObject(); - newBlock->argumentLocation = newInteger(argLocation); - newBlock->blockBytePointer = newInteger(bytePointer); + newBlock->argumentLocation = argLocation; + newBlock->blockBytePointer = bytePointer; newBlock->method = previousContext->method; newBlock->arguments = previousContext->arguments; newBlock->temporaries = previousContext->temporaries; @@ -282,7 +282,7 @@ void JITRuntime::optimizeFunction(Function* function) TObject* JITRuntime::invokeBlock(TBlock* block, TContext* callingContext) { // Guessing the block function name - const uint16_t blockOffset = getIntegerValue(block->blockBytePointer); + const uint16_t blockOffset = block->blockBytePointer; TBlockFunction compiledBlockFunction = lookupBlockFunctionInCache(block->method, blockOffset); @@ -379,7 +379,7 @@ TObject* JITRuntime::sendMessage(TContext* callingContext, TSymbol* message, TOb // initialization of various objects such as stackTop and bytePointer. // Creating context object and temporaries - hptr newTemps = m_softVM->newObject(getIntegerValue(method->temporarySize)); + hptr newTemps = m_softVM->newObject(method->temporarySize); newContext = m_softVM->newObject(); // Initializing context variables @@ -589,9 +589,9 @@ void JITRuntime::createDirectBlocks(TPatchInfo& info, TCallSite& callSite, TDire // Allocating context object and temporaries on the methodFunction's stack. // This operation does not affect garbage collector, so no pointer protection // is required. Moreover, this is operation is much faster than heap allocation. - const bool hasTemporaries = getIntegerValue(directMethod->temporarySize) > 0; + const bool hasTemporaries = static_cast(directMethod->temporarySize) > 0; const uint32_t contextSize = sizeof(TContext); - const uint32_t tempsSize = hasTemporaries ? sizeof(TObjectArray) + sizeof(TObject*) * getIntegerValue(directMethod->temporarySize) : 0; + const uint32_t tempsSize = hasTemporaries ? sizeof(TObjectArray) + sizeof(TObject*) * static_cast(directMethod->temporarySize) : 0; // Allocating stack space for objects and registering GC protection holder @@ -601,7 +601,7 @@ void JITRuntime::createDirectBlocks(TPatchInfo& info, TCallSite& callSite, TDire Value* tempsSlot = 0; if (hasTemporaries) { - MethodCompiler::TStackObject tempsPair = m_methodCompiler->allocateStackObject(builder, sizeof(TObjectArray), getIntegerValue(directMethod->temporarySize)); + MethodCompiler::TStackObject tempsPair = m_methodCompiler->allocateStackObject(builder, sizeof(TObjectArray), directMethod->temporarySize); tempsSlot = tempsPair.objectSlot; newBlock.tempsHolder = tempsPair.objectHolder; } else diff --git a/src/MethodCompiler.cpp b/src/MethodCompiler.cpp index 7627f35..4ccbf9d 100644 --- a/src/MethodCompiler.cpp +++ b/src/MethodCompiler.cpp @@ -718,7 +718,7 @@ void MethodCompiler::doPushConstant(TJITContext& jit) case 7: case 8: case 9: { - Value* integerValue = jit.builder->getInt32(newInteger(constant)); + Value* integerValue = jit.builder->getInt32( TInteger(constant) ); constantValue = jit.builder->CreateIntToPtr(integerValue, m_baseTypes.object->getPointerTo()); std::ostringstream ss; diff --git a/src/main.cpp b/src/main.cpp index ff49c9f..4a07d5d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -93,12 +93,12 @@ int main(int argc, char **argv) { initContext->arguments = vm.newObject(1); initContext->arguments->putField(0, globals.nilObject); - initContext->bytePointer = newInteger(0); + initContext->bytePointer = 0; initContext->previousContext = static_cast(globals.nilObject); - const uint32_t stackSize = getIntegerValue(globals.initialMethod->stackSize); + const uint32_t stackSize = globals.initialMethod->stackSize; initContext->stack = vm.newObject(stackSize); - initContext->stackTop = newInteger(0); + initContext->stackTop = 0; initContext->method = globals.initialMethod; diff --git a/src/primitives.cpp b/src/primitives.cpp index 7ecc503..94c240b 100644 --- a/src/primitives.cpp +++ b/src/primitives.cpp @@ -66,9 +66,8 @@ TObject* callPrimitive(uint8_t opcode, TObjectArray* arguments, bool& primitiveF case primitive::getSize: { // 4 TObject* object = args[0]; - uint32_t objectSize = isSmallInteger(object) ? 0 : object->getSize(); - - return reinterpret_cast(newInteger(objectSize)); + TInteger objectSize = isSmallInteger(object) ? 0 : object->getSize(); + return objectSize; } break; case primitive::stringAt: // 21 @@ -95,7 +94,7 @@ TObject* callPrimitive(uint8_t opcode, TObjectArray* arguments, bool& primitiveF // Smalltalk indexes arrays starting from 1, not from 0 // So we need to recalculate the actual array index before - uint32_t actualIndex = getIntegerValue(reinterpret_cast(indexObject)) - 1; + uint32_t actualIndex = static_cast(TInteger(indexObject)) - 1; // Checking boundaries if (actualIndex >= string->getSize()) { @@ -105,11 +104,11 @@ TObject* callPrimitive(uint8_t opcode, TObjectArray* arguments, bool& primitiveF if (opcode == primitive::stringAt) // String:at - return reinterpret_cast(newInteger( string->getByte(actualIndex) )); + return TInteger( string->getByte(actualIndex) ); else { // String:at:put - TInteger value = reinterpret_cast(valueObject); - string->putByte(actualIndex, getIntegerValue(value)); + TInteger value = TInteger(valueObject); + string->putByte(actualIndex, value); return static_cast(string); } } break; @@ -146,8 +145,8 @@ TObject* callPrimitive(uint8_t opcode, TObjectArray* arguments, bool& primitiveF } // Extracting values - int32_t leftOperand = getIntegerValue(reinterpret_cast(leftObject)); - int32_t rightOperand = getIntegerValue(reinterpret_cast(rightObject)); + int32_t leftOperand = TInteger(leftObject); + int32_t rightOperand = TInteger(rightObject); // Performing an operation return callSmallIntPrimitive(opcode, leftOperand, rightOperand, primitiveFailed); @@ -157,7 +156,7 @@ TObject* callPrimitive(uint8_t opcode, TObjectArray* arguments, bool& primitiveF case primitive::getSystemTicks: { //253 timeval tv; gettimeofday(&tv, NULL); - return reinterpret_cast(newInteger( (tv.tv_sec*1000000 + tv.tv_usec) / 1000)); + return TInteger( (tv.tv_sec*1000000 + tv.tv_usec) / 1000 ); } break; default: { @@ -172,21 +171,21 @@ TObject* callPrimitive(uint8_t opcode, TObjectArray* arguments, bool& primitiveF TObject* callSmallIntPrimitive(uint8_t opcode, int32_t leftOperand, int32_t rightOperand, bool& primitiveFailed) { switch (opcode) { case primitive::smallIntAdd: - return reinterpret_cast(newInteger( leftOperand + rightOperand )); //FIXME possible overflow + return TInteger( leftOperand + rightOperand ); //FIXME possible overflow case primitive::smallIntDiv: if (rightOperand == 0) { primitiveFailed = true; return globals.nilObject; } - return reinterpret_cast(newInteger( leftOperand / rightOperand )); + return TInteger( leftOperand / rightOperand ); case primitive::smallIntMod: if (rightOperand == 0) { primitiveFailed = true; return globals.nilObject; } - return reinterpret_cast(newInteger( leftOperand % rightOperand )); + return TInteger( leftOperand % rightOperand ); case primitive::smallIntLess: if (leftOperand < rightOperand) @@ -201,16 +200,16 @@ TObject* callSmallIntPrimitive(uint8_t opcode, int32_t leftOperand, int32_t righ return globals.falseObject; case primitive::smallIntMul: - return reinterpret_cast(newInteger( leftOperand * rightOperand )); //FIXME possible overflow + return TInteger( leftOperand * rightOperand ); //FIXME possible overflow case primitive::smallIntSub: - return reinterpret_cast(newInteger( leftOperand - rightOperand )); //FIXME possible overflow + return TInteger( leftOperand - rightOperand ); //FIXME possible overflow case primitive::smallIntBitOr: - return reinterpret_cast(newInteger( leftOperand | rightOperand )); + return TInteger( leftOperand | rightOperand ); case primitive::smallIntBitAnd: - return reinterpret_cast(newInteger( leftOperand & rightOperand )); + return TInteger( leftOperand & rightOperand ); case primitive::smallIntBitShift: { // operator << if rightOperand < 0, operator >> if rightOperand >= 0 @@ -229,7 +228,7 @@ TObject* callSmallIntPrimitive(uint8_t opcode, int32_t leftOperand, int32_t righ } } - return reinterpret_cast(newInteger(result)); + return TInteger(result); } default: @@ -247,19 +246,17 @@ TObject* callIOPrimitive(uint8_t opcode, TObjectArray& args, bool& primitiveFail if (input == EOF) return globals.nilObject; else - return reinterpret_cast(newInteger(input)); + return TInteger(input); } break; case primitive::ioPutChar: { // 3 - TInteger charObject = reinterpret_cast(args[0]); - int8_t charValue = getIntegerValue(charObject); - + int8_t charValue = TInteger( args[0] ); std::putchar(charValue); } break; case primitive::ioFileOpen: { // 100 TString* name = args.getField(0); - int32_t mode = getIntegerValue(reinterpret_cast( args[1] )); + int32_t mode = TInteger( args[1] ); //We have to pass NULL-terminated string to open() //The easiest way is to build it with std::string @@ -269,12 +266,12 @@ TObject* callIOPrimitive(uint8_t opcode, TObjectArray& args, bool& primitiveFail if (fileID < 0) { primitiveFailed = true; } else { - return reinterpret_cast( newInteger(fileID) ); + return TInteger(fileID); } } break; case primitive::ioFileClose: { // 103 - int32_t fileID = getIntegerValue(reinterpret_cast( args[0] )); + int32_t fileID = TInteger( args[0] ); int32_t result = close(fileID); if (result < 0) { @@ -283,29 +280,29 @@ TObject* callIOPrimitive(uint8_t opcode, TObjectArray& args, bool& primitiveFail } break; case primitive::ioFileSetStatIntoArray: { // 105 - int32_t fileID = getIntegerValue(reinterpret_cast( args[0] )); + int32_t fileID = TInteger( args[0] ); TObjectArray* array = args.getField(1); struct stat fileStat; if( fstat(fileID, &fileStat) < 0 ) { primitiveFailed = true; } else { - TObject* size = reinterpret_cast( newInteger( fileStat.st_size )); + TObject* size = TInteger( fileStat.st_size ); array->putField(0, size); - TObject* inode = reinterpret_cast( newInteger( fileStat.st_ino )); + TObject* inode = TInteger( fileStat.st_ino ); array->putField(1, inode); - TObject* modeMask = reinterpret_cast( newInteger( fileStat.st_mode )); + TObject* modeMask = TInteger( fileStat.st_mode ); array->putField(2, modeMask); } } break; case primitive::ioFileReadIntoByteArray: // 106 case primitive::ioFileWriteFromByteArray: { // 107 - int32_t fileID = getIntegerValue(reinterpret_cast( args[0] )); + int32_t fileID = TInteger( args[0] ); TByteArray* bufferArray = args.getField(1); - uint32_t size = getIntegerValue(reinterpret_cast( args[2] )); + uint32_t size = TInteger( args[2] ); if ( size > bufferArray->getSize() ) { primitiveFailed = true; @@ -323,18 +320,18 @@ TObject* callIOPrimitive(uint8_t opcode, TObjectArray& args, bool& primitiveFail if (involvedItems < 0) { primitiveFailed = true; } else { - return reinterpret_cast(newInteger(involvedItems)); + return TInteger(involvedItems); } } break; case primitive::ioFileSeek: { // 108 - int32_t fileID = getIntegerValue(reinterpret_cast( args[0] )); - int32_t position = getIntegerValue(reinterpret_cast( args[1] )); + int32_t fileID = TInteger( args[0] ); + int32_t position = TInteger( args[1] ); if( (position < 0) || ((position = lseek(fileID, position, SEEK_SET)) < 0) ) { primitiveFailed = true; } else { - return reinterpret_cast(newInteger(position)); + return TInteger(position); } } break; diff --git a/src/vm.cpp b/src/vm.cpp index 5a803a1..be7dd16 100644 --- a/src/vm.cpp +++ b/src/vm.cpp @@ -333,11 +333,11 @@ void SmalltalkVM::doPushBlock(TVMExecutionContext& ec) hptr newBlock = newObject(); // Allocating block's stack - uint32_t stackSize = getIntegerValue(ec.currentContext->method->stackSize); + uint32_t stackSize = ec.currentContext->method->stackSize; newBlock->stack = newObject(stackSize/*, false*/); - newBlock->argumentLocation = newInteger(ec.instruction.low); - newBlock->blockBytePointer = newInteger(ec.bytePointer); + newBlock->argumentLocation = ec.instruction.low; + newBlock->blockBytePointer = ec.bytePointer; //We set block->bytePointer, stackTop, previousContext when block is invoked @@ -398,15 +398,15 @@ void SmalltalkVM::doSendMessage(TVMExecutionContext& ec, TSymbol* selector, TObj // Create a new context for the giving method and arguments hptr newContext = newObject(); - hptr newStack = newObject(getIntegerValue(receiverMethod->stackSize)); - hptr newTemps = newObject(getIntegerValue(receiverMethod->temporarySize)); + hptr newStack = newObject(receiverMethod->stackSize); + hptr newTemps = newObject(receiverMethod->temporarySize); newContext->stack = newStack; newContext->temporaries = newTemps; newContext->arguments = messageArguments; newContext->method = receiverMethod; - newContext->stackTop = newInteger(0); - newContext->bytePointer = newInteger(0); + newContext->stackTop = 0; + newContext->bytePointer = 0; // Suppose that current send message operation is last operation in the current context. // If it is true then next instruction will be either stackReturn or blockReturn. @@ -500,8 +500,8 @@ void SmalltalkVM::doSendBinary(TVMExecutionContext& ec) // If operands are both small integers, we may handle it ourselves if (isSmallInteger(leftObject) && isSmallInteger(rightObject)) { // Loading actual operand values - int32_t rightOperand = getIntegerValue(reinterpret_cast(rightObject)); - int32_t leftOperand = getIntegerValue(reinterpret_cast(leftObject)); + int32_t rightOperand = TInteger(rightObject); + int32_t leftOperand = TInteger(leftObject); bool unusedCondition; // Performing an operation @@ -653,7 +653,7 @@ void SmalltalkVM::doPushConstant(TVMExecutionContext& ec) case 7: case 8: case 9: { - TObject* constInt = reinterpret_cast(newInteger(constant)); + TObject* constInt = TInteger(constant); ec.stackPush(constInt); } break; @@ -723,13 +723,13 @@ SmalltalkVM::TExecuteResult SmalltalkVM::doPrimitive(hptr& process, TV } // Inject the result... - ec.stackTop = getIntegerValue(ec.currentContext->stackTop); + ec.stackTop = ec.currentContext->stackTop; ec.stackPush( ec.returnedValue ); // Save the stack pointer - ec.currentContext->stackTop = newInteger(ec.stackTop); + ec.currentContext->stackTop = ec.stackTop; - ec.bytePointer = getIntegerValue(ec.currentContext->bytePointer); + ec.bytePointer = ec.currentContext->bytePointer; } return returnNoReturn; @@ -811,21 +811,20 @@ TObject* SmalltalkVM::performPrimitive(uint8_t opcode, hptr& process, #endif case primitive::startNewProcess: { // 6 - TInteger value = reinterpret_cast( ec.stackPop() ); - uint32_t ticks = getIntegerValue(value); + TInteger ticks = ec.stackPop(); TProcess* newProcess = ec.stackPop(); // FIXME possible stack overflow due to recursive call TExecuteResult result = this->execute(newProcess, ticks); - return reinterpret_cast(newInteger(result)); + return TInteger(result); } break; case primitive::allocateObject: { // 7 // Taking object's size and class from the stack TObject* size = ec.stackPop(); TClass* klass = ec.stackPop(); - uint32_t fieldsCount = getIntegerValue(reinterpret_cast(size)); + uint32_t fieldsCount = TInteger(size); // Instantinating the object. Each object has size and class fields @@ -834,7 +833,7 @@ TObject* SmalltalkVM::performPrimitive(uint8_t opcode, hptr& process, case primitive::blockInvoke: { // 8 TBlock* block = ec.stackPop(); - uint32_t argumentLocation = getIntegerValue(block->argumentLocation); + uint32_t argumentLocation = block->argumentLocation; // Amount of arguments stored on the stack except the block itself uint32_t argCount = ec.instruction.low - 1; @@ -859,7 +858,7 @@ TObject* SmalltalkVM::performPrimitive(uint8_t opcode, hptr& process, // Block is bound to the method's bytecodes, so it's // first bytecode will not be zero but the value specified - ec.bytePointer = getIntegerValue(block->blockBytePointer); + ec.bytePointer = block->blockBytePointer; return block; } break; @@ -870,8 +869,8 @@ TObject* SmalltalkVM::performPrimitive(uint8_t opcode, hptr& process, break; case primitive::allocateByteArray: { // 20 - int32_t dataSize = getIntegerValue(reinterpret_cast( ec.stackPop() )); - TClass* klass = ec.stackPop(); + TInteger dataSize = ec.stackPop(); + TClass* klass = ec.stackPop(); return newBinaryObject(klass, dataSize); } break; @@ -893,7 +892,7 @@ TObject* SmalltalkVM::performPrimitive(uint8_t opcode, hptr& process, // Smalltalk indexes arrays starting from 1, not from 0 // So we need to recalculate the actual array index before - uint32_t actualIndex = getIntegerValue(reinterpret_cast(indexObject)) - 1; + uint32_t actualIndex = static_cast( TInteger(indexObject) ) - 1; // Checking boundaries if (actualIndex >= array->getSize()) { @@ -949,10 +948,7 @@ TObject* SmalltalkVM::performPrimitive(uint8_t opcode, hptr& process, break; } - TInteger integer = reinterpret_cast(object); - int32_t value = getIntegerValue(integer); - - return reinterpret_cast(newInteger(value)); // FIXME long integer + return object; // FIXME long integer } break; case primitive::flushCache: // 34 @@ -1053,9 +1049,9 @@ bool SmalltalkVM::doBulkReplace( TObject* destination, TObject* destinationStart // Smalltalk indexes are counted starting from 1. // We need to decrement all values to get the zero based index: - int32_t iSourceStartOffset = getIntegerValue(reinterpret_cast(sourceStartOffset)) - 1; - int32_t iDestinationStartOffset = getIntegerValue(reinterpret_cast(destinationStartOffset)) - 1; - int32_t iDestinationStopOffset = getIntegerValue(reinterpret_cast(destinationStopOffset)) - 1; + int32_t iSourceStartOffset = static_cast( TInteger(sourceStartOffset) ) - 1; + int32_t iDestinationStartOffset = static_cast( TInteger(destinationStartOffset) ) - 1; + int32_t iDestinationStopOffset = static_cast( TInteger(destinationStopOffset) ) - 1; int32_t iCount = iDestinationStopOffset - iDestinationStartOffset + 1; if ( iSourceStartOffset < 0 || From da78d91d02fc950f5bd45bffbc8b6e725c795062 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Thu, 26 Dec 2013 23:01:56 +0400 Subject: [PATCH 15/44] Adds TInteger::operator +-(int32_t) With these operators we can write a code like: TInteger x = 42; int y = x + 2; Issue: #51 --- include/types.h | 2 ++ src/primitives.cpp | 2 +- src/vm.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/types.h b/include/types.h index 819ad4e..05e3379 100644 --- a/include/types.h +++ b/include/types.h @@ -64,6 +64,8 @@ class TInteger { TInteger(const TObject* value) : m_value(isSmallInteger(value) ? value : throw std::bad_cast()) { } operator int32_t() const { return getIntegerValue(m_value); } + int32_t operator +(int32_t right) const { return getIntegerValue(m_value) + right; } + int32_t operator -(int32_t right) const { return getIntegerValue(m_value) - right; } operator TObject*() const { return const_cast(m_value); } private: const TObject* m_value; diff --git a/src/primitives.cpp b/src/primitives.cpp index 94c240b..bd4a03a 100644 --- a/src/primitives.cpp +++ b/src/primitives.cpp @@ -94,7 +94,7 @@ TObject* callPrimitive(uint8_t opcode, TObjectArray* arguments, bool& primitiveF // Smalltalk indexes arrays starting from 1, not from 0 // So we need to recalculate the actual array index before - uint32_t actualIndex = static_cast(TInteger(indexObject)) - 1; + uint32_t actualIndex = TInteger(indexObject) - 1; // Checking boundaries if (actualIndex >= string->getSize()) { diff --git a/src/vm.cpp b/src/vm.cpp index be7dd16..7a1711b 100644 --- a/src/vm.cpp +++ b/src/vm.cpp @@ -892,7 +892,7 @@ TObject* SmalltalkVM::performPrimitive(uint8_t opcode, hptr& process, // Smalltalk indexes arrays starting from 1, not from 0 // So we need to recalculate the actual array index before - uint32_t actualIndex = static_cast( TInteger(indexObject) ) - 1; + uint32_t actualIndex = TInteger(indexObject) - 1; // Checking boundaries if (actualIndex >= array->getSize()) { @@ -1049,9 +1049,9 @@ bool SmalltalkVM::doBulkReplace( TObject* destination, TObject* destinationStart // Smalltalk indexes are counted starting from 1. // We need to decrement all values to get the zero based index: - int32_t iSourceStartOffset = static_cast( TInteger(sourceStartOffset) ) - 1; - int32_t iDestinationStartOffset = static_cast( TInteger(destinationStartOffset) ) - 1; - int32_t iDestinationStopOffset = static_cast( TInteger(destinationStopOffset) ) - 1; + int32_t iSourceStartOffset = TInteger(sourceStartOffset) - 1; + int32_t iDestinationStartOffset = TInteger(destinationStartOffset) - 1; + int32_t iDestinationStopOffset = TInteger(destinationStopOffset) - 1; int32_t iCount = iDestinationStopOffset - iDestinationStartOffset + 1; if ( iSourceStartOffset < 0 || From 5c9b9818eea7b21a5beb3cfc882eeec35dc12f16 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Sat, 28 Dec 2013 21:11:08 +0400 Subject: [PATCH 16/44] Fixes JIT compilation Issue: #51 --- include/types.h | 1 + src/MethodCompiler.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/types.h b/include/types.h index 05e3379..bad2d2b 100644 --- a/include/types.h +++ b/include/types.h @@ -67,6 +67,7 @@ class TInteger { int32_t operator +(int32_t right) const { return getIntegerValue(m_value) + right; } int32_t operator -(int32_t right) const { return getIntegerValue(m_value) - right; } operator TObject*() const { return const_cast(m_value); } + int32_t rawValue() const { return reinterpret_cast(m_value); } private: const TObject* m_value; protected: diff --git a/src/MethodCompiler.cpp b/src/MethodCompiler.cpp index 4ccbf9d..e7e8838 100644 --- a/src/MethodCompiler.cpp +++ b/src/MethodCompiler.cpp @@ -718,7 +718,7 @@ void MethodCompiler::doPushConstant(TJITContext& jit) case 7: case 8: case 9: { - Value* integerValue = jit.builder->getInt32( TInteger(constant) ); + Value* integerValue = jit.builder->getInt32( TInteger(constant).rawValue() ); constantValue = jit.builder->CreateIntToPtr(integerValue, m_baseTypes.object->getPointerTo()); std::ostringstream ss; From 7bcccd6dd76bd9844f9b87f06ed8124f7512b17d Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Sat, 28 Dec 2013 23:34:46 +0400 Subject: [PATCH 17/44] TInteger keeps m_value of type int32_t, not TObject* Issue: #51 --- include/types.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/include/types.h b/include/types.h index bad2d2b..a983f2f 100644 --- a/include/types.h +++ b/include/types.h @@ -57,19 +57,21 @@ inline std::size_t correctPadding(std::size_t size) { return (size + sizeof(void inline bool isSmallInteger(const TObject* value) { return reinterpret_cast(value) & 1; } // This is a special interpretation of Smalltalk's SmallInteger -// The class is binary compatible with the TObject* -class TInteger { -public: - TInteger(int32_t value) : m_value(newInteger(value)) { } - TInteger(const TObject* value) : m_value(isSmallInteger(value) ? value : throw std::bad_cast()) { } - - operator int32_t() const { return getIntegerValue(m_value); } - int32_t operator +(int32_t right) const { return getIntegerValue(m_value) + right; } - int32_t operator -(int32_t right) const { return getIntegerValue(m_value) - right; } - operator TObject*() const { return const_cast(m_value); } - int32_t rawValue() const { return reinterpret_cast(m_value); } +// The struct is binary compatible with the TObject* +struct TInteger { + TInteger(int32_t value) : m_value( reinterpret_cast(newInteger(value)) ) { } + TInteger(const TObject* value) : m_value( isSmallInteger(value) ? reinterpret_cast(value) : throw std::bad_cast() ) { } + + int32_t getValue() const { return getIntegerValue(reinterpret_cast(m_value)); } + int32_t rawValue() const { return m_value; } + + operator int32_t() const { return getValue(); } + int32_t operator +(int32_t right) const { return getValue() + right; } + int32_t operator -(int32_t right) const { return getValue() - right; } + operator TObject*() const { return reinterpret_cast(m_value); } + private: - const TObject* m_value; + int32_t m_value; protected: static int32_t getIntegerValue(const TObject* value) { return reinterpret_cast(value) >> 1; } static TObject* newInteger(int32_t value) { return reinterpret_cast((value << 1) | 1); } From e1387e32db0284c565b4ba2387c543cfc2b576cc Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Sun, 29 Dec 2013 00:48:15 +0400 Subject: [PATCH 18/44] Fixes CPACK_SOURCE_IGNORE_FILES Target `package_source` should not pack neither .kdev_include_paths nor *.image files. Issue: #43 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 086b83a..808b176 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,7 +94,7 @@ set (CPACK_PACKAGE_VERSION_MINOR "2") set (CPACK_PACKAGE_VERSION_PATCH "1") set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set (CPACK_SOURCE_GENERATOR "TGZ") -set (CPACK_SOURCE_IGNORE_FILES "build/;\\\\.kdev4.*;\\\\.git/;\\\\.hgignore") +set (CPACK_SOURCE_IGNORE_FILES "build/;\\\\.kdev.*;\\\\.git.*;\\\\.hgignore;.*\\\\.image") set (CPACK_STRIP_FILES "llst") From 164ebf8f60af0ea27f0c324603a59a6780145d7a Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Sun, 29 Dec 2013 01:26:58 +0400 Subject: [PATCH 19/44] Adds a template for extended description for deb package Issue: #43 --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 808b176..5454550 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,10 @@ install(FILES misc/bash-completion.sh DESTINATION share/bash-completion/completi set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "LLVM powered Little Smalltalk") +set (CPACK_DEBIAN_PACKAGE_DESCRIPTION # The format of Description: http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description +"LLVM powered Little Smalltalk + LLST is a virtual machine with integrated JIT. +") set (CPACK_PACKAGE_CONTACT "info@llst.org") set (CPACK_PACKAGE_VERSION_MAJOR "0") set (CPACK_PACKAGE_VERSION_MINOR "2") From 035c06974a9e901f34ce9ae49a18b5fc3447aa0e Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Sun, 29 Dec 2013 03:03:14 +0400 Subject: [PATCH 20/44] Adds script to generate ChangeLog Issue: #43 --- misc/changelog.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 misc/changelog.sh diff --git a/misc/changelog.sh b/misc/changelog.sh new file mode 100755 index 0000000..aa5c52f --- /dev/null +++ b/misc/changelog.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Author:Andrey Nikishaev + +FORMAT="%ad %an <%ae>%n%n%w(0,4,4)%B" + +git tag -l | sort -u -r | while read TAG ; do + echo + if [ $NEXT ];then + echo [$NEXT] + else + echo "[Current]" + fi + GIT_PAGER=cat git log --no-merges --date=short --format="$FORMAT" $TAG..$NEXT + NEXT=$TAG +done +FIRST=$(git tag -l | head -1) +echo [$FIRST] +GIT_PAGER=cat git log --no-merges --date=short --format="$FORMAT" $FIRST From 8c70b4e3372758f234d958e32c15c2c02a28c411 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Tue, 31 Dec 2013 19:37:12 +0400 Subject: [PATCH 21/44] Implements primitive 'readline' inside CompletionEngine Issue: #52 --- include/CompletionEngine.h | 2 ++ src/CompletionEngine.cpp | 18 ++++++++++++++++++ src/vm.cpp | 19 ++++++++----------- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/include/CompletionEngine.h b/include/CompletionEngine.h index 3fd217a..6e647f2 100644 --- a/include/CompletionEngine.h +++ b/include/CompletionEngine.h @@ -66,4 +66,6 @@ class CompletionEngine { } void initialize(TDictionary* globals); + bool readline(const std::string& prompt, std::string& result); + void addHistory(const std::string& line); }; diff --git a/src/CompletionEngine.cpp b/src/CompletionEngine.cpp index 794122e..f42d87c 100644 --- a/src/CompletionEngine.cpp +++ b/src/CompletionEngine.cpp @@ -34,6 +34,9 @@ #include #include +#include +#include +#include std::auto_ptr CompletionEngine::s_instance(new CompletionEngine); @@ -104,3 +107,18 @@ void CompletionEngine::initialize(TDictionary* globals) } } } + +bool CompletionEngine::readline(const std::string& prompt, std::string& result) { + char* input = ::readline(prompt.c_str()); + if (input) { + uint32_t inputSize = std::strlen(input); + result = std::string(input, inputSize); + std::free(input); + return true; + } + return false; +} + +void CompletionEngine::addHistory(const std::string& line) { + add_history( line.c_str() ); +} diff --git a/src/vm.cpp b/src/vm.cpp index 7a1711b..5e0b831 100644 --- a/src/vm.cpp +++ b/src/vm.cpp @@ -34,8 +34,7 @@ #include -#include -#include +#include #include #include #include @@ -779,17 +778,15 @@ TObject* SmalltalkVM::performPrimitive(uint8_t opcode, hptr& process, TString* prompt = ec.stackPop(); std::string strPrompt(reinterpret_cast(prompt->getBytes()), prompt->getSize()); - char* input = readline(strPrompt.c_str()); - if (input) { - uint32_t inputSize = std::strlen(input); + std::string input; + bool userInsertedAnything = CompletionEngine::Instance()->readline(strPrompt, input); - if (inputSize > 0) - add_history(input); + if ( userInsertedAnything ) { + if ( !input.empty() ) + CompletionEngine::Instance()->addHistory(input); - TString* result = static_cast( newBinaryObject(globals.stringClass, inputSize) ); - std::memcpy(result->getBytes(), input, inputSize); - - std::free(input); + TString* result = static_cast( newBinaryObject(globals.stringClass, input.size()) ); + std::memcpy(result->getBytes(), input.c_str(), input.size()); return result; } else return globals.nilObject; From 6e142cd79582807d9a1274a7dbb4653b595cf5ee Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Tue, 31 Dec 2013 23:08:41 +0400 Subject: [PATCH 22/44] Removes redundant static_cast for TInteger Issue: #51 --- src/JITRuntime.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/JITRuntime.cpp b/src/JITRuntime.cpp index 66c0f35..b13013f 100644 --- a/src/JITRuntime.cpp +++ b/src/JITRuntime.cpp @@ -589,9 +589,9 @@ void JITRuntime::createDirectBlocks(TPatchInfo& info, TCallSite& callSite, TDire // Allocating context object and temporaries on the methodFunction's stack. // This operation does not affect garbage collector, so no pointer protection // is required. Moreover, this is operation is much faster than heap allocation. - const bool hasTemporaries = static_cast(directMethod->temporarySize) > 0; + const bool hasTemporaries = directMethod->temporarySize > 0; const uint32_t contextSize = sizeof(TContext); - const uint32_t tempsSize = hasTemporaries ? sizeof(TObjectArray) + sizeof(TObject*) * static_cast(directMethod->temporarySize) : 0; + const uint32_t tempsSize = hasTemporaries ? sizeof(TObjectArray) + sizeof(TObject*) * directMethod->temporarySize : 0; // Allocating stack space for objects and registering GC protection holder From b4d78fd4c37eec440b3f555de1d9f8fc53de1233 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Mon, 6 Jan 2014 03:00:10 +0400 Subject: [PATCH 23/44] Adds a new cmake target to compress and install ChangeLog Issue: #43 --- .gitattributes | 3 +- CMakeLists.txt | 10 +- ChangeLog | 3793 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 3804 insertions(+), 2 deletions(-) create mode 100644 ChangeLog diff --git a/.gitattributes b/.gitattributes index 5669134..7176cb1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ -*man -diff +*man -diff +ChangeLog -diff diff --git a/CMakeLists.txt b/CMakeLists.txt index 5454550..1cff931 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,11 +78,19 @@ add_custom_command( WORKING_DIRECTORY ${IMAGE_DIR} COMMENT "Building image" ) - add_custom_target(image ALL DEPENDS ${IMAGE_DIR}/LittleSmalltalk.image) +add_custom_command( + OUTPUT changelog.gz + COMMAND gzip -9c ${CMAKE_CURRENT_SOURCE_DIR}/ChangeLog > changelog.gz + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ChangeLog + COMMENT "Compressing changelog" +) +add_custom_target(compress_changelog ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz) + install(TARGETS llst DESTINATION bin) install(FILES LICENSE DESTINATION share/doc/${PROJECT_NAME} RENAME copyright) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz DESTINATION share/doc/${PROJECT_NAME}) install(FILES doc/llst.1.en.gz DESTINATION share/man/man1/ RENAME llst.1.gz) install(FILES misc/bash-completion.sh DESTINATION share/bash-completion/completions RENAME llst) diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e1e87c9 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,3793 @@ + +[Current] +2013-12-29 Roman Proskuryakov + + Adds script to generate ChangeLog + + Issue: #43 + +2013-12-29 Roman Proskuryakov + + Adds a template for extended description for deb package + + Issue: #43 + +2013-12-29 Roman Proskuryakov + + Fixes CPACK_SOURCE_IGNORE_FILES + + Target `package_source` should not pack neither .kdev_include_paths nor *.image files. + + Issue: #43 + +2013-12-02 Roman Proskuryakov + + Adds bash completion for llst installed with deb + + Issue: #43 + +2013-12-01 Roman Proskuryakov + + Fixes error: 'unknown type name FILE' + + Issue: #45 + +2013-11-28 Roman Proskuryakov + + Adds the help about llst args + + To display it run `./llst --help`. + + Issue: #33 + +2013-11-27 Roman Proskuryakov + + Adds an empty man for llst + + Issue: #43 + +2013-11-23 Roman Proskuryakov + + Fixes a lot of lintian warnings + + -strips executable + -adds maintainer + -adds dependencies + -changes the name of the project + + Issue: #43 + +2013-11-23 Roman Proskuryakov + + Fix LICENSE due to `http://www.debian.org/doc/debian-policy/ch-docs.html#s-copyrightfile` + + Issue: #43 + +2013-11-23 Roman Proskuryakov + + Adds `make package` + + Issue: #43 + +2013-11-22 Roman Proskuryakov + + Adds `make package_source` + + Issue: #43 + + +[v_0.2.1] +2013-11-18 Dmitry Kashitsyn + + Fixes version in main.cpp + +2013-11-18 Dmitry Kashitsyn + + Fixes readme + + Issue: #23 + + +[v_0.2] +2013-11-18 Dmitry Kashitsyn + + Bumps version to 0.2 + +2013-11-17 Dmitry Kashitsyn + + Adds readme + + Issue: #23 + +2013-11-17 Roman Proskuryakov + + Fixes typos in CompletionEngine + + Issue: #27 + +2013-11-17 Dmitry Kashitsyn + + Moves completion engine init code to the proper place + + Issue: #40 + +2013-11-17 Dmitry Kashitsyn + + Adds copyleft notice to Core.ll and args.h + + Issue: #10 + +2013-11-17 Dmitry Kashitsyn + + Adds copyleft notice to source files + + Issue: #10 + +2013-11-17 Dmitry Kashitsyn + + Fixes s/Lo/Low/ in source files copyleft notice + + Issue: #10 + +2013-11-16 Dmitry Kashitsyn + + Adds specifying comment to TArray::operator[] + + Issue: #27 + +2013-11-16 Dmitry Kashitsyn + + Adds const specifier to isSmallInteger and TObject::cast() + + Issue: #27 + +2013-11-16 Dmitry Kashitsyn + + Links to pthread only in LLVM mode + + llvm-config utility provides required libraries to link to. + We do not need to specify pthread ourselves. + + Issue: #27 + +2013-11-14 Roman Proskuryakov + + Fixes clang warnings about unused arguments of linker + + Issue: #39 + +2013-11-14 Roman Proskuryakov + + Switch to a new radix tree by Yuuki Takano + + Issue: #39 + +2013-11-14 Roman Proskuryakov + + Adds default ctor for TSymbol::TCompareFunctor + + Issue: #39 + +2013-11-13 Roman Proskuryakov + + Renames llvm_types.ll -> Core.ll + + Issue: #27 + +2013-11-13 Roman Proskuryakov + + Calls strerror with strict std:: prefix + + Issue: #27 + +2013-11-13 Roman Proskuryakov + + Fixes correct padding in Image::readObject():byteObject + + Issue: #27 + +2013-11-04 Roman Proskuryakov + + Removes trailing whitespaces + + Issue: #27 + +2013-11-04 Roman Proskuryakov + + Prettifies memory.h + + Removes redundant and outdated comments. + Removes static_cast from volatile experiments. + + Issue: #27 + +2013-11-12 Roman Proskuryakov + + Autodetects 64 bit architecture and sets -m32 + + The parameter is set only on 64-bit OS. + + Now you can compile llst under Raspberry Pi or Ubuntu/i686 + or Ubuntu/x86_64 without any changes in CMakelists.txt. + + Issue: #9 + +2013-11-13 Dmitry Kashitsyn + + Add workaround for JIT compiler to handle soft compiled methods + + In-image Smalltalk compiler produces byte codes with trailing zeroes. + In case of soft VM this is not a problem, because control flow + never reaches them due to default method exit sequence. + + In case of JIT compiler we need to fully process all available + bytecodes because we do not know how control will flow. + + Correct solution will be to fix the in-image Smalltalk compiler. + However it is a complex task that should be handled carefully. + + For now we're just ignoring such zero opcodes treating them as NOP. + + Issue: #26 + +2013-11-11 Dmitry Kashitsyn + + Makes LLVM optional + + In order to build llst with llvm support, pass -DLLVM=ON to cmake + + Issue: #9 + +2013-11-11 Roman Proskuryakov + + Adds templated and casting version of Image::getGlobal<>() + + Issue: #38 + +2013-11-11 Dmitry Kashitsyn + + Adds casting version of TDictionary::find<>() + + Issue: #38 + +2013-11-06 Roman Proskuryakov + + Replaces a lot of C-style casts with static_cast + + Issue: #38 + +2013-11-06 Roman Proskuryakov + + Fixes specific casts in memory managers + + Issue: #38 + +2013-11-06 Roman Proskuryakov + + Fixes casts in pointer arithmetic in memory managers + + Issue: #38 + +2013-11-06 Roman Proskuryakov + + Adds static_cast to specialized SmalltalkVM::newObject<>() + + Issue: #38 + +2013-11-06 Roman Proskuryakov + + Adds static_cast into hptr_base + + Issue: #38 + +2013-11-06 Roman Proskuryakov + + Rewrites unspecialized SmalltalkVM::newObject with static_cast + + Issue: #38 + +2013-10-22 Roman Proskuryakov + + Adds the skeleton of CLI args + + Issue: #33 + +2013-10-16 Roman Proskuryakov + + Adds NonCollect MM + + Issue: #36 + +2013-11-06 Roman Proskuryakov + + Adds templated TArray::getField<>() + + Issue: #38 + +2013-11-06 Roman Proskuryakov + + Adds templated TVMExecutionContext::stackPop<>() + + Issue: #38 + +2013-11-06 Roman Proskuryakov + + Adds templated Image::readObject<>() + + Issue: #38 + +2013-11-04 Roman Proskuryakov + + Fixes TArray::operator[] + + The previous implementation used reinterpret_cast which is type-unsafe. + Now the compiler throws error if you try to instantiate TArray and + use operator[]. + + Issue: #34 + +2013-10-19 Roman Proskuryakov + + Prettifies BakerMemoryManager::releaseExternalHeapPointer. + + Issue: #27 + +2013-10-19 Roman Proskuryakov + + Removes unneeded volatile qualifiers. + + Issue: #27 + +2013-10-19 Roman Proskuryakov + + Removes IMemoryManager::registerExternalPointer and IMemoryManager::releaseExternalPointer. + Fixes GenerationalMemoryManager::moveYoungObjects. + + Issue: #27 + +2013-10-31 Roman Proskuryakov + + Fixes Dictionary>>includes: which broke Collection>>printString + + Issue: #35 + +2013-10-31 Roman Proskuryakov + + Fixes Collection>>includes: which broke List>>= + Adds tests for List>>includes: and fixes other tests for class List. + + Issue: #35 + +2013-10-31 Dmitry Kashitsyn + + Reverts List>>select: to original recursive form + + Previous experiments with tail field was not correctly reverted. + One of them was the #select: method. + + Issue: #35 + +2013-10-31 Dmitry Kashitsyn + + Reverts List>>appendList: to it's original state + + Previous experiments with tail field was not correctly reverted. + One of them was the #appendList: method. + + Issue: #35 + +2013-10-30 Roman Proskuryakov + + Adds more tests for class List + + Issue: #35 + +2013-10-18 Roman Proskuryakov + + Fixes the condition for symbols for completion engine. + + Issue: #27 + +2013-10-12 Roman Proskuryakov + + Add strict std:: for standard functions. + + Issue: #27 + +2013-10-12 Dmitry Kashitsyn + + Refactors TArray::operator[] to eliminate unsafe cast + + FreeBSD complains that cast in TArray::operator[] may + break aliasing rules due to access through badly aliased pointers. + + Linux port of GCC on the other hand do not complain. + However we need to eliminate this potential problems. + + This commit slightly modifies the template parameter from T* to T. + Also C-style cast is changed to C++ cast. + + Note: + Current implementation uses reinterpret_cast but technically + static_cast should be OK. Adding static_cast forces compiler + to complain that the cast is invalid. + + TArray is expected to be specialized with descendants + of TObject as T. Therefore static_cast from TObject* to T* should + be considered safe. But it isn't probably due to template nature. + + Needs more investigation though. + + Issue: #34 + +2013-10-12 Dmitry Kashitsyn + + Defines fields and bytes as union in TObject + + Issue: #34 + +2013-10-07 Roman Proskuryakov + + Fixes #include headers. + + Issue: #27 + +2013-10-04 Roman Proskuryakov + + Removes unused parameter 'callingContext' from MethodCompiler::compileMethod. + + Issue: #27 + +2013-10-02 Dmitry Kashitsyn + + Renames MethodCompiler::StackAlloca to TStackObject and adds comment + + Issue: #27 + +2013-10-02 Dmitry Kashitsyn + + Redeclares descendants of TStackValue as struct instead of class + + Issue: #27 + +2013-10-01 Roman Proskuryakov + + Transforms TDictionary::find into a templated function. + + Issue: #30 + +2013-10-01 Roman Proskuryakov + + Add newline at EOF. + + Issue: #27 + +2013-10-01 Roman Proskuryakov + + Removes const_cast from hptr::operator[]. + + Issue: #27 + +2013-10-01 Dmitry Kashitsyn + + Replaces LLVM>>do: to Jit>>do: in doc + + Issue: #27 + +2013-09-30 Roman Proskuryakov + + Uses objectSlot everywhere in the case opcode::assignInstance. + + Issue: #27 + +2013-09-30 Roman Proskuryakov + + Renames TSymbol::less to TSymbol::TCompareFunctor. + + Issue: #20 + +2013-09-30 Dmitry Kashitsyn + + Removes -UNDEBUG due to crash in Jit>>do: + +2013-09-30 Dmitry Kashitsyn + + Removes GC per tick invocation + +2013-09-18 Roman Proskuryakov + + Moves compare operators from TDictionary to TSymbol. + + Issue #20 + +2013-09-21 Roman Proskuryakov + + Reverts List methods. Removes fields tail and head. + + Issue #18 + +2013-09-21 Roman Proskuryakov + + Prettifies the usage of memset function inside LLVM IR. + + Issue #11 + +2013-09-20 Roman Proskuryakov + + MethodCompiler::createArray now uses stack allocation. + + Issue #11 + +2013-09-20 Roman Proskuryakov + + Moves allocateStackObject from JITRuntime to MethodCompiler + + Issue #11 + +2013-09-17 Roman Proskuryakov + + Add tests for class Magnitude + + Issue #19 + +2013-09-17 Roman Proskuryakov + + Fixes comparison operators in class Magnitude + + Issue #19 + +2013-09-19 Roman Proskuryakov + + Removes redundant calls to memset from TObject ctor and TByteObject ctor. + Memory manager will zero it, no need to memset it twice. + We gain ~9% speedup :D + +2013-09-18 Roman Proskuryakov + + Fixes the comparison operator + + Issue #1 + +2013-09-09 Roman Proskuryakov + + Fixes redundant cast and header style in Baker MM + +2013-09-08 Dmitry Kashitsyn + + Added tag orphan-llvm-3 for changeset 28f11517e164 + +2013-09-08 Dmitry Kashitsyn + + Added tag orphan-llvm-2 for changeset 6f7824033410 + +2013-09-08 Dmitry Kashitsyn + + Added tag orphan-llvm-1 for changeset 4a6bdbdcbae8 + +2013-09-08 Dmitry Kashitsyn + + Added tag orphan-humbug-5 for changeset b9a122a22fb4 + +2013-09-08 Dmitry Kashitsyn + + Added tag orphan-humbug-4 for changeset c8878db5b232 + +2013-09-08 Dmitry Kashitsyn + + Added tag orphan-humbug-3 for changeset 8703e9ed25b4 + +2013-09-08 Dmitry Kashitsyn + + Added tag orphan-humbug-2 for changeset 520782976b69 + +2013-09-08 Dmitry Kashitsyn + + Added tag orphan-humbug-1 for changeset b0512aeac249 + +2013-09-08 Dmitry Kashitsyn + + Added tag orphan-dk-2 for changeset f41ccf4cb6d6 + +2013-09-08 Dmitry Kashitsyn + + Added tag orphan-dk-1 for changeset c47c3ba57ec4 + +2013-09-07 Roman Proskuryakov + + Fixes some cppcheck warnings + +2013-09-07 Roman Proskuryakov + + Fixes common realloc mistake + +2013-09-07 Roman Proskuryakov + + Fixes headers + +2013-09-06 Roman Proskuryakov + + Fixes comparison between signed and unsigned integer expressions + +2013-09-06 Roman Proskuryakov + + Fixes headers + +2013-09-05 Roman Proskuryakov + + Collects GC per each tick + +2013-09-05 Roman Proskuryakov + + Adds more asserts + +2013-09-05 Roman Proskuryakov + + Adds more asserts + +2013-09-05 Roman Proskuryakov + + Fixes volatility in object_ptr + +2013-09-05 Roman Proskuryakov + + Reports about TContext::stack overflow + +2013-09-05 Roman Proskuryakov + + Fix: overflow in TContext::stack + +2013-09-05 Roman Proskuryakov + + Small fixes + +2013-09-05 Roman Proskuryakov + + Adds some cv-qualifiers + +2013-09-05 Roman Proskuryakov + + Removes unused function TSymbol::equalsTo + +2013-09-05 Roman Proskuryakov + + Fixes uninitialized field in Image::ImageWriter + +2013-09-04 Roman Proskuryakov + + Small fixes + +2013-09-03 Roman Proskuryakov + + Fixes some cppcheck warnings + +2013-09-03 Roman Proskuryakov + + Fix magic number in MethodCompiler::doSendBinary + +2013-09-03 Roman Proskuryakov + + Improves LLVM primitive::getClass, primitive::getSize + +2013-09-02 Roman Proskuryakov + + Creates wrap to work with ec.stack + +2013-08-20 Roman Proskuryakov + + Improves llvm_types.ll + +2013-08-20 Roman Proskuryakov + + Improves bool JITRuntime::detectLiteralReceiver + +2013-08-15 Roman Proskuryakov + + Adds more test cases for ListTest>>firstLink, ListTest>>lastLink + +2013-08-15 Roman Proskuryakov + + Add ListTest>>lastLink + +2013-08-15 Roman Proskuryakov + + Fixes ListTest>>firstLink + +2013-08-15 Roman Proskuryakov + + Fixes ListTest>>remove + +2013-08-15 Roman Proskuryakov + + Adds ST test for List>>at:put: + +2013-08-15 Roman Proskuryakov + + Fixes List>>at:put: , List>>at:ifAbsent: + +2013-08-15 Dmitry Kashitsyn + + Fix + +2013-08-15 Dmitry Kashitsyn + + Fixes List + +2013-08-15 Roman Proskuryakov + + Adds ST test for List>>at:put: + +2013-08-15 Roman Proskuryakov + + Adds ST test for List>>firstLink + +2013-08-15 Roman Proskuryakov + + Adds ST test for List>>remove: + +2013-08-15 Roman Proskuryakov + + Add ST test for List>>removeFirst + +2013-08-15 Roman Proskuryakov + + Adds ST test for List>>do: + +2013-08-15 Roman Proskuryakov + + Adds ST test for List>>at: + +2013-08-15 Roman Proskuryakov + + Adds ST test for List + +2013-08-15 Roman Proskuryakov + + Fix comment + +2013-08-15 Dmitry Kashitsyn + + Fixes list + +2013-08-15 Dmitry Kashitsyn + + Refactors List. Adds tail field and takes advantage of it + +2013-08-15 Roman Proskuryakov + + Adds more ST tests + +2013-08-15 Roman Proskuryakov + + Fixes StringTest>>lowerCase. Adds more tests + +2013-08-15 Dmitry Kashitsyn + + Renames LLVM to Jit in image source + +2013-08-11 Roman Proskuryakov + + Fixes JITRuntime::detectLiteralReceiver + +2013-08-11 Roman Proskuryakov + + Fixes the style of the code in JITRuntime::detectLiteralReceiver + +2013-08-11 Roman Proskuryakov + + Fixes the style of the code in Image.cpp + +2013-08-10 Roman Proskuryakov + + Adds JITRuntime::detectLiteralReceiver + +2013-08-10 Dmitry Kashitsyn + + Attempt to perform literal call optimization + +2013-08-10 Roman Proskuryakov + + Fixes llstPass + +2013-08-09 Dmitry Kashitsyn + + Fixes crash in sort test (bug in createDirectBlocks()) + +2013-08-09 Dmitry Kashitsyn + + Debugging crash in patching Collection>>sort: + +2013-08-09 Dmitry Kashitsyn + + Removes llvmBitcodes field from TMethod + +2013-08-09 Dmitry Kashitsyn + + Fixes stack overflow due to direct alloca, removes volatiles + +2013-08-09 Dmitry Kashitsyn + + Cleans up the code + +2013-08-09 Dmitry Kashitsyn + + Fixes stupid bug in root init + +2013-08-07 Dmitry Kashitsyn + + Fixes direct temps creation + +2013-08-07 Dmitry Kashitsyn + + debug temp + +2013-08-07 Dmitry Kashitsyn + + Fixes moveObjects() + +2013-08-07 Dmitry Kashitsyn + + Adds holder cleanup code + +2013-08-07 Dmitry Kashitsyn + + Adds support for stack objects in LLVMMemoryManager + +2013-08-07 Dmitry Kashitsyn + + Fixes direct blocks and disables llst optimization pass + +2013-08-07 Dmitry Kashitsyn + + Rewrites stack object protection using separate pointer + +2013-08-06 Roman Proskuryakov + + Adds more asserts + +2013-08-06 Roman Proskuryakov + + Removes redundant variables + +2013-08-06 Roman Proskuryakov + + Rewrites TObject* TDictionary::find with STL lower_bound + +2013-08-06 Dmitry Kashitsyn + + Second attempt to push through metadata + +2013-08-06 Dmitry Kashitsyn + + Adds allocateStackObject (incorrect) + +2013-08-06 Roman Proskuryakov + + Prettifies class Image (Image::ImageWriter) + +2013-08-06 Dmitry Kashitsyn + + Removes unneeded volatile specifiers + +2013-08-06 Dmitry Kashitsyn + + Fixes direct code + +2013-08-05 Dmitry Kashitsyn + + Setup debug environment + +2013-08-05 Dmitry Kashitsyn + + Passes correct context reference to newContext + +2013-08-05 Dmitry Kashitsyn + + Fixes MethodCompiler::pushBlock() + +2013-08-05 Dmitry Kashitsyn + + Fixes naming + +2013-08-05 Dmitry Kashitsyn + + Fixes patching code + +2013-08-05 Roman Proskuryakov + + Fixes ImageWriter + +2013-08-05 Dmitry Kashitsyn + + Fix & cleanup + +2013-08-05 Dmitry Kashitsyn + + Fixes branching + +2013-08-05 Dmitry Kashitsyn + + Fixes branching and block location + +2013-08-05 Roman Proskuryakov + + Moves writing operations for Image to class ImageWriter: writeWord, writeObject, void writeTo(const char* fileName) + +2013-08-04 Dmitry Kashitsyn + + Fixes direct block init + +2013-08-04 Roman Proskuryakov + + Fixes void Image::writeWord(std::ofstream& os, uint32_t word) + Adds void Image::writeObject(std::ofstream& os, TObject* object) + Adds Image::TImageRecordType Image::getObjectType(TObject* object) + +2013-08-04 Dmitry Kashitsyn + + Fixes crashes + +2013-08-04 Dmitry Kashitsyn + + Fix + +2013-08-04 Dmitry Kashitsyn + + Adds debug tools + +2013-08-04 Dmitry Kashitsyn + + Adds SmallInt check to @getObjectClass() + +2013-08-04 Dmitry Kashitsyn + + Adds recompilation and cache invalidation code + +2013-08-04 Roman Proskuryakov + + Adds Image::writeWord(uint32_t word) + +2013-08-04 Roman Proskuryakov + + Improves Image::readWord() + +2013-08-04 Dmitry Kashitsyn + + Adds receiver & receiverClass loading code + +2013-08-04 Dmitry Kashitsyn + + Adds more context fields init + +2013-08-04 Dmitry Kashitsyn + + Adds direct context initialization code + +2013-08-04 Dmitry Kashitsyn + + Fixes direct method call in createDirectBlocks() + +2013-08-04 Dmitry Kashitsyn + + Adds selector to the call stat output text + +2013-08-04 Dmitry Kashitsyn + + Refactors code to use callSiteIndex instead of callSiteOffset + +2013-08-04 Dmitry Kashitsyn + + Fix + +2013-08-04 Dmitry Kashitsyn + + Fixes fallback call arguments + +2013-08-03 Dmitry Kashitsyn + + Adds switch and phi code to patchCallSite() + +2013-08-03 Dmitry Kashitsyn + + Refactors call patching code + +2013-08-03 Dmitry Kashitsyn + + Adds direct method invocation codegen + +2013-08-02 Dmitry Kashitsyn + + Adds more code to the patch function + +2013-08-02 Dmitry Kashitsyn + + Adds more code to patchCallSite() + +2013-08-02 Dmitry Kashitsyn + + Cleans up indentation in llvm_types.ll + +2013-08-02 Dmitry Kashitsyn + + Adds patchCallSite() stub + +2013-08-01 Dmitry Kashitsyn + + Refactors stats, adds patchHotMethods() code + +2013-08-01 Dmitry Kashitsyn + + Adds patchHotMethods() stub + +2013-07-31 Dmitry Kashitsyn + + Adds site stats for class hits + +2013-07-31 Dmitry Kashitsyn + + Adds call site parameter to jit calls + +2013-07-31 Dmitry Kashitsyn + + temp + +2013-07-31 Dmitry Kashitsyn + + Refactors call site stats code + +2013-07-31 Dmitry Kashitsyn + + Adds method hit stats + +2013-07-31 Dmitry Kashitsyn + + Adds stubs for call site processing in a jit code + +2013-07-18 Dmitry Kashitsyn + + Adds sample thread messaging interface + +2013-07-18 Dmitry Kashitsyn + + Moves assignment to expression instead of statement + +2013-07-17 Dmitry Kashitsyn + + Allows variables in console + +2013-07-17 Dmitry Kashitsyn + + Adds Block>>whileTrue and whileFalse methods + +2013-07-16 Dmitry Kashitsyn + + Adds image builder's header stub + +2013-07-15 Dmitry Kashitsyn + + Fixes grammar + +2013-07-15 Dmitry Kashitsyn + + Fixes reduce/reduce conflict in grammar + +2013-07-15 Dmitry Kashitsyn + + Adds lexer and parser fixes + +2013-07-12 Dmitry Kashitsyn + + Adds more tokens and error recovery rules + +2013-07-12 Dmitry Kashitsyn + + Adds tokens and priority spec + +2013-07-12 Dmitry Kashitsyn + + Fixes grammar + +2013-07-11 Dmitry Kashitsyn + + Adds disassembler code, more grammar + +2013-07-11 Dmitry Kashitsyn + + Adds more grammar + +2013-07-11 Dmitry Kashitsyn + + Adds symbol entry for inline_object + +2013-07-11 Dmitry Kashitsyn + + Adds more grammar + +2013-07-11 Dmitry Kashitsyn + + Picks grammar file from commit b0512ae + +2013-07-11 Dmitry Kashitsyn + + Reverts back to the llvm gc + +2013-07-11 Dmitry Kashitsyn + + Fixes Scheduler>>run + +2013-07-10 Roman Proskuryakov + + Fixes Scheduler. Fixes List>>remove: + +2013-07-08 Dmitry Kashitsyn + + Fixes File>>fileIn and Scheduler debug code + +2013-07-06 Dmitry Kashitsyn + + adds test that segfaults vm + +2013-07-06 Dmitry Kashitsyn + + Fixes Scheduler>>runOnce + +2013-07-06 Dmitry Kashitsyn + + Adds Scheduler and Thread classes + +2013-07-04 Roman Proskuryakov + + Speeds up BakerMemoryManager::releaseExternalHeapPointer + +2013-07-03 Roman Proskuryakov + + Fixes the last merge + +2013-07-02 Dmitry Kashitsyn + + Reverts rootStack due to object_ptr::next looping + +2013-07-02 Dmitry Kashitsyn + + Refactors rootStack to std::list> and ptr fix + +2013-07-02 Dmitry Kashitsyn + + Adds volatile specifier to object_ptr::data + +2013-07-01 Dmitry Kashitsyn + + Fix + +2013-07-01 Dmitry Kashitsyn + + Fixes bug in new hptr<> + +2013-07-01 Dmitry Kashitsyn + + Adds experimental hptr<> implementation using stack objects + +2013-06-07 Roman Proskuryakov + + Adds ST bindins to get the mode of a file: f stat mode asString -> '-rw-r-----' + +2013-06-07 Roman Proskuryakov + + Adds primitive ioFileSetStatIntoArray to get file stat. Adds ST class FileStat + +2013-06-07 Roman Proskuryakov + + Fixes ST class File + +2013-06-05 Roman Proskuryakov + + Changes primitive fopen to open... Modifies ST class File + +2013-06-05 Roman Proskuryakov + + Adds primitives: fopen, fclose, fwrite, fread, fgetc, fputc, fseek + +2013-06-04 Roman Proskuryakov + + Simplifies the code of generational GC + +2013-05-30 Roman Proskuryakov + + Adds more docs + +2013-05-28 Roman Proskuryakov + + Adds info how to run Smalltalk right in LLVM + +2013-05-18 Roman Proskuryakov + + Fixes some memory leaks + +2013-05-18 Roman Proskuryakov + + Backed out changeset: fb3f87d03444 + +2013-05-07 Roman Proskuryakov + + Removes outdated doc + +2013-05-07 Roman Proskuryakov + + Adds more docs + +2013-05-01 Dmitry Kashitsyn + + fix + +2013-05-01 Dmitry Kashitsyn + + GGC fix + +2013-05-01 Dmitry Kashitsyn + + Adds missing inactive pointer setting + +2013-04-27 Dmitry Kashitsyn + + Adds more GGC code + +2013-04-27 Roman Proskuryakov + + Adds traces for TJITContext::popValue + +2013-04-27 Roman Proskuryakov + + Prettifies linkage of blocks in MethodCompiler::writeFunctionBody + +2013-04-27 Roman Proskuryakov + + Fixes EH in soft VM for TContext* and TBlockReturn + +2013-04-26 Roman Proskuryakov + + Renames unaryMessage to unaryBuiltIns, binaryMessage to binaryBuiltIns. + Removes unused special opcode 'breakpoint' + +2013-04-26 Roman Proskuryakov + + Modifies some primitives + +2013-04-26 Dmitry Kashitsyn + + Adds GGC lists research + +2013-04-24 Roman Proskuryakov + + Fixes blockReturn handling in the SoftVM. Adds docs for blockReturn. + +2013-04-23 Roman Proskuryakov + + Adds test for MethodCompiler::TJITContext::popValue + +2013-04-22 Roman Proskuryakov + + Removes SmalltalkVM::rootStack + +2013-04-22 Dmitry Kashitsyn + + Adds GGC benchmark + +2013-04-22 Dmitry Kashitsyn + + Fix + +2013-04-22 Dmitry Kashitsyn + + Changes default image file + +2013-04-22 Dmitry Kashitsyn + + Adds counters and statistics + +2013-04-22 Dmitry Kashitsyn + + Fix + +2013-04-22 Dmitry Kashitsyn + + Code cleanup & fixes + +2013-04-22 Dmitry Kashitsyn + + Fixes comments + +2013-04-22 Roman Proskuryakov + + Small changes + +2013-04-22 Dmitry Kashitsyn + + Adds generational GC code. Not tested yet + +2013-04-21 Dmitry Kashitsyn + + Adds image building rules + +2013-04-19 Roman Proskuryakov + + Adds docs for JIT compilation + +2013-04-19 Dmitry Kashitsyn + + Adds metaclass methods to the completion list + +2013-04-19 Roman Proskuryakov + + Changes the logic of codegeneration of primitives. Adds more comments. + +2013-04-19 Roman Proskuryakov + + Fixes the declaration of compileSmallIntPrimitive + +2013-04-19 Roman Proskuryakov + + Small fix + +2013-04-19 Roman Proskuryakov + + Moves some primitives from vm.cpp to primitives.cpp + +2013-04-19 Roman Proskuryakov + + Adds function callPrimitive + +2013-04-19 Roman Proskuryakov + + Cosmetic changes + +2013-04-18 Roman Proskuryakov + + Fixes dependency graph + +2013-04-19 Dmitry Kashitsyn + + Cleans up the code, stub for meta methods + +2013-04-18 Dmitry Kashitsyn + + Removes trace messages + +2013-04-18 Dmitry Kashitsyn + + Adds smalltalk completion engine for readline library + +2013-04-18 Dmitry Kashitsyn + + Adds trie container and completion backend db + +2013-04-18 Roman Proskuryakov + + Fix + +2013-04-18 Roman Proskuryakov + + Moves the branch of #doesNotUnderstand: to function + +2013-04-18 Roman Proskuryakov + + Moves declaration of exception API to .ll + +2013-04-18 Dmitry Kashitsyn + + Fixes readline + +2013-04-18 Roman Proskuryakov + + Moves declaration of runtime API to .ll + +2013-04-17 Roman Proskuryakov + + Adds how-to call extern member function + +2013-04-17 Roman Proskuryakov + + Backed out changeset 2e2a65a11314 + +2013-04-17 Dmitry Kashitsyn + + Adds readline support. Use 'exit' command to quit + +2013-04-17 Dmitry Kashitsyn + + Comments code + +2013-04-17 Roman Proskuryakov + + Removes dev stuff. Adds exit(1) to unexpected cases. + +2013-04-17 Roman Proskuryakov + + Small changes + +2013-04-16 Roman Proskuryakov + + Moves codegeneration of primitives of SmallInt to MethodCompiler::writeSmallIntPrimitive( ... ) + Renames primitiveSucceeded to primitiveSucceededBB, primitiveFailed to primitiveFailedBB + +2013-04-16 Roman Proskuryakov + + Renames instruction.* to TInstruction.* + +2013-04-16 Roman Proskuryakov + + Removes files with bug reports + +2013-04-16 Roman Proskuryakov + + Backed out changeset d36c6a11061b + +2013-04-16 Roman Proskuryakov + + Removes unnecessary TDeferredValue::isLazy() + +2013-04-16 Roman Proskuryakov + + Removes dev comments + +2013-04-16 Roman Proskuryakov + + Fixes TJITContext::popValue (phi) + +2013-04-07 Dmitry Kashitsyn + + Fix + +2013-04-07 Dmitry Kashitsyn + + Fixes popTop + +2013-04-07 Dmitry Kashitsyn + + Fixes dup + +2013-04-07 Dmitry Kashitsyn + + Fixes dup + +2013-04-07 Dmitry Kashitsyn + + Plays with lazy push + +2013-04-07 Roman Proskuryakov + + Small changes + +2013-04-07 Roman Proskuryakov + + Moves BrokenPointerPass to llstDebuggingPass.cpp + +2013-04-05 Roman Proskuryakov + + "Duplicate" must be fixed + +2013-04-05 Roman Proskuryakov + + Added tag Monkey patching for changeset 03c043a82c0b + +2013-04-05 Roman Proskuryakov + + Fixes PushTemporary in MarkArguments + +2013-04-05 Roman Proskuryakov + + Adds ST test for Push* and MarkArgumens codegeneration + +2013-04-04 Dmitry Kashitsyn + + temp + +2013-04-04 Roman Proskuryakov + + MarkArguments and Push* instructions lead to pointer invalidation + +2013-04-04 Roman Proskuryakov + + Adds pointer check for "self" in sendMessage args + +2013-04-03 Roman Proskuryakov + + Adds pass that checks whether the class of object points to null + +2013-04-02 Roman Proskuryakov + + Renames LLVMTestStatements to StatementsTest. Tests are not forced to run in LLVM + +2013-03-25 Roman Proskuryakov + + Fixes .gdbinit guide + +2013-03-25 Roman Proskuryakov + + Adds a script that builds the image + +2013-03-25 Roman Proskuryakov + + Renames binaryMessage enum + +2013-03-24 Roman Proskuryakov + + Adds TInstruction::toString() + +2013-03-21 Roman Proskuryakov + + Starts init process from soft VM + +2013-03-21 Roman Proskuryakov + + Fixes GC leak + +2013-03-20 Roman Proskuryakov + + Renames globals and base functions + +2013-03-18 Roman Proskuryakov + + Fixes GC leak in primitive::cloneByteObject + +2013-03-16 Roman Proskuryakov + + Adds checkRoot to primitive array:at:put + +2013-03-14 Dmitry Kashitsyn + + Fixes pointer loss in doesNotUnderstand part of sendMessage() + +2013-03-13 Roman Proskuryakov + + ST code results in a segmentation fault + +2013-03-13 Roman Proskuryakov + + Fixes primitive throwError + +2013-03-08 Roman Proskuryakov + + Adds more ST tests + +2013-03-08 Roman Proskuryakov + + Adds more ST tests + +2013-03-07 Roman Proskuryakov + + Starts initial process in LLVM + +2013-03-07 Dmitry Kashitsyn + + Enables llst optimization passes + +2013-03-07 Dmitry Kashitsyn + + Fixes leaking roots, cleans up the code + +2013-03-06 Roman Proskuryakov + + Fixes check of count of args and temps in blockInvoke + +2013-03-06 Roman Proskuryakov + + Removes intrinsic declaration from llvm_types.ll + +2013-03-05 Roman Proskuryakov + + Fixes context->previousContext in LLVM:executeProcess + +2013-03-05 Roman Proskuryakov + + Renames JITRuntime::ot to m_baseTypes + +2013-03-05 Roman Proskuryakov + + Fixes llvm_types.ll indentation + +2013-03-05 Roman Proskuryakov + + Fixes backtrace in method Process>>execute + +2013-03-05 Roman Proskuryakov + + Cleans up LLSTPass + +2013-03-04 Dmitry Kashitsyn + + Fixes blockBytePointer, disables llst opts + +2013-03-03 Roman Proskuryakov + + Adds more ST tests(compiler fails) + +2013-03-03 Roman Proskuryakov + + Adds ST tests + +2013-03-03 Roman Proskuryakov + + Changes EH due to C++ ABI for Itanium docs + +2013-03-02 Roman Proskuryakov + + LLVM: throws TContext*. Fixes JIT->sendMessage messageArguments. + +2013-02-28 Roman Proskuryakov + + Fixes primitive SmallIntDiv + +2013-02-28 Roman Proskuryakov + + Fixes IR generation + +2013-02-27 Roman Proskuryakov + + llstPass: removes unused GC roots + +2013-02-27 Dmitry Kashitsyn + + Fixes Link>>do:, sendMessage and block code optimization + +2013-02-27 Dmitry Kashitsyn + + Code cleanup + +2013-02-27 Roman Proskuryakov + + Small fixes in llstPass + +2013-02-27 Roman Proskuryakov + + Backed out changeset 9e4ba46605c2 + +2013-02-26 Dmitry Kashitsyn + + Adds insertion sort and list size + +2013-02-25 Roman Proskuryakov + + Enqueus createGCLoweringPass() + +2013-02-25 Dmitry Kashitsyn + + Adjusts heap grow criteria + +2013-02-25 Dmitry Kashitsyn + + Fixes growHeap() + +2013-02-25 Roman Proskuryakov + + Fixes indentation + +2013-02-25 Roman Proskuryakov + + Adds llst pass which removes unnecessary loads of GC protected pointers + +2013-02-24 Roman Proskuryakov + + Fixes 9af5a06a331c + +2013-02-24 Dmitry Kashitsyn + + Fixes args on 3.1 branch + +2013-02-24 Dmitry Kashitsyn + + Allows gc to grow heap + +2013-02-24 Dmitry Kashitsyn + + cleanup + +2013-02-24 Dmitry Kashitsyn + + Grow heap stub + +2013-02-23 Dmitry Kashitsyn + + temp + +2013-02-22 Dmitry Kashitsyn + + Fixes LLVM gc + +2013-02-22 Roman Proskuryakov + + Adds .gdbinit support to views + +2013-02-22 Dmitry Kashitsyn + + Removes unused variable + +2013-02-22 Dmitry Kashitsyn + + temp + +2013-02-22 Dmitry Kashitsyn + + Fixes assign instructions + +2013-02-22 Dmitry Kashitsyn + + Cleanup + +2013-02-21 Dmitry Kashitsyn + + Fixes holders + +2013-02-21 Dmitry Kashitsyn + + Removes %struct. prefix + +2013-02-21 Dmitry Kashitsyn + + Renames 'TObject::getField(int)' to 'getObjectField' + +2013-02-21 Dmitry Kashitsyn + + Fixes self holder + +2013-02-21 Dmitry Kashitsyn + + Adds cleanup code, traces + +2013-02-21 Dmitry Kashitsyn + + Removes incorrect protectPointer()-s + +2013-02-21 Dmitry Kashitsyn + + Refactors deferred operations to use getField() + +2013-02-20 Dmitry Kashitsyn + + Fix + +2013-02-20 Dmitry Kashitsyn + + Cleanup + +2013-02-20 Dmitry Kashitsyn + + Refactors preamble and object access (literals, class, etc) + +2013-02-20 Dmitry Kashitsyn + + Probably fixes popValue in the complex cases + +2013-02-20 Dmitry Kashitsyn + + Fixes self access + +2013-02-20 Dmitry Kashitsyn + + Fixes assign opcodes to use deferred values + +2013-02-20 Dmitry Kashitsyn + + Adds more deferred loads, makes code compile + +2013-02-20 Roman Proskuryakov + + Adds pretty prints for gdb + +2013-02-19 Dmitry Kashitsyn + + Adds more code for deferred value support + +2013-02-19 Roman Proskuryakov + + Fixes tclass view(instance size) + +2013-02-19 Roman Proskuryakov + + Adds llst-views.gdb (TSymbol, TMethod, TClass) + +2013-02-19 Roman Proskuryakov + + Small fixes for primitive::bulkReplace + +2013-02-19 Roman Proskuryakov + + Moves functions from llvm_types.ll to struct TBaseFunctions. Adds trailing spaces to MethodCompiler.cpp + +2013-02-19 Roman Proskuryakov + + Renames ot to m_baseTypes + +2013-02-19 Dmitry Kashitsyn + + temp + +2013-02-18 Roman Proskuryakov + + Adds trailing spaces. Removes magic numbers(sendBinary) + +2013-02-18 Dmitry Kashitsyn + + Adds deferred functional to value stack (stub) + +2013-02-18 Roman Proskuryakov + + Adds forgotten file(fixes 5e59eadd1414) + +2013-02-18 Roman Proskuryakov + + Moves enums from SmalltalkVM class to opcodes.h + +2013-02-18 Dmitry Kashitsyn + + gc root research + +2013-02-17 Roman Proskuryakov + + Fixes forming of blockFunctionName + +2013-02-16 Dmitry Kashitsyn + + Fixes GC interface + +2013-02-16 Dmitry Kashitsyn + + Fixes compile error + +2013-02-16 Dmitry Kashitsyn + + Removes traces, sets -O0 + +2013-02-16 Dmitry Kashitsyn + + Working 3.1 branch with some forward changes + +2013-02-10 Roman Proskuryakov + + Adds comments to throwError primitive + +2013-02-10 Roman Proskuryakov + + Fixes boundary checks in string|array At:Put: primitives + +2013-02-10 Roman Proskuryakov + + Adds SmallIntShift primitive + +2013-02-10 Roman Proskuryakov + + Adds throwError primitive. Fixes startNewProcess primitive. + +2013-02-10 Dmitry Kashitsyn + + Fixes allocateRoot() + +2013-02-09 Dmitry Kashitsyn + + Adds GC root stuff + +2013-02-08 Dmitry Kashitsyn + + Fixes caches + +2013-02-08 Dmitry Kashitsyn + + Adds runtime stats + +2013-02-08 Roman Proskuryakov + + Adds #doesNotUnderstand: handler + +2013-02-08 Roman Proskuryakov + + Adds sendToSuper special opcode + +2013-02-07 Roman Proskuryakov + + Fixes receiverClass in sendMessage + +2013-02-07 Roman Proskuryakov + + Fixes sendMessageArgs + +2013-02-06 Dmitry Kashitsyn + + Adds receiverClass parameter + +2013-02-06 Dmitry Kashitsyn + + Fixes cloneObject primitive + +2013-02-06 Roman Proskuryakov + + Adds isKindOf test + +2013-02-06 Roman Proskuryakov + + Adds ST test which localises Class>>asString problem + +2013-02-06 Roman Proskuryakov + + Adds more tests. Class asString fails. + +2013-02-06 Roman Proskuryakov + + Adds TODO for startNewProcess stub + +2013-02-06 Roman Proskuryakov + + Adds startNewProcess stub + +2013-02-05 Roman Proskuryakov + + Adds module pass manager + +2013-02-05 Dmitry Kashitsyn + + Enables optimizations + +2013-02-05 Dmitry Kashitsyn + + temp + +2013-02-05 Dmitry Kashitsyn + + Simplifies caches + +2013-02-05 Dmitry Kashitsyn + + Fixes cache + +2013-02-05 Dmitry Kashitsyn + + Adds function and block caches to runtime, comments out traces + +2013-02-05 Dmitry Kashitsyn + + Adds a few more tests + +2013-02-04 Dmitry Kashitsyn + + Fixes primitives, adds meta testing code + +2013-02-04 Dmitry Kashitsyn + + Fixes bulkReplace + +2013-02-04 Dmitry Kashitsyn + + Fixes bulkReplace primitive (function call still fails though) + +2013-02-04 Dmitry Kashitsyn + + Adds strcat test + +2013-02-04 Dmitry Kashitsyn + + Fix + +2013-02-04 Dmitry Kashitsyn + + Fixes popValue() and adds missing pop chains + +2013-02-04 Dmitry Kashitsyn + + Fixes at:[put:] vs jit.popValue + +2013-02-04 Dmitry Kashitsyn + + Fixes blockInvoke and value stack refactoring + +2013-02-03 Dmitry Kashitsyn + + Adds some FIXME notes + +2013-02-03 Dmitry Kashitsyn + + Fixes hasValue() + +2013-02-03 Dmitry Kashitsyn + + Fixes popValue + +2013-02-03 Dmitry Kashitsyn + + Reworks the value stack + +2013-02-02 Dmitry Kashitsyn + + temp + +2013-02-01 Dmitry Kashitsyn + + temp + +2013-02-01 Dmitry Kashitsyn + + Fixes block invocation (LOL). Note: testblockParam fails + +2013-01-31 Dmitry Kashitsyn + + Fixes test + +2013-01-31 Dmitry Kashitsyn + + Adds blockParam test + +2013-01-31 Roman Proskuryakov + + Fixes rethrow in landingpad BB + +2013-01-30 Roman Proskuryakov + + Adds ST closure test + +2013-01-30 Roman Proskuryakov + + Fixes allocate* primitives + +2013-01-30 Roman Proskuryakov + + Fixes smallint primitive + +2013-01-30 Dmitry Kashitsyn + + Fixes getClass primitive + +2013-01-30 Dmitry Kashitsyn + + Fixes scanners code + +2013-01-30 Dmitry Kashitsyn + + Fixes scanForBranches + +2013-01-30 Dmitry Kashitsyn + + Test code disassembly + +2013-01-29 Roman Proskuryakov + + Adds some ST tests. + +2013-01-27 Dmitry Kashitsyn + + Fixes testBlockReturn + +2013-01-26 Roman Proskuryakov + + Adds primitive getClass of SmallInt + +2013-01-26 Roman Proskuryakov + + Error in scanForBranches + +2013-01-26 Roman Proskuryakov + + Adds putChar primitive. Fixes indentation + +2013-01-27 Dmitry Kashitsyn + + Fixes array at:put: + +2013-01-26 Dmitry Kashitsyn + + Adds checking code to array at:[put:] + +2013-01-26 Dmitry Kashitsyn + + Fixes pushInstance + +2013-01-26 Dmitry Kashitsyn + + Fixes typos, adds comments + +2013-01-26 Dmitry Kashitsyn + + Sets -O0 in cmake lists + +2013-01-26 Roman Proskuryakov + + Fixes getSize primitive + +2013-01-26 Roman Proskuryakov + + Fixes primitive logic + +2013-01-26 humbug + + Fixes invoke and smallint primitives + +2013-01-26 Roman Proskuryakov + + Fixes stringAt:[Put:] primitive + +2013-01-25 Dmitry Kashitsyn + + Fixes pushInstance + +2013-01-25 Dmitry Kashitsyn + + Adds at: and at:put: primitives + +2013-01-25 Dmitry Kashitsyn + + Fixes block invoke + +2013-01-24 Roman Proskuryakov + + Fixes indentation + +2013-01-24 Roman Proskuryakov + + Fixes merge + +2013-01-25 Dmitry Kashitsyn + + Fixes blockInvoke + +2013-01-24 Dmitry Kashitsyn + + Optimizes self + +2013-01-24 Roman Proskuryakov + + Implements smallint primitives with llvm API + +2013-01-24 Dmitry Kashitsyn + + Fixes doPrimitive + +2013-01-24 Dmitry Kashitsyn + + Fixes doPrimitive + +2013-01-24 Roman Proskuryakov + + Fixes primitive functions' mapping + +2013-01-24 Dmitry Kashitsyn + + Comments out some traces + +2013-01-24 Dmitry Kashitsyn + + Fixes sendMessage + +2013-01-24 Dmitry Kashitsyn + + Fixes createArray + +2013-01-24 Dmitry Kashitsyn + + Fixes runtime init code + +2013-01-23 Roman Proskuryakov + + Fixes EE initialization + +2013-01-23 Roman Proskuryakov + + Fixes rethrow BB + +2013-01-23 Dmitry Kashitsyn + + Minor fixes + +2013-01-22 Dmitry Kashitsyn + + Fixes trailing spaces + +2013-01-22 Dmitry Kashitsyn + + Fixes indentation + +2013-01-22 Dmitry Kashitsyn + + Adds blockInvoke + +2013-01-21 Dmitry Kashitsyn + + Adds small int primitives + +2013-01-21 Dmitry Kashitsyn + + Adds bulkReplace primitive + +2013-01-21 Dmitry Kashitsyn + + Fixes getSlotSize() + +2013-01-21 Dmitry Kashitsyn + + Adds primitive code; removes trailing spaces + +2013-01-20 Dmitry Kashitsyn + + Minor fixes + +2013-01-20 Dmitry Kashitsyn + + Fixes blockReturn + +2013-01-20 Dmitry Kashitsyn + + Fixes branch instructions + +2013-01-20 Dmitry Kashitsyn + + Fixes branching + +2013-01-20 Dmitry Kashitsyn + + Fixes scanForBlockReturn + +2013-01-20 Roman Proskuryakov + + Fixes landingpad clause. Fixes CFG + +2013-01-20 Roman Proskuryakov + + Fixes CFG + +2013-01-20 Dmitry Kashitsyn + + Fixes logic errors + +2013-01-20 Dmitry Kashitsyn + + Fixes landing pad + +2013-01-20 Dmitry Kashitsyn + + Adds scanForBlockReturn, fixes logic. Not debugged yet + +2013-01-19 Dmitry Kashitsyn + + Refactors typeInfo acquiring code + +2013-01-17 Dmitry Kashitsyn + + Fixes assignInstance + +2013-01-17 Dmitry Kashitsyn + + Adds checkRoot() API interface; refactors TJITContext + +2013-01-17 Dmitry Kashitsyn + + Fixes sendMessage; some cleanup + +2013-01-17 Dmitry Kashitsyn + + Renames landing pad + +2013-01-17 Dmitry Kashitsyn + + Cleans up the code + +2013-01-17 Dmitry Kashitsyn + + Small fixes + +2013-01-16 Dmitry Kashitsyn + + Adds exception aware code to the sendMessage + +2013-01-16 Dmitry Kashitsyn + + Adds exception aware code to the sendBinary + +2013-01-16 Dmitry Kashitsyn + + Adds landing pad code + +2013-01-16 Dmitry Kashitsyn + + Fixes stupid code + +2013-01-16 Dmitry Kashitsyn + + Inlines smallInt literals directly as consts + +2013-01-16 Dmitry Kashitsyn + + Fixes naming + +2013-01-16 Dmitry Kashitsyn + + Adds some names + +2013-01-16 Roman Proskuryakov + + Adds writeLandingpadBB stub + +2013-01-16 Roman Proskuryakov + + Fixes ST loop test + +2013-01-15 Dmitry Kashitsyn + + temp + +2013-01-15 Dmitry Kashitsyn + + Fixes globals mapping + +2013-01-15 Dmitry Kashitsyn + + Fixes sendBinary + +2013-01-15 Dmitry Kashitsyn + + Adds block test + +2013-01-14 Roman Proskuryakov + + Adds JITRuntime::initializeRuntimeAPI() + +2013-01-14 Roman Proskuryakov + + Moves m_functionPassManager init to method + +2013-01-14 Roman Proskuryakov + + Small cleanup + +2013-01-14 Roman Proskuryakov + + Removes m_compiledFunctions + +2013-01-14 Dmitry Kashitsyn + + Fixes pushBlock + +2013-01-14 Dmitry Kashitsyn + + Adds blockReturn code + +2013-01-14 Dmitry Kashitsyn + + Interfaces createBlock() and emitBlockReturn() to the JIT + +2013-01-14 Dmitry Kashitsyn + + Adds emitBlockReturn() + +2013-01-14 Dmitry Kashitsyn + + Adds createBlock + +2013-01-14 Roman Proskuryakov + + Adds llvm stub: C++ exception handling + +2013-01-14 Dmitry Kashitsyn + + Adds function pass manager code; some more simple tests + +2013-01-13 Dmitry Kashitsyn + + Fixes runtime + +2013-01-13 Dmitry Kashitsyn + + Fixes function preamble + +2013-01-13 Dmitry Kashitsyn + + Adds testing code + +2013-01-13 Dmitry Kashitsyn + + Fixes pointers + +2013-01-13 Dmitry Kashitsyn + + Fixes runtime + +2013-01-13 Dmitry Kashitsyn + + Adds runtime test + +2013-01-12 Dmitry Kashitsyn + + Adds scanForBranches pass for blocks + +2013-01-12 Dmitry Kashitsyn + + Fixes scanForBranches + +2013-01-12 Dmitry Kashitsyn + + Fixes compiler. Now compiles valid module + +2013-01-12 Dmitry Kashitsyn + + Fixes branching + +2013-01-12 Dmitry Kashitsyn + + Fixes compiler types + +2013-01-12 Dmitry Kashitsyn + + Fixes message arguments and function prototypes + +2013-01-12 Dmitry Kashitsyn + + Fixes compiler + +2013-01-12 Dmitry Kashitsyn + + Fixes compiler. Adds test method LLVMTest>>test1. See init.txt + +2013-01-11 Dmitry Kashitsyn + + Fixes compiler + +2013-01-11 Dmitry Kashitsyn + + Adds more twines + +2013-01-11 Dmitry Kashitsyn + + Fixes naming and args array manipulation + +2013-01-11 Dmitry Kashitsyn + + Fixes sendUnary, sendMessage and other stuff. Now compiles + +2013-01-11 Roman Proskuryakov + + Monkey patching: block preamble + +2013-01-11 Dmitry Kashitsyn + + Fixes block creation code + +2013-01-11 Dmitry Kashitsyn + + Adds more compiler refactoring + +2013-01-10 Dmitry Kashitsyn + + Fixes markArguments + +2013-01-10 Dmitry Kashitsyn + + Refactors runtime API methods + +2013-01-10 Dmitry Kashitsyn + + Refactors doSpecial + +2013-01-10 Dmitry Kashitsyn + + Refactors names + +2013-01-10 Dmitry Kashitsyn + + Moves IRBuilder<> to TJITContext + +2013-01-10 Dmitry Kashitsyn + + Moves TInstruction to TJITContext + +2013-01-10 Dmitry Kashitsyn + + Refactors MethodCompiler + +2013-01-10 Roman Proskuryakov + + Fixes preamble + +2013-01-10 Roman Proskuryakov + + Fixes branchIf* + +2013-01-10 Roman Proskuryakov + + Prettifies globals + +2013-01-09 Dmitry Kashitsyn + + Cleanup + +2013-01-09 Dmitry Kashitsyn + + Fixes pushConstant + +2013-01-09 Dmitry Kashitsyn + + Fix + +2013-01-09 Dmitry Kashitsyn + + Fixes conditional branches + +2013-01-09 Dmitry Kashitsyn + + Cleans up the code + +2013-01-09 Dmitry Kashitsyn + + Adds sendMessage bindings to bytecode compiler + +2013-01-09 Dmitry Kashitsyn + + Adds more sendMessage code + +2013-01-09 Dmitry Kashitsyn + + Adds sendMessage stubs + +2013-01-09 Dmitry Kashitsyn + + Code cleanup + +2013-01-09 Roman Proskuryakov + + Fixes writePreamble + +2013-01-09 Roman Proskuryakov + + Removes build.sh + +2013-01-09 Dmitry Kashitsyn + + Small fixes in the image sources + +2013-01-08 Dmitry Kashitsyn + + Reverts image source + +2013-01-08 Dmitry Kashitsyn + + Cleans up the code + +2013-01-08 Roman Proskuryakov + + Updates sendUnary opcode + +2013-01-08 Roman Proskuryakov + + Fixes typo + +2013-01-08 Roman Proskuryakov + + Fixes cmake script + +2013-01-08 Roman Proskuryakov + + Adds error reporting + +2013-01-08 Roman Proskuryakov + + Moves TGlobals structure to llvm_types.ll + +2013-01-07 Dmitry Kashitsyn + + Adds global objects mapping to the JIT module + +2013-01-07 Dmitry Kashitsyn + + humbug -> llvm + +2013-01-07 Roman Proskuryakov + + Adds llvm stub: globals + +2013-01-07 Dmitry Kashitsyn + + Fixes JITRuntime initialization + +2013-01-07 Dmitry Kashitsyn + + Adds wrapper type stubs + +2013-01-07 Dmitry Kashitsyn + + Adds wrappers for newObject functions + +2013-01-07 Dmitry Kashitsyn + + Fixes cmake script. Now compiles correctly + +2013-01-07 Roman Proskuryakov + + Adds module verifier. Small fixes + +2013-01-07 Roman Proskuryakov + + Moves test_llvm_types.cpp to llvm_stub + +2013-01-07 Roman Proskuryakov + + Adds missing Interpreter.h + +2013-01-07 Dmitry Kashitsyn + + Adds JIT init code and simple test + +2013-01-07 Dmitry Kashitsyn + + Adds sendUnary stub + +2013-01-07 Dmitry Kashitsyn + + Adds conditional branching code + +2013-01-07 Dmitry Kashitsyn + + Adds branching code for MethodCompiler, dumb build script + +2013-01-06 Roman Proskuryakov + + Adds llvm stub: changing function on the fly + +2013-01-06 Dmitry Kashitsyn + + Adds some thoughts on branching + +2013-01-06 Dmitry Kashitsyn + + Updates imageSource.st + +2013-01-05 Dmitry Kashitsyn + + Code refactoring and cleanup + +2013-01-05 Dmitry Kashitsyn + + Adds LLVM bindings to cmake script (not working yet) + +2013-01-05 Dmitry Kashitsyn + + Minor fixes + +2013-01-04 Roman Proskuryakov + + Adds IR getField functions + +2013-01-04 Roman Proskuryakov + + Fixes Context.arguments GEP. Fixes selfReturn + +2013-01-05 Dmitry Kashitsyn + + Small typo fixes + +2013-01-04 Roman Proskuryakov + + Small fixes + +2013-01-04 Roman Proskuryakov + + Adds IR getIntegerValue() function + +2013-01-04 Roman Proskuryakov + + Fixes sendBinary stub + +2013-01-04 Dmitry Kashitsyn + + Adds sendBinary instruction stub + +2013-01-04 Dmitry Kashitsyn + + Fix + +2013-01-04 Dmitry Kashitsyn + + Fixes assign instructions + +2013-01-04 Dmitry Kashitsyn + + Adds markArguments instruction + +2013-01-04 Dmitry Kashitsyn + + Adds more instructions + +2013-01-03 Dmitry Kashitsyn + + Refactors MethodCompiler, adds comments + +2013-01-03 Dmitry Kashitsyn + + Refactors compiler + +2013-01-03 Roman Proskuryakov + + Adds more stub for method compiler + +2013-01-03 Dmitry Kashitsyn + + Adds stub for the method compiler + +2013-01-03 Dmitry Kashitsyn + + Adds jit.h + +2013-01-02 Dmitry Kashitsyn + + Adds LLVM Memory Manager + +2013-01-01 Roman Proskuryakov + + Adds comments to llvm types + +2013-01-01 Roman Proskuryakov + + Adds llvm types + +2012-12-31 Dmitry Kashitsyn + + Cleans up code + +2012-12-30 Dmitry Kashitsyn + + Refactors Collection>>sort + +2012-12-29 Dmitry Kashitsyn + + Fixes Collection>>sort + +2012-12-29 Dmitry Kashitsyn + + Fixes Collection>>sort + +2012-12-28 Dmitry Kashitsyn + + Fixes hptr<> + +2012-12-28 Dmitry Kashitsyn + + Refactors hptr<> + +2012-12-28 Dmitry Kashitsyn + + Refactors VM code (minor fixes) + +2012-12-28 Dmitry Kashitsyn + + Cleans up the code + +2012-12-28 Dmitry Kashitsyn + + Added tag v 0.1 for changeset 0c8089e4a8ed + +2012-12-23 Roman Proskuryakov + + Refactors onCollectionOccured as Observer pattern. Cleanups code + +[v_0.1] +2012-12-28 Dmitry Kashitsyn + + Style fixes + +2012-12-28 Dmitry Kashitsyn + + Adds licensing information + +2012-12-28 Dmitry Kashitsyn + + Cleans up the code + +2012-12-28 Roman Proskuryakov + + Removes unnecessary stuff, changes the declaration of execute() method. + +2012-12-28 Roman Proskuryakov + + Small cosmetic fixes + +2012-12-28 Roman Proskuryakov + + Removes test from main + +2012-12-28 Dmitry Kashitsyn + + Fixes the primitive code + +2012-12-27 Roman Proskuryakov + + Cleans up the code + +2012-12-28 Dmitry Kashitsyn + + Adds imageBuilder from lst5 and updates testImage + +2012-12-27 Dmitry Kashitsyn + + Adds some benchmarks, cleans up the code + +2012-12-26 Roman Proskuryakov + + ST -> IR code stub + +2012-12-26 Dmitry Kashitsyn + + Adds Collection>>sort: and sort benchmark + +2012-12-26 Dmitry Kashitsyn + + Adds timer routines + +2012-12-26 Dmitry Kashitsyn + + Cleans up code, adds more stats + +2012-12-26 Dmitry Kashitsyn + + Fixes bulkReplace; minor changes in the test image + +2012-12-24 Roman Proskuryakov + + Modifies LoopTest. Adds new info about Array>>allMethods failure + +2012-12-24 Roman Proskuryakov + + Adds ST PrimitiveTest + +2012-12-23 Roman Proskuryakov + + Adds ST ContextTest + +2012-12-23 Roman Proskuryakov + + Backout 0e3c1e476091 + +2012-12-23 Roman Proskuryakov + + Small fixes + +2012-12-23 Roman Proskuryakov + + Removes process rootStack due to hptr. + +2012-12-22 Roman Proskuryakov + + Changes format of method #error:. + +2012-12-23 Dmitry Kashitsyn + + Temp + +2012-12-22 Roman Proskuryakov + + Adds some ST tests + +2012-12-22 Dmitry Kashitsyn + + Removes unneeded hptrs + +2012-12-22 Dmitry Kashitsyn + + Fixes invalid stack issue in sendMessage vs GC + +2012-12-21 Dmitry Kashitsyn + + Adds more info in #badIndex + +2012-12-21 Dmitry Kashitsyn + + Adds tail call optimization in the sendMessage + +2012-12-20 Dmitry Kashitsyn + + Minor fixes + +2012-12-19 Dmitry Kashitsyn + + Fixes doSendMessage() so it correctly handles the #doesNotUnderstand: case + +2012-12-19 Dmitry Kashitsyn + + Fixes blockInvoke + +2012-12-19 Dmitry Kashitsyn + + Small fixes + +2012-12-19 Roman Proskuryakov + + Fixes segfault + +2012-12-19 Dmitry Kashitsyn + + Refactors GC code + +2012-12-19 Dmitry Kashitsyn + + Cleans up the code + +2012-12-19 Dmitry Kashitsyn + + Fixes GC + +2012-12-19 Dmitry Kashitsyn + + Small fixes for VM vs Process + +2012-12-19 Dmitry Kashitsyn + + Fixes test + +2012-12-18 Dmitry Kashitsyn + + Refactors moveObject + +2012-12-18 Dmitry Kashitsyn + + temp + +2012-12-18 Dmitry Kashitsyn + + Adds new moveObject stub + +2012-12-16 Dmitry Kashitsyn + + Addss some tests + +2012-12-16 Roman Proskuryakov + + Adds test of GC fail + +2012-12-14 Dmitry Kashitsyn + + Fixes imageSource + +2012-12-14 Roman Proskuryakov + + Fixes string test + +2012-12-14 Dmitry Kashitsyn + + Small fixes in VM + +2012-12-14 Roman Proskuryakov + + Adds Array test stub. Fixes context args + +2012-12-14 Roman Proskuryakov + + Cosmetic fixes + +2012-12-14 Dmitry Kashitsyn + + Adds small fix to bulkReplace + +2012-12-14 Dmitry Kashitsyn + + Adds newObject() specializations; small fixes + +2012-12-13 Dmitry Kashitsyn + + Fixes method cache, adds VM statistics + +2012-12-13 Dmitry Kashitsyn + + Fixes bulkReplace && TInteger + +2012-12-13 Dmitry Kashitsyn + + Fixes typos + +2012-12-12 Dmitry Kashitsyn + + Adds comment to the hptr<> + +2012-12-12 Dmitry Kashitsyn + + Adds classdoc comments in types.h + +2012-12-12 Roman Proskuryakov + + Fixes push/pop process + +2012-12-12 Roman Proskuryakov + + Fixes string concat + +2012-12-12 Roman Proskuryakov + + Adds comments + +2012-12-12 Roman Proskuryakov + + Fixes error primitive crash + +2012-12-12 Roman Proskuryakov + + Fixes tests typo + +2012-12-12 Roman Proskuryakov + + Fixes process stack. Now exits normally. + +2012-12-11 Dmitry Kashitsyn + + Fixes loopup error message, comments out GC traces + +2012-12-11 Roman Proskuryakov + + Small image fixes: Test classes, runAll. + +2012-12-11 Dmitry Kashitsyn + + Fixes GC (at last) + +2012-12-11 Dmitry Kashitsyn + + Adds trace messages to GC + +2012-12-11 Dmitry Kashitsyn + + Fixes bulkReplace + +2012-12-11 Dmitry Kashitsyn + + Adds error reporting; code cleanup + +2012-12-11 Dmitry Kashitsyn + + Adds missing *failed = true + +2012-12-11 Dmitry Kashitsyn + + Fixes call to newBinaryObject() + +2012-12-11 Dmitry Kashitsyn + + Minor fixes + +2012-12-11 Dmitry Kashitsyn + + Fixes process + +2012-12-11 Dmitry Kashitsyn + + Fixes crash + +2012-12-10 Dmitry Kashitsyn + + Fixes backTrace + +2012-12-10 Dmitry Kashitsyn + + Cosmetic fixes + +2012-12-10 Dmitry Kashitsyn + + Fix + +2012-12-10 Dmitry Kashitsyn + + Fixes at:put: and bulkReplace: + +2012-12-10 Dmitry Kashitsyn + + Fixes static heap initialization + +2012-12-10 Dmitry Kashitsyn + + Fix + +2012-12-10 Dmitry Kashitsyn + + Fixes static roots + +2012-12-10 Roman Proskuryakov + + Adds ST tests: SmallInt, Compare, Branch, Loop, String, Method lookup. 4171 objects + +2012-12-09 Roman Proskuryakov + + Adds failPrimitive stub. Primitive fails on opcode error(19) + +2012-12-09 Roman Proskuryakov + + Adds image source. Removes gui init from main. The image contains 3891 objects + +2012-12-09 Dmitry Kashitsyn + + Parses argv[1] as image filename + +2012-12-09 Dmitry Kashitsyn + + Adds GC info messages + +2012-12-09 Dmitry Kashitsyn + + Fixes hptr<> + +2012-12-09 Dmitry Kashitsyn + + Fixes GC + +2012-12-08 Dmitry Kashitsyn + + Fixes pointer safety + +2012-12-08 Dmitry Kashitsyn + + Fixes new(Ord|B)inaryObject + +2012-12-07 Dmitry Kashitsyn + + Removes redundant hptr<> + +2012-12-07 Dmitry Kashitsyn + + Removes unused variables + +2012-12-07 Dmitry Kashitsyn + + Fixes sendToSuper + +2012-12-07 Dmitry Kashitsyn + + Refactors rootStack to be part of TVMExecutionContext + +2012-12-07 Dmitry Kashitsyn + + Cleans up and comments the code + +2012-12-07 Dmitry Kashitsyn + + Adds isInStaticHeap() body + +2012-12-07 Dmitry Kashitsyn + + Fixes newPointer() + +2012-12-07 Dmitry Kashitsyn + + Fixes hptr registration + +2012-12-07 Dmitry Kashitsyn + + Fixes hptr<> constructor + +2012-12-07 Dmitry Kashitsyn + + Fixes hptr<> + +2012-12-07 Dmitry Kashitsyn + + Adds bulkReplace logic + +2012-12-07 Dmitry Kashitsyn + + Code cleanup + +2012-12-07 Dmitry Kashitsyn + + Fixes crash + +2012-12-07 Dmitry Kashitsyn + + Adds primitive numbers to code comments + +2012-12-07 Dmitry Kashitsyn + + Fixes runtime bugs + +2012-12-06 Roman Proskuryakov + + Fixes bulkReplace logic. + +2012-12-05 Roman Proskuryakov + + Inserts bulkReplace into doPrimitive + +2012-12-05 Dmitry Kashitsyn + + Adds more memory management code + +2012-12-05 Dmitry Kashitsyn + + Refactors VM code by applying hptr<> to critical pointers + +2012-12-05 Dmitry Kashitsyn + + Adds some more thoughts on hptr<> + +2012-12-05 Roman Proskuryakov + + Bulk replace todos + +2012-12-05 Roman Proskuryakov + + BulkReplace fix + +2012-12-05 Dmitry Kashitsyn + + Fixes TArray + +2012-12-05 Roman Proskuryakov + + Adds bulkReplace stub + +2012-12-04 Dmitry Kashitsyn + + Fixes hptr<>::operator[] + +2012-12-04 Dmitry Kashitsyn + + Fix + +2012-12-04 Dmitry Kashitsyn + + Adds some research on hptr<> + +2012-12-04 Dmitry Kashitsyn + + Adds extrenal pointers support code + +2012-12-04 Dmitry Kashitsyn + + Adds newObject() + +2012-12-04 Roman Proskuryakov + + Implements sendBinary. Adds default primitive stub + +2012-12-04 Dmitry Kashitsyn + + Temp + +2012-12-03 Roman Proskuryakov + + Refactors code. Fixes blockReturn + +2012-12-03 Dmitry Kashitsyn + + Adds GC status flags + +2012-12-03 Dmitry Kashitsyn + + Fixes backtrace + +2012-12-03 Dmitry Kashitsyn + + Refactors sendUnary to a function + +2012-12-03 Dmitry Kashitsyn + + Adds TVMExecutionContext and refactors execution routines + +2012-12-03 Roman Proskuryakov + + GC fails. FIXME + +2012-12-03 Dmitry Kashitsyn + + Adds backtrace printing method + +2012-12-02 Dmitry Kashitsyn + + Fixes block invoke (reverts previousContext) + +2012-12-02 Dmitry Kashitsyn + + Fixes merge + +2012-12-02 Dmitry Kashitsyn + + Fix + +2012-12-02 Dmitry Kashitsyn + + Fixes block invokation, adds stub for in:at:put: + +2012-12-02 Roman Proskuryakov + + Fixes stackReturn and selfReturn. Other little fixes + +2012-12-02 Dmitry Kashitsyn + + Adds Number>>to:do: disasm + +2012-12-02 Dmitry Kashitsyn + + More disasm comments + +2012-12-02 Dmitry Kashitsyn + + More comments + +2012-12-02 Dmitry Kashitsyn + + More comments + +2012-12-02 Dmitry Kashitsyn + + Adds init sequence disassembly + +2012-12-01 Dmitry Kashitsyn + + Fix + +2012-12-01 Dmitry Kashitsyn + + Fixes block invoke + +2012-12-01 Dmitry Kashitsyn + + Adds error reporting in sendMessage + +2012-12-01 Dmitry Kashitsyn + + Fixes block invocation flow + +2012-12-01 Dmitry Kashitsyn + + Refactors doExecutePrimitive + +2012-12-01 Dmitry Kashitsyn + + Fixes runtime + +2012-12-01 Dmitry Kashitsyn + + Refactors pushBlock. Adds comments, throws stupid code away + +2012-12-01 Dmitry Kashitsyn + + Renames context to currentContext in execute + +2012-12-01 Dmitry Kashitsyn + + Fix + +2012-12-01 Dmitry Kashitsyn + + Adds pushBlock opcode + +2012-12-01 Roman Proskuryakov + + doPrimitive opcode fix. Adds comments + +2012-11-30 Roman Proskuryakov + + Fix + +2012-12-01 Dmitry Kashitsyn + + Adds error reporting + +2012-11-30 Dmitry Kashitsyn + + Fixes sendMessage + +2012-11-30 Dmitry Kashitsyn + + Fixes readObject() ints + +2012-11-30 Dmitry Kashitsyn + + Fix + +2012-11-30 Dmitry Kashitsyn + + Fixes sendMessage + +2012-11-30 Dmitry Kashitsyn + + Runtime fixes + +2012-11-30 Dmitry Kashitsyn + + Fixes object size vs slot size issue + +2012-11-30 Roman Proskuryakov + + FIXME + +2012-11-30 Roman Proskuryakov + + Adds comments + +2012-11-30 Roman Proskuryakov + + Adds sendMessage opcode stub + +2012-11-30 Roman Proskuryakov + + Replaces a lot of magic numbers to enum constants + +2012-11-29 Roman Proskuryakov + + Small fixes + +2012-11-29 Dmitry Kashitsyn + + Refactors object instantination code + +2012-11-29 Dmitry Kashitsyn + + Fixes runtime + +2012-11-29 Dmitry Kashitsyn + + Small fixes + +2012-11-29 Dmitry Kashitsyn + + Fixes memory GC vs VM issues + +2012-11-29 Dmitry Kashitsyn + + Adds logo + +2012-11-29 Dmitry Kashitsyn + + Finor mixes + +2012-11-29 Dmitry Kashitsyn + + More refactoring + +2012-11-29 Dmitry Kashitsyn + + Refactoring and a lot of code style fixes + +2012-11-29 Roman Proskuryakov + + Fix + +2012-11-29 Roman Proskuryakov + + Removes goto + +2012-11-29 Roman Proskuryakov + + Adds BlockReturn opcode + +2012-11-29 Roman Proskuryakov + + Renames variables. Adds comments + +2012-11-29 Dmitry Kashitsyn + + Adds some baker init code + +2012-11-28 Roman Proskuryakov + + Fix + +2012-11-28 Roman Proskuryakov + + Adds sendBinary stub. Adds fixme's + +2012-11-28 Dmitry Kashitsyn + + Fixes linking issues + +2012-11-28 Dmitry Kashitsyn + + Minor fixes + +2012-11-28 Roman Proskuryakov + + Adds ByteArray alloc stub + +2012-11-28 Dmitry Kashitsyn + + Adds heap initialization code + +2012-11-28 Roman Proskuryakov + + Fix. Adds ByteObject clone stub. + +2012-11-28 Roman Proskuryakov + + Fix + +2012-11-28 Dmitry Kashitsyn + + Fixes minor issues. Almost ready for execution\! + +2012-11-28 Dmitry Kashitsyn + + More mm refactoring + +2012-11-28 Dmitry Kashitsyn + + Refactors memory interface and class struct + +2012-11-28 Dmitry Kashitsyn + + Forgets about .kdev4 files + +2012-11-28 Dmitry Kashitsyn + + Fixes typo + +2012-11-28 Dmitry Kashitsyn + + Fixes typos + +2012-11-27 Dmitry Kashitsyn + + Adds more notes to Baker desc + +2012-11-27 Dmitry Kashitsyn + + Adds advanced Baker description + +2012-11-27 Dmitry Kashitsyn + + Adds Baker doc + +2012-11-27 Roman Proskuryakov + + Fix + +2012-11-27 Roman Proskuryakov + + Replaces failPrimitive patterns. + +2012-11-27 Roman Proskuryakov + + Fix. Adds failPrimitive. + +2012-11-27 Roman Proskuryakov + + Adds String:at, String:at:put + +2012-11-27 Roman Proskuryakov + + Fix + +2012-11-27 Roman Proskuryakov + + Adds Array:at + +2012-11-27 Roman Proskuryakov + + Fix + +2012-11-27 Dmitry Kashitsyn + + Fixes minor issues in Baker MM + +2012-11-27 Dmitry Kashitsyn + + Fixes sendUnary + +2012-11-26 Dmitry Kashitsyn + + Backs out ptr<> template stuff + +2012-11-26 Dmitry Kashitsyn + + Adds some more template magic + +2012-11-26 Dmitry Kashitsyn + + Adds template typedefs + +2012-11-26 Dmitry Kashitsyn + + Adds ptr<> template + +2012-11-26 Roman Proskuryakov + + Adds #Array:at:put stub + +2012-11-26 Roman Proskuryakov + + Adds sendUnary opcode + +2012-11-25 Roman Proskuryakov + + Moves SmallInt opcodes into function doSmallInt(...) + +2012-11-25 Roman Proskuryakov + + + opcode bit shift + +2012-11-25 Dmitry Kashitsyn + + Fixes some warnings + +2012-11-25 Dmitry Kashitsyn + + Adds collectGarbage() method. Baker GC is almost done + +2012-11-25 Dmitry Kashitsyn + + Fixes vptr doc + +2012-11-25 Dmitry Kashitsyn + + Adds vptr<> spec to the docs + +2012-11-25 Dmitry Kashitsyn + + Adds Baker garbage collection code (moveObject part) + +2012-11-25 Dmitry Kashitsyn + + Baker MM stub + +2012-11-25 Roman Proskuryakov + + A little fix + +2012-11-25 Roman Proskuryakov + + Adds some primitive opcodes. Fixes some unsinged+signed comparisons' warnings. + +2012-11-24 Roman Proskuryakov + + Fix. Now links. + +2012-11-24 Roman Proskuryakov + + Moves templated method template T* SmalltalkVM::newObject(...) to .h + +2012-11-24 Dmitry Kashitsyn + + Adds startup code stubs + +2012-11-24 Dmitry Kashitsyn + + Adds draft memory interface + +2012-11-24 Dmitry Kashitsyn + + Fix + +2012-11-24 Dmitry Kashitsyn + + More fixes in primitive code + +2012-11-24 Dmitry Kashitsyn + + Fixes primitives code + +2012-11-24 Dmitry Kashitsyn + + Refactors doSpecial handler + +2012-11-24 Dmitry Kashitsyn + + Refactored doSpecial to a separate function + +2012-11-24 Dmitry Kashitsyn + + Removes unnececary trace messages + +2012-11-24 Dmitry Kashitsyn + + Small type fixes; Adds more classdoc + +2012-11-24 Roman Proskuryakov + + + opcodes: + 1) specials + 2) a little bit of primitives + +2012-11-24 Roman Proskuryakov + + Fixes the merge. Now it works. + +2012-11-23 Roman Proskuryakov + + + hgignore + +2012-11-24 Dmitry Kashitsyn + + Removes unnececary type casts + +2012-11-24 Dmitry Kashitsyn + + Refactors TArray as a template class + +2012-11-23 Dmitry Kashitsyn + + Fixes a lot of bugs. Image seems to be working and corrent now + +2012-11-23 Dmitry Kashitsyn + + Some more fixes and testing code + +2012-11-23 Dmitry Kashitsyn + + Fixes readObject() + +2012-11-23 Dmitry Kashitsyn + + Fixes image loading code, adds some debug logs + +2012-11-22 Dmitry Kashitsyn + + Fixes a lot of errors. Now compiles + +2012-11-22 Roman Proskuryakov + + + opcode templates + +2012-11-21 Dmitry Kashitsyn + + Fixes + +2012-11-21 Dmitry Kashitsyn + + Fixes cmake and some of the compilation erors + +2012-11-21 Dmitry Kashitsyn + + Fixes pointer vs reference issue + +2012-11-21 Dmitry Kashitsyn + + Small code refactoring and fixes + +2012-11-21 Roman Proskuryakov + + fix typo + +2012-11-21 Dmitry Kashitsyn + + Adds Image::closeImageFile() + +2012-11-21 Dmitry Kashitsyn + + Adds image loading code + +2012-11-21 Dmitry Kashitsyn + + Adds initial image loading code + +2012-11-21 Dmitry Kashitsyn + + Adds smalltalk syntax highlighting scheme + +2012-11-21 Dmitry Kashitsyn + + Adds draft prototype of exception handling mechanism + +2012-11-20 Dmitry Kashitsyn + + Adds Image source + +2012-11-20 Dmitry Kashitsyn + + Refactors objects logic, adds more VM and Image methods + +2012-11-20 Dmitry Kashitsyn + + Minor changes + +2012-11-19 Dmitry Kashitsyn + + Adds lookupMethodInCache + +2012-11-19 Dmitry Kashitsyn + + Adds more VM logic + +2012-11-19 Dmitry Kashitsyn + + Adds more VM logic + +2012-11-18 Dmitry Kashitsyn + + Adds VM methods (execute) + +2012-11-18 Dmitry Kashitsyn + + Adds lookupMethod stub + +2012-11-18 Dmitry Kashitsyn + + Adds more types; initial VM code + +2012-11-18 Dmitry Kashitsyn + + Initial commit. Adds basic types + From 15111671a3e06e91c7225e2c4817ecf9cd56a601 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Tue, 24 Dec 2013 01:11:06 +0400 Subject: [PATCH 24/44] Makes Image::loadImage() cross-platform It worked fine for GNU/Linux, FreeBSD, but the is no mmap in MS \|/iNdOwS. The function is rewritten with std::ifstream. Issue: #46 --- include/memory.h | 13 ++----- src/Image.cpp | 99 +++++++++++------------------------------------- src/main.cpp | 2 +- 3 files changed, 26 insertions(+), 88 deletions(-) diff --git a/include/memory.h b/include/memory.h index 1550b6a..1999bee 100644 --- a/include/memory.h +++ b/include/memory.h @@ -372,12 +372,8 @@ extern "C" { extern LLVMMemoryManager::TStackEntry* llvm_gc_root_chain; } class Image { private: - int m_imageFileFD; - std::size_t m_imageFileSize; - - void* m_imageMap; // pointer to the map base - uint8_t* m_imagePointer; // sliding pointer std::vector m_indirects; + std::ifstream m_inputStream; enum TImageRecordType { invalidObject = 0, @@ -392,17 +388,14 @@ class Image TObject* readObject(); template ResultType* readObject() { return static_cast(readObject()); } - bool openImageFile(const char* fileName); - void closeImageFile(); IMemoryManager* m_memoryManager; public: Image(IMemoryManager* manager) - : m_imageFileFD(-1), m_imageFileSize(0), - m_imagePointer(0), m_memoryManager(manager) + : m_memoryManager(manager) { } - bool loadImage(const char* fileName); + bool loadImage(const std::string& fileName); void storeImage(const char* fileName); template TObject* getGlobal(const N* name) const; diff --git a/src/Image.cpp b/src/Image.cpp index 71fe3ff..91dac6f 100644 --- a/src/Image.cpp +++ b/src/Image.cpp @@ -35,12 +35,7 @@ #include #include -#include -#include -#include -#include -#include -#include +#include //TODO endianness #include #include @@ -48,6 +43,8 @@ #include #include #include +#include +#include // Placeholder for root objects TGlobals globals; @@ -62,71 +59,15 @@ TObject* Image::getGlobal(const N* name) const { template TObject* Image::getGlobal(const char* key) const; template TObject* Image::getGlobal(const TSymbol* key) const; -bool Image::openImageFile(const char* fileName) -{ - // Opening file for reading - m_imageFileFD = open(fileName, O_RDONLY); - if (m_imageFileFD < 0) - { - std::fprintf(stderr, "Failed to open file %s : %s\n", fileName, std::strerror(errno)); - return false; - } - - // Reading file size in bytes - struct stat st; - if (fstat(m_imageFileFD, &st) < 0) { - close(m_imageFileFD); - m_imageFileFD = -1; - std::fprintf(stderr, "Failed to get file size : %s\n", std::strerror(errno)); - return false; - } - m_imageFileSize = st.st_size; - - // Mapping the image file to the memory - m_imageMap = mmap( - 0, // let the kernel provide the address - m_imageFileSize, // map the entire image file - PROT_READ, // read only access - MAP_PRIVATE, // private mapping only for us - m_imageFileFD, // map this file - 0); // from the very beginning (zero offset) - - if (!m_imageMap) { - std::fprintf(stderr, "Failed to mmap image file: %s\n", std::strerror(errno)); - - // Something goes wrong - close(m_imageFileFD); - m_imageFileFD = -1; - return false; - } - - // Initializing pointers - m_imagePointer = static_cast(m_imageMap); - return true; -} - -void Image::closeImageFile() -{ - munmap(m_imageMap, m_imageFileSize); - close(m_imageFileFD); - - m_imagePointer = 0; - m_imageMap = 0; - m_imageFileSize = 0; -} - uint32_t Image::readWord() { - if (m_imagePointer == (static_cast(m_imageMap) + m_imageFileSize) ) - return 0; // Unexpected EOF TODO break - uint32_t value = 0; uint8_t byte = 0; // Very stupid yet simple multibyte encoding // value = FF + FF ... + x where x < FF do { - byte = *m_imagePointer++; + byte = m_inputStream.get(); value += byte; } while ( byte == 0xFF ); return value; @@ -139,7 +80,7 @@ TObject* Image::readObject() TImageRecordType type = static_cast(readWord()); switch (type) { case invalidObject: - std::fprintf(stderr, "Invalid object at offset %d\n", m_imagePointer - static_cast(m_imageMap)); + std::cerr << "Invalid object at offset " << m_inputStream.tellg() << std::endl; std::exit(1); break; @@ -161,10 +102,9 @@ TObject* Image::readObject() } case inlineInteger: { - //uint32_t value = * reinterpret_cast(m_imagePointer); - uint32_t value = m_imagePointer[0] | (m_imagePointer[1] << 8) | - (m_imagePointer[2] << 16) | (m_imagePointer[3] << 24); - m_imagePointer += sizeof(uint32_t); + //uint32_t value; m_inputStream >> value; + uint32_t value = m_inputStream.get() | (m_inputStream.get() << 8) | + (m_inputStream.get() << 16) | (m_inputStream.get() << 24); TInteger newObject = newInteger(value); // FIXME endianness return reinterpret_cast(newObject); } @@ -206,18 +146,25 @@ TObject* Image::readObject() } } -bool Image::loadImage(const char* fileName) +bool Image::loadImage(const std::string& fileName) { - if ( !openImageFile(fileName) ) { - std::fprintf(stderr, "could not open image file %s\n", fileName); - return false; + m_inputStream.exceptions( std::ifstream::eofbit | std::ifstream::badbit ); + m_inputStream.open(fileName.c_str(), std::ifstream::binary); + + if ( !m_inputStream.is_open() ) { + throw std::runtime_error("Could not open image file " + fileName); } - // TODO Check whether heap is already initialized + //Get the size of the file + m_inputStream.seekg(0, std::ifstream::end); + std::ifstream::pos_type fileSize = m_inputStream.tellg(); + + //Reset the position to the beginning of the file + m_inputStream.seekg(0); + // TODO Check whether heap is already initialized // Multiplier of 1.5 of imageFileSize should be a good estimation for static heap size - if ( !m_memoryManager->initializeStaticHeap(m_imageFileSize + m_imageFileSize / 2) ) { - closeImageFile(); + if ( !m_memoryManager->initializeStaticHeap(fileSize * 1.5) ) { return false; } @@ -244,8 +191,6 @@ bool Image::loadImage(const char* fileName) std::fprintf(stdout, "Image read complete. Loaded %d objects\n", m_indirects.size()); m_indirects.clear(); - closeImageFile(); - return true; } diff --git a/src/main.cpp b/src/main.cpp index 53138d6..5c7d763 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -68,7 +68,7 @@ int main(int argc, char **argv) { memoryManager->initializeHeap(llstArgs.heapSize, llstArgs.maxHeapSize); std::auto_ptr smalltalkImage(new Image(memoryManager.get())); - smalltalkImage->loadImage(llstArgs.imagePath.c_str()); + smalltalkImage->loadImage(llstArgs.imagePath); { Image::ImageWriter writer; From 90da297cbcfd6b0328e2c6df49e9d173c02d82c8 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Wed, 25 Dec 2013 02:54:36 +0400 Subject: [PATCH 25/44] Makes the code compile with MinGW Issue: #46 --- src/Image.cpp | 2 +- src/primitives.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Image.cpp b/src/Image.cpp index 91dac6f..46757bb 100644 --- a/src/Image.cpp +++ b/src/Image.cpp @@ -35,7 +35,7 @@ #include #include -#include //TODO endianness +//#include //TODO endianness #include #include diff --git a/src/primitives.cpp b/src/primitives.cpp index 7ecc503..0ea00f8 100644 --- a/src/primitives.cpp +++ b/src/primitives.cpp @@ -265,7 +265,7 @@ TObject* callIOPrimitive(uint8_t opcode, TObjectArray& args, bool& primitiveFail //The easiest way is to build it with std::string std::string filename(reinterpret_cast(name->getBytes()), name->getSize()); - int32_t fileID = open(filename.c_str(), mode, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP ); + int32_t fileID = open(filename.c_str(), mode, S_IRUSR | S_IWUSR ); if (fileID < 0) { primitiveFailed = true; } else { From 4552ea7bec85d5e3423197cace6dde9c2c772940 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Tue, 31 Dec 2013 20:40:42 +0400 Subject: [PATCH 26/44] Adds a dumb version of CompletionEngine without libreadline Issue: #52 --- src/CompletionEngine.cpp | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/CompletionEngine.cpp b/src/CompletionEngine.cpp index f42d87c..a418fa7 100644 --- a/src/CompletionEngine.cpp +++ b/src/CompletionEngine.cpp @@ -33,13 +33,16 @@ */ #include -#include -#include #include #include std::auto_ptr CompletionEngine::s_instance(new CompletionEngine); +#if defined(USE_READLINE) + +#include +#include + static char* smalltalk_generator(const char* text, int state) { CompletionEngine* completionEngine = CompletionEngine::Instance(); @@ -122,3 +125,25 @@ bool CompletionEngine::readline(const std::string& prompt, std::string& result) void CompletionEngine::addHistory(const std::string& line) { add_history( line.c_str() ); } + +#else // USE_READLINE -- undefined + +#include +#include + +// Here we providing stub implementation that just provides +// an interface for readling a string from input without any +// advanced features such as completion or history + +static void initializeReadline() { } +void CompletionEngine::initialize(TDictionary*) { + initializeReadline(); // to suppress warnings '-Wunused-function' +} +bool CompletionEngine::readline(const std::string& prompt, std::string& result) { + std::cout << prompt << std::flush; + return std::getline(std::cin, result); +} + +void CompletionEngine::addHistory(const std::string&) { } + +#endif From ea51d7b16bb65d301d18cdfd6195c75e9a51814d Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Tue, 31 Dec 2013 20:41:23 +0400 Subject: [PATCH 27/44] Adds handling of READLINE option in cmake Now usage of readline library may be controlled by passing a -DREADLINE=(ON|OFF) parameter to cmake. If parameter is passed library usage depends on value. If parameter is omitted it defaults to ON. Issue: #52 --- CMakeLists.txt | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ceea8a0..67cf776 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,24 @@ if (LLVM) add_definitions(-DLLVM) endif() +if (DEFINED READLINE) + set(USE_READLINE ${READLINE}) +else() + # Readline is a very common library and is supported on + # a wide variaty of platforms except redmond, so we're + # defaulting variable to true. + set(USE_READLINE "TRUE") +endif() + +if (USE_READLINE) + message(STATUS "Using readline library") + set_source_files_properties(src/CompletionEngine.cpp PROPERTIES COMPILE_DEFINITIONS USE_READLINE) + set (READLINE_LIB "readline") +else() + message(STATUS "Readline library is disabled") + set (READLINE_LIB "") +endif() + set (CMAKE_CXX_FLAGS "${LLVM_CXX_FLAGS} -Wall -fexceptions -frtti -Wno-cast-qual") set (CMAKE_CXX_FLAGS_DEBUG "-g -ggdb -O0") set (CMAKE_CXX_FLAGS_RELEASE "-O3") @@ -62,7 +80,7 @@ if (LLVM) endif() add_executable(llst ${CPP_FILES}) -target_link_libraries(llst ${LLVM_LIBS} readline ${LLVM_LD_FLAGS}) +target_link_libraries(llst ${LLVM_LIBS} ${READLINE_LIB} ${LLVM_LD_FLAGS}) if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) # this is a 64-bit OS From b0fe1fa555a6f4de214540f1015e257c719c21d3 Mon Sep 17 00:00:00 2001 From: Dmitry Kashitsyn Date: Wed, 8 Jan 2014 14:57:33 +0700 Subject: [PATCH 28/44] Adds include guard to completion engine header --- include/CompletionEngine.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/CompletionEngine.h b/include/CompletionEngine.h index 6e647f2..e396070 100644 --- a/include/CompletionEngine.h +++ b/include/CompletionEngine.h @@ -32,6 +32,9 @@ * along with LLST. If not, see . */ +#if !defined(LLST_COMPLETION_ENGINE_H) +#define LLST_COMPLETION_ENGINE_H + #include #include @@ -69,3 +72,5 @@ class CompletionEngine { bool readline(const std::string& prompt, std::string& result); void addHistory(const std::string& line); }; + +#endif From c57cfbf57e988691bf773d00edb65dc7c3538b89 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Sat, 22 Mar 2014 00:58:29 +0400 Subject: [PATCH 29/44] Fixes -Wall -Wextra warnings Issue: #50 --- include/jit.h | 2 +- include/memory.h | 14 +++++++------- src/CompletionEngine.cpp | 2 +- src/MethodCompiler.cpp | 4 ++-- src/NonCollectMemoryManager.cpp | 2 +- src/vm.cpp | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/jit.h b/include/jit.h index 315cacf..dfc4546 100644 --- a/include/jit.h +++ b/include/jit.h @@ -306,7 +306,7 @@ class MethodCompiler { void doPushTemporary(TJITContext& jit); void doPushLiteral(TJITContext& jit); void doPushConstant(TJITContext& jit); - void doPushBlock(uint32_t currentOffset, TJITContext& jit); + void doPushBlock(TJITContext& jit); void doAssignTemporary(TJITContext& jit); void doAssignInstance(TJITContext& jit); void doMarkArguments(TJITContext& jit); diff --git a/include/memory.h b/include/memory.h index 1999bee..b705eed 100644 --- a/include/memory.h +++ b/include/memory.h @@ -331,13 +331,13 @@ class NonCollectMemoryManager : public IMemoryManager virtual bool isInStaticHeap(void* location); virtual void collectGarbage() {} - virtual void addStaticRoot(TObject** pointer) {} - virtual void removeStaticRoot(TObject** pointer) {} - virtual void registerExternalPointer(TObject** pointer) {} - virtual void releaseExternalPointer(TObject** pointer) {} - virtual void registerExternalHeapPointer(object_ptr& pointer) {} - virtual void releaseExternalHeapPointer(object_ptr& pointer) {} - virtual bool checkRoot(TObject* value, TObject** objectSlot) { return false; } + virtual void addStaticRoot(TObject** /*pointer*/) {} + virtual void removeStaticRoot(TObject** /*pointer*/) {} + virtual void registerExternalPointer(TObject** /*pointer*/) {} + virtual void releaseExternalPointer(TObject** /*pointer*/) {} + virtual void registerExternalHeapPointer(object_ptr& /*pointer*/) {} + virtual void releaseExternalHeapPointer(object_ptr& /*pointer*/) {} + virtual bool checkRoot(TObject* /*value*/, TObject** /*objectSlot*/) { return false; } virtual uint32_t allocsBeyondCollection() { return 0; } virtual TMemoryManagerInfo getStat() { return TMemoryManagerInfo(); } }; diff --git a/src/CompletionEngine.cpp b/src/CompletionEngine.cpp index 1142156..18060fe 100644 --- a/src/CompletionEngine.cpp +++ b/src/CompletionEngine.cpp @@ -58,7 +58,7 @@ static char* smalltalk_generator(const char* text, int state) { return 0; } -static char** smalltalk_completion(const char* text, int start, int end) { +static char** smalltalk_completion(const char* text, int /*start*/, int /*end*/) { return rl_completion_matches(text, smalltalk_generator); } diff --git a/src/MethodCompiler.cpp b/src/MethodCompiler.cpp index e7e8838..7c381af 100644 --- a/src/MethodCompiler.cpp +++ b/src/MethodCompiler.cpp @@ -617,7 +617,7 @@ void MethodCompiler::writeFunctionBody(TJITContext& jit, uint32_t byteCount /*= case opcode::pushLiteral: doPushLiteral(jit); break; case opcode::pushConstant: doPushConstant(jit); break; - case opcode::pushBlock: doPushBlock(currentOffset, jit); break; + case opcode::pushBlock: doPushBlock(jit); break; case opcode::assignTemporary: doAssignTemporary(jit); break; case opcode::assignInstance: doAssignInstance(jit); break; @@ -737,7 +737,7 @@ void MethodCompiler::doPushConstant(TJITContext& jit) jit.pushValue(constantValue); } -void MethodCompiler::doPushBlock(uint32_t currentOffset, TJITContext& jit) +void MethodCompiler::doPushBlock(TJITContext& jit) { TByteObject& byteCodes = * jit.method->byteCodes; uint16_t newBytePointer = byteCodes[jit.bytePointer] | (byteCodes[jit.bytePointer+1] << 8); diff --git a/src/NonCollectMemoryManager.cpp b/src/NonCollectMemoryManager.cpp index c64c16c..7070079 100644 --- a/src/NonCollectMemoryManager.cpp +++ b/src/NonCollectMemoryManager.cpp @@ -71,7 +71,7 @@ bool NonCollectMemoryManager::initializeStaticHeap(size_t staticHeapSize) return true; } -bool NonCollectMemoryManager::initializeHeap(size_t heapSize, size_t maxSize) +bool NonCollectMemoryManager::initializeHeap(size_t heapSize, size_t /*maxSize*/) { heapSize = correctPadding(heapSize); uint8_t* heap = static_cast( std::malloc(heapSize) ); diff --git a/src/vm.cpp b/src/vm.cpp index 6ab7866..cfde89f 100644 --- a/src/vm.cpp +++ b/src/vm.cpp @@ -117,14 +117,14 @@ template<> hptr SmalltalkVM::newObject(std::size_t d return hptr(instance, m_memoryManager, registerPointer); } -template<> hptr SmalltalkVM::newObject(std::size_t dataSize, bool registerPointer) +template<> hptr SmalltalkVM::newObject(std::size_t /*dataSize*/, bool registerPointer) { TClass* klass = globals.contextClass; TContext* instance = static_cast( newOrdinaryObject(klass, sizeof(TContext)) ); return hptr(instance, m_memoryManager, registerPointer); } -template<> hptr SmalltalkVM::newObject(std::size_t dataSize, bool registerPointer) +template<> hptr SmalltalkVM::newObject(std::size_t /*dataSize*/, bool registerPointer) { TClass* klass = globals.blockClass; TBlock* instance = static_cast( newOrdinaryObject(klass, sizeof(TBlock)) ); From fa58c3f559fcab7a8ac153d80f3ff0c7703bf6f9 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Wed, 26 Feb 2014 17:00:39 +0400 Subject: [PATCH 30/44] Adds CLI arg `-v, --version` Issue: #50 --- include/args.h | 4 +++- src/args.cpp | 18 +++++++++++++++++- src/main.cpp | 5 +++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/include/args.h b/include/args.h index 1f8b0f0..d288057 100644 --- a/include/args.h +++ b/include/args.h @@ -44,12 +44,14 @@ struct args std::size_t maxHeapSize; std::string imagePath; int showHelp; + int showVersion; args() : - heapSize(0), maxHeapSize(0), showHelp(false) + heapSize(0), maxHeapSize(0), showHelp(false), showVersion(false) { } void parse(int argc, char **argv); static std::string getHelp(); + static std::string getVersion(); }; #endif diff --git a/src/args.cpp b/src/args.cpp index 0e1b15c..28607c3 100644 --- a/src/args.cpp +++ b/src/args.cpp @@ -42,6 +42,7 @@ void args::parse(int argc, char **argv) { enum { help = 'S', + version = 'V', image = 'i', heap_max = 'H', heap = 'h', @@ -57,10 +58,11 @@ void args::parse(int argc, char **argv) {"heap", required_argument, 0, heap}, {"image", required_argument, 0, image}, {"help", no_argument, 0, help}, + {"version", no_argument, 0, version}, {0, 0, 0, 0} }; - const char* short_options = "h:H:i:"; + const char* short_options = "Vh:H:i:"; int option_index = -1; while(true) @@ -94,6 +96,9 @@ void args::parse(int argc, char **argv) case help: { showHelp = true; } break; + case version: { + showVersion = true; + } break; } if (c == getopt_end) { //We are out of options. Now we have to take the last argument as the imagePath @@ -112,5 +117,16 @@ std::string args::getHelp() " -h, --heap Starting of the heap in bytes\n" " -H, --heap_max Maximum allowed heap size\n" " -i, --image Path to image\n" + " -V, --version Display the version number and copyrights of the invoked LLST\n" " --help Display this information and quit"; } + +std::string args::getVersion() +{ + return + "llst 0.2.1\n" + "Copyright (C) 2012-2014 by Dmitry Kashitsyn \n" + "Copyright (C) 2012-2014 by Roman Proskuryakov \n" + "This is free software; see the source for copying conditions. There is NO\n" + "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; +} diff --git a/src/main.cpp b/src/main.cpp index 7fb5271..90d66fe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -60,6 +60,11 @@ int main(int argc, char **argv) { return EXIT_SUCCESS; } + if (llstArgs.showVersion) { + std::cout << args::getVersion() << std::endl; + return EXIT_SUCCESS; + } + #if defined(LLVM) std::auto_ptr memoryManager(new LLVMMemoryManager()); #else From 4d36743ebd6cd6799a9d0df570eb2bdffc45411f Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Mon, 12 May 2014 21:57:43 +0400 Subject: [PATCH 31/44] Adds target `make uninstall` Issue: #50 --- CMakeLists.txt | 4 ++++ cmake/uninstall.cmake.in | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 cmake/uninstall.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index cfa42ea..d68293c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,3 +133,7 @@ set (CPACK_DEBIAN_PACKAGE_MAINTAINER "Team ") set (CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libreadline6-dev") include(CPack) + +# uninstall target +configure_file( "${CMAKE_SOURCE_DIR}/cmake/uninstall.cmake.in" uninstall.cmake @ONLY) +add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P uninstall.cmake) diff --git a/cmake/uninstall.cmake.in b/cmake/uninstall.cmake.in new file mode 100644 index 0000000..2037e36 --- /dev/null +++ b/cmake/uninstall.cmake.in @@ -0,0 +1,21 @@ +if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") +endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + +file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) +string(REGEX REPLACE "\n" ";" files "${files}") +foreach(file ${files}) + message(STATUS "Uninstalling $ENV{DESTDIR}${file}") + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + exec_program( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + endif(NOT "${rm_retval}" STREQUAL 0) + else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") +endforeach(file) From 9e7f4947eb69df41649ac68155858315a061fc6b Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Mon, 12 May 2014 21:58:49 +0400 Subject: [PATCH 32/44] Moves common vars into cmake/variables.cmake Issue: #50 --- CMakeLists.txt | 19 ++++++++----------- cmake/variables.cmake | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 cmake/variables.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index d68293c..54c8bf5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ 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") + project(llst-project) if (LLVM) @@ -44,9 +47,8 @@ else() set (READLINE_LIB "") endif() -set (CMAKE_CXX_FLAGS "${LLVM_CXX_FLAGS} -Wall -fexceptions -frtti -Wno-pedantic -Wno-cast-qual") -set (CMAKE_CXX_FLAGS_DEBUG "-g -ggdb -O0") -set (CMAKE_CXX_FLAGS_RELEASE "-O3") +set (CMAKE_CXX_FLAGS "${LLVM_CXX_FLAGS} ${CMAKE_CXX_FLAGS}") +set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LLVM_LD_FLAGS}") add_subdirectory(src) add_subdirectory(include) @@ -80,13 +82,8 @@ if (LLVM) endif() add_executable(llst ${CPP_FILES}) -target_link_libraries(llst ${LLVM_LIBS} ${READLINE_LIB} ${LLVM_LD_FLAGS}) - -if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) - # this is a 64-bit OS - add_definitions(-m32 -L/usr/lib32) - set(CMAKE_EXE_LINKER_FLAGS "-m32 -L/usr/lib32") -endif() +target_link_libraries(llst ${LLVM_LIBS} ${READLINE_LIB} pthread ${CMAKE_DL_LIBS}) +add_dependencies(llst image) set (IMAGE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/image) add_custom_command( @@ -124,7 +121,7 @@ set (CPACK_PACKAGE_VERSION_MINOR "2") set (CPACK_PACKAGE_VERSION_PATCH "1") set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set (CPACK_SOURCE_GENERATOR "TGZ") -set (CPACK_SOURCE_IGNORE_FILES "build/;\\\\.kdev.*;\\\\.git.*;\\\\.hgignore;.*\\\\.image") +set (CPACK_SOURCE_IGNORE_FILES "build/" "\\\\.kdev.*" "\\\\.git.*" "\\\\.hgignore" ".*\\\\.image") set (CPACK_STRIP_FILES "llst") diff --git a/cmake/variables.cmake b/cmake/variables.cmake new file mode 100644 index 0000000..e12831c --- /dev/null +++ b/cmake/variables.cmake @@ -0,0 +1,24 @@ + +# C compiler. +set (CMAKE_C_FLAGS_INIT "-Wall -Wextra") +set (CMAKE_C_FLAGS_DEBUG_INIT "-ggdb3 -O0") +set (CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os") +set (CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG") +set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g") + +# C++ compiler. +set (CMAKE_CXX_FLAGS_INIT "-Wall -Wextra -fexceptions -frtti") +set (CMAKE_CXX_FLAGS_DEBUG_INIT "-ggdb3 -O0") +set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os") +set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG") +set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g") + +# Flags used by the linker. +set (CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "-s") + +if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) + # This is a 64-bit OS + # LLST supports only 32-bit code + set (CMAKE_C_FLAGS_INIT "-m32 ${CMAKE_C_FLAGS_INIT}") + set (CMAKE_CXX_FLAGS_INIT "-m32 ${CMAKE_CXX_FLAGS_INIT}") +endif() From 0f5fd64f0f680f95d8aa92710aeceed5e390904b Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Mon, 12 May 2014 21:48:58 +0400 Subject: [PATCH 33/44] Adds cmake module to find libreadline and libtinfo Issue: #50 --- CMakeLists.txt | 33 +++++++++++++++++++-------------- cmake/FindREADLINE.cmake | 17 +++++++++++++++++ cmake/FindTINFO.cmake | 13 +++++++++++++ 3 files changed, 49 insertions(+), 14 deletions(-) create mode 100644 cmake/FindREADLINE.cmake create mode 100644 cmake/FindTINFO.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 54c8bf5..4d26b29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,11 @@ set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") project(llst-project) +find_package(READLINE) +find_package(TINFO) + +option(USE_READLINE "Should we use the GNU readline and history libraries?" ON) + if (LLVM) if(LLVM_VERSION) set (CONFIG_COMMAND "llvm-config-${LLVM_VERSION}") @@ -29,22 +34,22 @@ if (LLVM) add_definitions(-DLLVM) endif() -if (DEFINED READLINE) - set(USE_READLINE ${READLINE}) -else() - # Readline is a very common library and is supported on - # a wide variaty of platforms except redmond, so we're - # defaulting variable to true. - set(USE_READLINE "TRUE") -endif() - if (USE_READLINE) - message(STATUS "Using readline library") - set_source_files_properties(src/CompletionEngine.cpp PROPERTIES COMPILE_DEFINITIONS USE_READLINE) - set (READLINE_LIB "readline") + if (READLINE_FOUND AND TINFO_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}) + 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() + endif() else() message(STATUS "Readline library is disabled") - set (READLINE_LIB "") + unset(READLINE_LIBS_TO_LINK) endif() set (CMAKE_CXX_FLAGS "${LLVM_CXX_FLAGS} ${CMAKE_CXX_FLAGS}") @@ -82,7 +87,7 @@ if (LLVM) endif() add_executable(llst ${CPP_FILES}) -target_link_libraries(llst ${LLVM_LIBS} ${READLINE_LIB} pthread ${CMAKE_DL_LIBS}) +target_link_libraries(llst ${LLVM_LIBS} ${READLINE_LIBS_TO_LINK} pthread ${CMAKE_DL_LIBS}) add_dependencies(llst image) set (IMAGE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/image) diff --git a/cmake/FindREADLINE.cmake b/cmake/FindREADLINE.cmake new file mode 100644 index 0000000..16c3380 --- /dev/null +++ b/cmake/FindREADLINE.cmake @@ -0,0 +1,17 @@ + +# Find libreadline (terminal input library) +# Export variables: +# READLINE_FOUND +# READLINE_INCLUDE_DIRS +# READLINE_LIBRARIES + +find_path(READLINE_INCLUDE_DIRS + NAMES readline/readline.h +) + +find_library(READLINE_LIBRARIES + NAMES readline +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(readline DEFAULT_MSG READLINE_LIBRARIES READLINE_INCLUDE_DIRS ) diff --git a/cmake/FindTINFO.cmake b/cmake/FindTINFO.cmake new file mode 100644 index 0000000..8459ec8 --- /dev/null +++ b/cmake/FindTINFO.cmake @@ -0,0 +1,13 @@ + +# Find libtinfo (developer's library for the low-level terminfo library) +# Export variables: +# TINFO_FOUND +# TINFO_INCLUDE_DIRS +# TINFO_LIBRARIES + +find_library(TINFO_LIBRARIES + NAMES tinfo +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS( tinfo DEFAULT_MSG TINFO_LIBRARIES ) From 9f4b0cba84466df098bed78241b78308ab7a8b76 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Mon, 12 May 2014 21:50:44 +0400 Subject: [PATCH 34/44] Adds cmake module to find LLVM Issue: #50 --- CMakeLists.txt | 45 +++++++++++-------------- cmake/FindLLVM.cmake | 80 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 25 deletions(-) create mode 100644 cmake/FindLLVM.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d26b29..c8e1959 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,31 +7,29 @@ project(llst-project) find_package(READLINE) find_package(TINFO) +find_package(LLVM 3.1 EXACT) option(USE_READLINE "Should we use the GNU readline and history libraries?" ON) +option(USE_LLVM "Should we use LLVM to build JIT?" OFF) -if (LLVM) - if(LLVM_VERSION) - set (CONFIG_COMMAND "llvm-config-${LLVM_VERSION}") - else() - set (CONFIG_COMMAND "llvm-config") - endif() - - # TODO Check that llvm-config is found and working - - execute_process(COMMAND ${CONFIG_COMMAND} --cxxflags - OUTPUT_STRIP_TRAILING_WHITESPACE - OUTPUT_VARIABLE LLVM_CXX_FLAGS) - - execute_process(COMMAND ${CONFIG_COMMAND} --ldflags - OUTPUT_STRIP_TRAILING_WHITESPACE - OUTPUT_VARIABLE LLVM_LD_FLAGS) +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}") - execute_process(COMMAND ${CONFIG_COMMAND} --libs all - OUTPUT_STRIP_TRAILING_WHITESPACE - OUTPUT_VARIABLE LLVM_LIBS) + # LLVM generates loads of warnings... + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-cast-qual -Wno-unused-parameter") - add_definitions(-DLLVM) + set (LLVM_LIBS_TO_LINK ${LLVM_LIBS}) + add_definitions(-DLLVM) + else() + message(FATAL_ERROR "\nInstall llvm-3.1-dev:i386 and try again.") + endif() +else() + message(STATUS "LLVM is disabled") + unset(LLVM_LIBS_TO_LINK) endif() if (USE_READLINE) @@ -52,9 +50,6 @@ else() unset(READLINE_LIBS_TO_LINK) endif() -set (CMAKE_CXX_FLAGS "${LLVM_CXX_FLAGS} ${CMAKE_CXX_FLAGS}") -set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LLVM_LD_FLAGS}") - add_subdirectory(src) add_subdirectory(include) include_directories(include) @@ -75,7 +70,7 @@ set(CPP_FILES src/vm.cpp ) -if (LLVM) +if (USE_LLVM) # LLVM specific sources list(APPEND CPP_FILES src/LLVMMemoryManager.cpp @@ -87,7 +82,7 @@ if (LLVM) endif() add_executable(llst ${CPP_FILES}) -target_link_libraries(llst ${LLVM_LIBS} ${READLINE_LIBS_TO_LINK} pthread ${CMAKE_DL_LIBS}) +target_link_libraries(llst ${LLVM_LIBS_TO_LINK} ${READLINE_LIBS_TO_LINK} pthread ${CMAKE_DL_LIBS}) add_dependencies(llst image) set (IMAGE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/image) diff --git a/cmake/FindLLVM.cmake b/cmake/FindLLVM.cmake new file mode 100644 index 0000000..d2a58cd --- /dev/null +++ b/cmake/FindLLVM.cmake @@ -0,0 +1,80 @@ + +# Find LLVM (a collection of libraries and tools that make it easy to build compilers, +# optimizers, Just-In-Time code generators, and many other compiler-related programs) +# Export variables: +# LLVM_FOUND +# LLVM_CONFIG_EXE +# LLVM_CXX_FLAGS +# LLVM_C_FLAGS +# LLVM_LD_FLAGS +# LLVM_INSTALL_PREFIX +# LLVM_VERSION +# LLVM_LIBS +# LLVM_INCLUDE_DIR + +include(CheckIncludeFileCXX) +include(CheckCXXSourceCompiles) +include(CMakePushCheckState) +include(FindPackageHandleStandardArgs) + +macro(get_llvm_config_var args out_var) + execute_process( + COMMAND ${LLVM_CONFIG_EXE} ${args} + OUTPUT_VARIABLE ${out_var} + RESULT_VARIABLE exit_code + ERROR_VARIABLE std_err_output + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if (exit_code) + message(SEND_ERROR "Executing '${LLVM_CONFIG_EXE} ${args}' exited with '${exit_code}'") + message(FATAL_ERROR "Error message: ${std_err_output}") + endif() +endmacro() + +macro(check_llvm_header header out_var) + cmake_push_check_state() + set(CMAKE_REQUIRED_FLAGS "${LLVM_CXX_FLAGS}") + CHECK_INCLUDE_FILE_CXX("${header}" ${out_var}) + cmake_pop_check_state() +endmacro() + +macro(check_llvm_source_compiles code out_var) + cmake_push_check_state() + set(CMAKE_REQUIRED_FLAGS "${LLVM_CXX_FLAGS} ${LLVM_LD_FLAGS}") + set(CMAKE_REQUIRED_LIBRARIES ${LLVM_LIBS} dl pthread) + CHECK_CXX_SOURCE_COMPILES("${code}" ${out_var}) + cmake_pop_check_state() +endmacro() + +set(LLVM_CONFIG_NAMES "llvm-config-${LLVM_FIND_VERSION}" llvm-config) +foreach(version ${LLVM_ADDITIONAL_VERSIONS} 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5) + list(APPEND LLVM_CONFIG_NAMES "llvm-config-${version}") +endforeach() + +find_program(LLVM_CONFIG_EXE NAMES ${LLVM_CONFIG_NAMES} DOC "Full path to llvm-config") +unset(LLVM_CONFIG_NAMES) + +if (LLVM_CONFIG_EXE) + get_llvm_config_var(--cxxflags LLVM_CXX_FLAGS) + get_llvm_config_var(--cflags LLVM_C_FLAGS) + get_llvm_config_var(--ldflags LLVM_LD_FLAGS) + get_llvm_config_var(--prefix LLVM_INSTALL_PREFIX) + get_llvm_config_var(--version LLVM_VERSION) + get_llvm_config_var(--libs LLVM_LIBS) + get_llvm_config_var(--includedir LLVM_INCLUDE_DIR) + + # Header 'Pass.h' locates in 'include/llvm/' directory since 1.9 till 3.4 release + check_llvm_header("llvm/Pass.h" LLVM_PASS_H) + check_llvm_source_compiles("#include \n int main(){ return 0; }" LLVM_PASSES_LINKED) + + if (NOT LLVM_PASS_H OR NOT LLVM_PASSES_LINKED) + message(STATUS "See ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for details") + endif() +endif() + +FIND_PACKAGE_HANDLE_STANDARD_ARGS( LLVM + REQUIRED_VARS LLVM_CONFIG_EXE LLVM_PASS_H LLVM_PASSES_LINKED + VERSION_VAR LLVM_VERSION +) + +mark_as_advanced(LLVM_CONFIG_EXE) From 699551ba70a754d936bc056e1d957c4c13cb8ba9 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Mon, 12 May 2014 21:52:19 +0400 Subject: [PATCH 35/44] Adds check for Threads in CMake script Issue: #50 --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c8e1959..af2c228 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") project(llst-project) +find_package(Threads REQUIRED QUIET) find_package(READLINE) find_package(TINFO) find_package(LLVM 3.1 EXACT) @@ -82,7 +83,7 @@ if (USE_LLVM) endif() add_executable(llst ${CPP_FILES}) -target_link_libraries(llst ${LLVM_LIBS_TO_LINK} ${READLINE_LIBS_TO_LINK} pthread ${CMAKE_DL_LIBS}) +target_link_libraries(llst ${LLVM_LIBS_TO_LINK} ${READLINE_LIBS_TO_LINK} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) add_dependencies(llst image) set (IMAGE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/image) From a1b62f952ae71677286b047038893c4ba104e648 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Fri, 9 May 2014 04:54:12 +0400 Subject: [PATCH 36/44] Adds toolchain for mingw32 Issue: #50 --- cmake/toolchain/mingw32.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 cmake/toolchain/mingw32.cmake diff --git a/cmake/toolchain/mingw32.cmake b/cmake/toolchain/mingw32.cmake new file mode 100644 index 0000000..dbb9eee --- /dev/null +++ b/cmake/toolchain/mingw32.cmake @@ -0,0 +1,11 @@ +set (CMAKE_SYSTEM_NAME "Windows") + +SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc) +SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++) +SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres) + +# Search headers and libraries in the target environment +# Search programs in the host environment +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) From e2329bffd7e33ba51d0aa5d3e34918b9e832053e Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Wed, 9 Apr 2014 00:55:31 +0400 Subject: [PATCH 37/44] Adds FindPOD2MAN.cmake and FindGZIP.cmake Adds option 'BUILD_DOCS'. Now cmake is able to convert pod files into man pages. Issue: #50 --- CMakeLists.txt | 46 ++++++++++++++++++++++++++++----- cmake/FindGZIP.cmake | 21 +++++++++++++++ cmake/FindPOD2MAN.cmake | 56 ++++++++++++++++++++++++++++++++++++++++ doc/llst.1.en.gz | Bin 1791 -> 0 bytes 4 files changed, 117 insertions(+), 6 deletions(-) create mode 100644 cmake/FindGZIP.cmake create mode 100644 cmake/FindPOD2MAN.cmake delete mode 100644 doc/llst.1.en.gz diff --git a/CMakeLists.txt b/CMakeLists.txt index af2c228..4f38eec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,9 +9,12 @@ find_package(Threads REQUIRED QUIET) find_package(READLINE) find_package(TINFO) find_package(LLVM 3.1 EXACT) +find_package(POD2MAN) +find_package(GZIP REQUIRED) option(USE_READLINE "Should we use the GNU readline and history libraries?" ON) option(USE_LLVM "Should we use LLVM to build JIT?" OFF) +option(USE_POD2MAN "Should we use pod2man to build the documentation (we will create empty docs otherwise)?" ON) if (USE_LLVM) if (LLVM_FOUND) @@ -51,6 +54,25 @@ else() unset(READLINE_LIBS_TO_LINK) endif() +if (USE_POD2MAN) + if (POD2MAN_FOUND) + message(STATUS "Using pod2man to build the documentation") + else() + message(FATAL_ERROR "\npod2man is not found.\nYou may configure with -DUSE_POD2MAN=OFF.") + endif() + function(get_pod2man_cmd OUT) + get_pod2man_cmd_wrapper(CMD ${ARGN}) + set("${OUT}" "${CMD}" PARENT_SCOPE) + endfunction() +else() + message(STATUS "Pod2man is disabled") + function(get_pod2man_cmd OUT) + get_pod2man_cmd_wrapper(CMD ${ARGN} STUB) + set("${OUT}" "${CMD}" PARENT_SCOPE) + endfunction() +endif() + + add_subdirectory(src) add_subdirectory(include) include_directories(include) @@ -96,18 +118,30 @@ add_custom_command( ) add_custom_target(image ALL DEPENDS ${IMAGE_DIR}/LittleSmalltalk.image) +set (DOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/doc) +set (POD_LLST_EN ${DOC_DIR}/llst.1.en.pod) +set (MAN_LLST_EN ${CMAKE_CURRENT_BINARY_DIR}/llst.1.en) +set (MAN_LLST_EN_GZ ${CMAKE_CURRENT_BINARY_DIR}/llst.1.en.gz) + +get_pod2man_cmd(MAN_LLST_EN_CMD FROM ${POD_LLST_EN} TO ${MAN_LLST_EN} + SECTION 1 CENTER "LLST Documentation" + RELEASE 0.2.1 + NAME llst +) add_custom_command( - OUTPUT changelog.gz - COMMAND gzip -9c ${CMAKE_CURRENT_SOURCE_DIR}/ChangeLog > changelog.gz - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ChangeLog - COMMENT "Compressing changelog" + OUTPUT ${MAN_LLST_EN} + COMMAND ${MAN_LLST_EN_CMD} + DEPENDS ${POD_LLST_EN} ) -add_custom_target(compress_changelog ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz) +add_custom_target(man_llst_en ALL DEPENDS ${MAN_LLST_EN}) + +gzip_compress("compress_changelog" "${CMAKE_CURRENT_SOURCE_DIR}/ChangeLog" "${CMAKE_CURRENT_BINARY_DIR}/changelog.gz") +gzip_compress("compress_man_llst_en" ${MAN_LLST_EN} ${MAN_LLST_EN_GZ} man_llst_en) install(TARGETS llst DESTINATION bin) install(FILES LICENSE DESTINATION share/doc/${PROJECT_NAME} RENAME copyright) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz DESTINATION share/doc/${PROJECT_NAME}) -install(FILES doc/llst.1.en.gz DESTINATION share/man/man1/ RENAME llst.1.gz) +install(FILES ${MAN_LLST_EN_GZ} DESTINATION share/man/man1/ RENAME llst.1.gz) install(FILES misc/bash-completion.sh DESTINATION share/bash-completion/completions RENAME llst) diff --git a/cmake/FindGZIP.cmake b/cmake/FindGZIP.cmake new file mode 100644 index 0000000..1300d8d --- /dev/null +++ b/cmake/FindGZIP.cmake @@ -0,0 +1,21 @@ + +# Find gzip +# Export variables: +# GZIP_FOUND +# GZIP_EXE + +find_program(GZIP_EXE gzip) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS( gzip DEFAULT_MSG GZIP_EXE ) +mark_as_advanced(GZIP_EXE) + +macro(gzip_compress target_name input_files result_archive) + add_custom_command( + OUTPUT ${result_archive} + COMMAND ${GZIP_EXE} --best --to-stdout ${input_files} > ${result_archive} + COMMENT "Compressing ${input_files}" + DEPENDS ${input_files} ${ARGN} + ) + add_custom_target(${target_name} ALL DEPENDS ${result_archive}) +endmacro() diff --git a/cmake/FindPOD2MAN.cmake b/cmake/FindPOD2MAN.cmake new file mode 100644 index 0000000..ffa967a --- /dev/null +++ b/cmake/FindPOD2MAN.cmake @@ -0,0 +1,56 @@ + +# Find pod2man (convert POD data to formatted *roff input) +# Export variables: +# POD2MAN_FOUND +# POD2MAN_EXE +# get_pod2man_cmd_wrapper( +# FROM +# TO +# [SECTION
] +# [CENTER
] +# [RELEASE ] +# [NAME ] +# [STUB] +# ) +# + +include(CMakeParseArguments) +include(FindPackageHandleStandardArgs) + +find_program(POD2MAN_EXE pod2man) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS( pod2man DEFAULT_MSG POD2MAN_EXE ) +mark_as_advanced(POD2MAN_EXE) + +function(get_pod2man_cmd_wrapper RESULT_CMD) + set(options STUB) + set(oneValueArgs FROM TO SECTION CENTER RELEASE NAME) + set(multiValueArgs) + CMAKE_PARSE_ARGUMENTS(POD_OPTION "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + if (NOT POD_OPTION_FROM OR NOT POD_OPTION_TO) + message(FATAL_ERROR "Arguments FROM and TO are required!") + endif() + + if (POD_OPTION_STUB) + # create empty man + set(TMP_CMD "${CMAKE_COMMAND}" "-E" "touch" "${POD_OPTION_TO}") + else() + set(TMP_CMD "${POD2MAN_EXE}") + if (POD_OPTION_SECTION) + list(APPEND TMP_CMD "--section=${POD_OPTION_SECTION}") + endif() + if (POD_OPTION_CENTER) + list(APPEND TMP_CMD "--center=\"${POD_OPTION_CENTER}\"") + endif() + if (POD_OPTION_RELEASE) + list(APPEND TMP_CMD "--release=\"${POD_OPTION_RELEASE}\"") + endif() + if (POD_OPTION_NAME) + list(APPEND TMP_CMD "--name=\"${POD_OPTION_NAME}\"") + endif() + + list(APPEND TMP_CMD "${POD_OPTION_FROM}") + list(APPEND TMP_CMD "${POD_OPTION_TO}") + endif() + set("${RESULT_CMD}" ${TMP_CMD} PARENT_SCOPE) +endfunction() diff --git a/doc/llst.1.en.gz b/doc/llst.1.en.gz deleted file mode 100644 index ed04710f0bfcbafbacdc13de38c9bf9e5d8a7dce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1791 zcmV2mFnG@raxCYVOifP0IEy$PTK0FXhUGTZk0z2OKFfW|a?ave#0Pr&-M{qLuzXIF zi~xDZb8RY#jCq{Q)q*Fq;^eW!kW>gx*3AtJ3j>m5iHxk{rKS=^H7rYG-OUu%PkbIG zwB-2=?#Cqg7um1^NuysHRubUH$#wr@Z-uxLI#2u;L~ijv)Ql<`9F}Ax(inCvSk64j zbCNkrLG@HHebXgG-}! z8yq8+g%TNoyK_dNP+9Ovra*dTH`lIfB)Q-@57L~|Dpk3g0e8v5Nbzp;-dBc>4B}rh zMF95RAfzqH(;(<*q$HIKgiq~Cy-R@AwXh21f<|vokr$bhYaaa4MJfdhr;)ofx|Y2( z+=bD#Gs6{Kr@dLXUD3yJ?Gz=%Q9|yYZUeRv0Rw5;0B$yrjw~!G)SKxhrgi!5sA#=0 z?f9L81z9^Wjq4Ofece@g3gLfBb{|;MTl_6t|J!gUCE6Cwsl!1GWzuYJsoOmYVXsq$ zqKsMY{?)K}^fUrrU6aS|*Lo0OLsnOGe_vN*7!}xNcAN{3Wt;>uSe2bnsf%{nC2?KhM=EOfGK)XHx;rSTRKB3NOK*R;b+*vJ}Z-{{M+mrTgBr*)gWC^jyWJy zi=uXAk*kJGlMbeep?YI85Mh$fzYtGg4h&2a80PalSG88wb0{MmnAY^N)u9DvI923C zk)oIh?v=fdtqHc^UaW|5)+!rPE6`Atl9=TWFh*DL$G4{{DmT|>2hVw zzG}t7VxC8~bxbEGy}r}ypU~v}_=mC_ejfcqN0!qn=k5h(In>-13I0!1Kq|LEe@N9t z$h-J0F}(Cd%2+PN#(2mFg+J#AhbL2HPR$TKWOQ=$VA)(G^&WV2S$V98JF-sV9eF|4 zVU7Hi+`!(Ezk$3dBcX4rC$Oez7hTiEABs9CUOPprbzs?tacfWCcYFH!d)nUYDSK1u z+Bhr9dz|Uu|G(ZEbsYlug!Dv@Ps^@TV1mXC^O?=C->6qtA^^Y+5}>Lw2phMC1Iboc6i8fz{4V zEzW+^pnkWmGxN31mGNk7fSlvla0ACR7i;vG0@6GCmYsF!tg;QlXO*yR$2#ngRc`=0 zHtON`)oi8GOl2TWMcW?Z`CykmlzL1cj*a5L=^eJz+rmy2+s=b&g(2FG5_UFLD4E0F zu~A{Am6EL_L(^6o7`TsgF>-x2$k9>iFfh&zJgsd|ti>-`9&# z*;zcgzOuR=lr6wNHJEnmC`O~ft)uIJSI4%_UK>!T2dG5_#;i#i-ej{BqZ6`nqE@5 zrl!-k54%W<^Itsu`j&(LS67oMouyt8V`}Knl=6DMsBVUiejJe+EuRV@!vNo5iVZFf zqZM0=-T7jj;k!(q{(y%L?)C>RG#dEuOi8hmtSQE`OP%PKJNFie{<8BoHmIAq{BUE) zI6lYle4SiU^TY7{d9$HCal7~ynZ)>VowDeGmSHXnAjHhW2LUhH&(0^K+wskGeEp#e z%cXvrJvngSs3x6WpIr~|_%9_V=jSxMnq2RT?RHBUyvQJd?-QmjR575p3n{ZfulK3o hxo;&=PvEI%Wl`44cphb`FAI6v_#gW~Dw2B-001dfh`|5= From 75dbd75d762a8be6a95fe8fd82c230cebe545161 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Wed, 14 May 2014 17:31:07 +0400 Subject: [PATCH 38/44] Moves targets 'doc' and 'image' into their own CMakeLists.txt Issue: #50 --- CMakeLists.txt | 36 +++++------------------------------- doc/CMakeLists.txt | 20 ++++++++++++++++++++ image/CMakeLists.txt | 10 ++++++++++ 3 files changed, 35 insertions(+), 31 deletions(-) create mode 100644 doc/CMakeLists.txt create mode 100644 image/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f38eec..e50d002 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,6 +73,8 @@ else() endif() +add_subdirectory(doc) +add_subdirectory(image) add_subdirectory(src) add_subdirectory(include) include_directories(include) @@ -108,40 +110,12 @@ 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_dependencies(llst image) -set (IMAGE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/image) -add_custom_command( - OUTPUT ${IMAGE_DIR}/LittleSmalltalk.image - COMMAND ${IMAGE_DIR}/imageBuilder - DEPENDS ${IMAGE_DIR}/imageSource.st - WORKING_DIRECTORY ${IMAGE_DIR} - COMMENT "Building image" -) -add_custom_target(image ALL DEPENDS ${IMAGE_DIR}/LittleSmalltalk.image) - -set (DOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/doc) -set (POD_LLST_EN ${DOC_DIR}/llst.1.en.pod) -set (MAN_LLST_EN ${CMAKE_CURRENT_BINARY_DIR}/llst.1.en) -set (MAN_LLST_EN_GZ ${CMAKE_CURRENT_BINARY_DIR}/llst.1.en.gz) - -get_pod2man_cmd(MAN_LLST_EN_CMD FROM ${POD_LLST_EN} TO ${MAN_LLST_EN} - SECTION 1 CENTER "LLST Documentation" - RELEASE 0.2.1 - NAME llst -) -add_custom_command( - OUTPUT ${MAN_LLST_EN} - COMMAND ${MAN_LLST_EN_CMD} - DEPENDS ${POD_LLST_EN} -) -add_custom_target(man_llst_en ALL DEPENDS ${MAN_LLST_EN}) - -gzip_compress("compress_changelog" "${CMAKE_CURRENT_SOURCE_DIR}/ChangeLog" "${CMAKE_CURRENT_BINARY_DIR}/changelog.gz") -gzip_compress("compress_man_llst_en" ${MAN_LLST_EN} ${MAN_LLST_EN_GZ} man_llst_en) +set(changelog_compressed "${CMAKE_CURRENT_BINARY_DIR}/changelog.gz") +gzip_compress("compress_changelog" "${CMAKE_CURRENT_SOURCE_DIR}/ChangeLog" ${changelog_compressed}) install(TARGETS llst DESTINATION bin) install(FILES LICENSE DESTINATION share/doc/${PROJECT_NAME} RENAME copyright) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz DESTINATION share/doc/${PROJECT_NAME}) -install(FILES ${MAN_LLST_EN_GZ} DESTINATION share/man/man1/ RENAME llst.1.gz) +install(FILES ${changelog_compressed} DESTINATION share/doc/${PROJECT_NAME}) install(FILES misc/bash-completion.sh DESTINATION share/bash-completion/completions RENAME llst) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 0000000..e61b20d --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1,20 @@ +set (DOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +set (POD_LLST_EN ${DOC_DIR}/llst.1.en.pod) +set (MAN_LLST_EN ${CMAKE_CURRENT_BINARY_DIR}/llst.1.en) +set (MAN_LLST_EN_GZ ${CMAKE_CURRENT_BINARY_DIR}/llst.1.en.gz) + +get_pod2man_cmd(MAN_LLST_EN_CMD FROM ${POD_LLST_EN} TO ${MAN_LLST_EN} + SECTION 1 CENTER "LLST Documentation" + RELEASE 0.2.1 + NAME llst +) +add_custom_command( + OUTPUT ${MAN_LLST_EN} + COMMAND ${MAN_LLST_EN_CMD} + DEPENDS ${POD_LLST_EN} +) + +add_custom_target(doc ALL DEPENDS ${MAN_LLST_EN}) +gzip_compress("compress_man_llst_en" ${MAN_LLST_EN} ${MAN_LLST_EN_GZ} doc) + +install(FILES ${MAN_LLST_EN_GZ} DESTINATION share/man/man1/ RENAME llst.1.gz) diff --git a/image/CMakeLists.txt b/image/CMakeLists.txt new file mode 100644 index 0000000..fe1cf3d --- /dev/null +++ b/image/CMakeLists.txt @@ -0,0 +1,10 @@ + +set (IMAGE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +add_custom_command( + OUTPUT ${IMAGE_DIR}/LittleSmalltalk.image + COMMAND ${IMAGE_DIR}/imageBuilder + DEPENDS ${IMAGE_DIR}/imageSource.st + WORKING_DIRECTORY ${IMAGE_DIR} + COMMENT "Building image" +) +add_custom_target(image ALL DEPENDS ${IMAGE_DIR}/LittleSmalltalk.image) From 33ec7f097704c6c85ff40f2f68e60d01da1569ce Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 14 May 2014 18:31:44 +0400 Subject: [PATCH 39/44] Updates README.md Issue: #50 --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 46a71b6..d5ff2d5 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ $ sudo apt-get install ia32-libs g++-multilib libreadline-dev:i386 ~/llst $ mkdir build && cd build ~/llst/build $ cmake .. -~/llst/build $ make +~/llst/build $ make llst ~/llst/build $ ./llst ``` @@ -46,14 +46,14 @@ $ sudo apt-get install ia32-libs g++-multilib libreadline-dev:i386 LLVM ==== -By default LLST is built without LLVM support. If you wish to enable it, you should pass -DLLVM=ON parameter to the cmake: +By default LLST is built without LLVM support. If you wish to enable it, you should pass -DUSE_LLVM=ON parameter to the cmake: ``` ~/llst/build $ rm CMakeCache.txt -~/llst/build $ cmake -DLLVM=ON .. +~/llst/build $ cmake -DUSE_LLVM=ON .. ~/llst/build $ make ``` -You should have LLVM installed and llvm-config be accessible from your environment. You may override the LLVM version by passing -DLLVM_VERSION=x.y parameter to cmake (where x.y should be replaced with actual version to use). +You should have LLVM 3.1 installed and llvm-config or llvm-config-3.1 be accessible from your environment. License ======= From f872f6b41d1e2a6a1b96d67c8dee4d5bf45e3c43 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Tue, 25 Mar 2014 01:59:18 +0400 Subject: [PATCH 40/44] The code generated page fault during execution of movdqa instruction This SSE instruction requered the data to be alined by 16 bytes. The code corresponding to the bug is: @SmalltalkVM::newOrdinaryObject for (uint32_t index = 0; index < fieldsCount; index++) instance->putField(index, globals.nilObject); movdqa moves a double quadword from src to dst. The compiler optimized this loop into a set of movdqa instructions. That means that 'instance' was aligned neither by 16 bytes nor by 4 bytes. When BakerMemoryManager::growHeap does its job it divides newHeapSize by 2. newHeapSize/2 must be equal to correctPadding(newHeapSize/2). But it is not. Issue: #28 --- src/BakerMemoryManager.cpp | 12 ++++++++++++ src/vm.cpp | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/BakerMemoryManager.cpp b/src/BakerMemoryManager.cpp index 4dcbe40..5764642 100644 --- a/src/BakerMemoryManager.cpp +++ b/src/BakerMemoryManager.cpp @@ -37,6 +37,14 @@ #include #include +#include +bool is_aligned_properly(void *p) { + return uint32_t(p) % sizeof(void*) == 0; +} +bool is_aligned_properly(uint32_t x) { + return x % sizeof(void*) == 0; +} + BakerMemoryManager::BakerMemoryManager() : m_collectionsCount(0), m_allocationsCount(0), m_totalCollectionDelay(0), m_heapSize(0), m_maxHeapSize(0), m_heapOne(0), m_heapTwo(0), @@ -103,6 +111,8 @@ void BakerMemoryManager::growHeap(uint32_t requestedSize) { // Stage1. Growing inactive heap uint32_t newHeapSize = correctPadding(requestedSize + m_heapSize + m_heapSize / 2); + while( !is_aligned_properly(newHeapSize/2) ) + newHeapSize = correctPadding(newHeapSize+1); std::printf("MM: Growing heap to %d\n", newHeapSize); @@ -146,6 +156,7 @@ void BakerMemoryManager::growHeap(uint32_t requestedSize) void* BakerMemoryManager::allocate(std::size_t requestedSize, bool* gcOccured /*= 0*/ ) { + assert(requestedSize == correctPadding(requestedSize)); if (gcOccured) *gcOccured = false; @@ -167,6 +178,7 @@ void* BakerMemoryManager::allocate(std::size_t requestedSize, bool* gcOccured /* m_activeHeapPointer -= requestedSize; void* result = m_activeHeapPointer; + assert( is_aligned_properly(result) ); if (gcOccured && !*gcOccured) m_allocationsCount++; diff --git a/src/vm.cpp b/src/vm.cpp index 6ab7866..ba639d4 100644 --- a/src/vm.cpp +++ b/src/vm.cpp @@ -54,7 +54,7 @@ TObject* SmalltalkVM::newOrdinaryObject(TClass* klass, std::size_t slotSize) // so we need to protect the pointer hptr pClass = newPointer(klass); - void* objectSlot = m_memoryManager->allocate(slotSize, &m_lastGCOccured); + void* objectSlot = m_memoryManager->allocate(correctPadding(slotSize), &m_lastGCOccured); if (!objectSlot) { std::fprintf(stderr, "VM: memory manager failed to allocate %u bytes\n", slotSize); return globals.nilObject; @@ -85,9 +85,9 @@ TByteObject* SmalltalkVM::newBinaryObject(TClass* klass, std::size_t dataSize) // All binary objects are descendants of ByteObject // They could not have ordinary fields, so we may use it - uint32_t slotSize = sizeof(TByteObject) + correctPadding(dataSize); + uint32_t slotSize = sizeof(TByteObject) + dataSize; - void* objectSlot = m_memoryManager->allocate(slotSize, &m_lastGCOccured); + void* objectSlot = m_memoryManager->allocate(correctPadding(slotSize), &m_lastGCOccured); if (!objectSlot) { std::fprintf(stderr, "VM: memory manager failed to allocate %d bytes\n", slotSize); return static_cast(globals.nilObject); From bf68b8751d19919ad3a04331fceee57b82724b93 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Fri, 30 Jan 2015 18:53:13 +0300 Subject: [PATCH 41/44] Fixes the deps of debian package. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e50d002..3760e52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,7 +136,7 @@ set (CPACK_STRIP_FILES "llst") set (CPACK_GENERATOR "DEB") set (CPACK_DEBIAN_PACKAGE_MAINTAINER "Team ") -set (CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libreadline6-dev") +set (CPACK_DEBIAN_PACKAGE_DEPENDS "libc6") include(CPack) From 4f64ef9af731b48bce6c3d93b5499ac0f4ac8118 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Fri, 30 Jan 2015 19:36:56 +0300 Subject: [PATCH 42/44] Moves to llvm 3.3 Issue: #49 --- CMakeLists.txt | 6 +++--- include/jit.h | 9 ++------- include/llstDebuggingPass.h | 9 --------- include/llstPass.h | 8 -------- src/JITRuntime.cpp | 12 ++++++------ src/MethodCompiler.cpp | 8 +++++--- src/llstPass.cpp | 9 +++++++++ 7 files changed, 25 insertions(+), 36 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3760e52..23b0de5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ project(llst-project) find_package(Threads REQUIRED QUIET) find_package(READLINE) find_package(TINFO) -find_package(LLVM 3.1 EXACT) +find_package(LLVM 3.3 EXACT) find_package(POD2MAN) find_package(GZIP REQUIRED) @@ -24,12 +24,12 @@ if (USE_LLVM) 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-cast-qual -Wno-unused-parameter") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter") set (LLVM_LIBS_TO_LINK ${LLVM_LIBS}) add_definitions(-DLLVM) else() - message(FATAL_ERROR "\nInstall llvm-3.1-dev:i386 and try again.") + message(FATAL_ERROR "\nInstall llvm-3.3-dev:i386 and try again.") endif() else() message(STATUS "LLVM is disabled") diff --git a/include/jit.h b/include/jit.h index dfc4546..dd8dc91 100644 --- a/include/jit.h +++ b/include/jit.h @@ -42,17 +42,12 @@ #include #include -#include -#include -#include -#include +#include +#include #include #include -#include #include #include -#include -#include // These functions are used in the IR code // as a bindings between the VM and the object world diff --git a/include/llstDebuggingPass.h b/include/llstDebuggingPass.h index 3ab2504..44fffa1 100644 --- a/include/llstDebuggingPass.h +++ b/include/llstDebuggingPass.h @@ -32,15 +32,6 @@ * along with LLST. If not, see . */ -#include -#include #include -#include -#include -#include -#include -#include -#include -#include llvm::FunctionPass* createLLSTDebuggingPass(); diff --git a/include/llstPass.h b/include/llstPass.h index 3ef0c0e..26a9b27 100644 --- a/include/llstPass.h +++ b/include/llstPass.h @@ -33,14 +33,6 @@ * along with LLST. If not, see . */ -#include -#include #include -#include -#include -#include -#include -#include -#include llvm::FunctionPass* createLLSTPass(); diff --git a/src/JITRuntime.cpp b/src/JITRuntime.cpp index b6adf0b..306b3d4 100644 --- a/src/JITRuntime.cpp +++ b/src/JITRuntime.cpp @@ -35,14 +35,18 @@ #include #include +#include +#include #include -#include #include +#include +#include +#include #include #include #include -#include +#include #include #include @@ -905,10 +909,6 @@ void JITRuntime::initializeGlobals() { void JITRuntime::initializePassManager() { m_functionPassManager = new FunctionPassManager(m_JITModule); m_modulePassManager = new PassManager(); - // Set up the optimizer pipeline. - // Start with registering info about how the - // target lays out data structures. - m_functionPassManager->add(new TargetData(*m_executionEngine->getTargetData())); m_modulePassManager->add(createFunctionInliningPass()); diff --git a/src/MethodCompiler.cpp b/src/MethodCompiler.cpp index 7c381af..fa68af4 100644 --- a/src/MethodCompiler.cpp +++ b/src/MethodCompiler.cpp @@ -34,8 +34,10 @@ */ #include + +#include + #include -#include #include #include #include @@ -281,8 +283,8 @@ Function* MethodCompiler::createFunction(TMethod* method) Function* function = cast( m_JITModule->getOrInsertFunction(functionName, functionType)); function->setCallingConv(CallingConv::C); //Anyway C-calling conversion is default function->setGC("shadow-stack"); - function->addFnAttr(Attributes(Attribute::InlineHint)); -// function->addFnAttr(Attributes(Attribute::AlwaysInline)); + function->addFnAttr(Attribute::InlineHint); +// function->addFnAttr(Attribute::AlwaysInline); return function; } diff --git a/src/llstPass.cpp b/src/llstPass.cpp index 55a9630..1731f95 100644 --- a/src/llstPass.cpp +++ b/src/llstPass.cpp @@ -36,6 +36,15 @@ #define DEBUG_TYPE "llst" #include +#include +#include +#include +#include +#include +#include +#include +#include + STATISTIC(rootLoadsRemoved, "Number of removed loads from gc.root protected pointers <<<<<<"); STATISTIC(rootsRemoved, "Number of removed roots <<<<<<"); From b759bbefba861ed2f7d9c52c183bc25d5a5dfd24 Mon Sep 17 00:00:00 2001 From: Dmitry Kashitsyn Date: Fri, 30 Jan 2015 23:37:09 +0600 Subject: [PATCH 43/44] Fixes Baker MM reallocation Issue: #14 --- src/BakerMemoryManager.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/BakerMemoryManager.cpp b/src/BakerMemoryManager.cpp index 5764642..2089105 100644 --- a/src/BakerMemoryManager.cpp +++ b/src/BakerMemoryManager.cpp @@ -110,13 +110,13 @@ bool BakerMemoryManager::initializeHeap(std::size_t heapSize, std::size_t maxHea void BakerMemoryManager::growHeap(uint32_t requestedSize) { // Stage1. Growing inactive heap - uint32_t newHeapSize = correctPadding(requestedSize + m_heapSize + m_heapSize / 2); + uint32_t newHeapSize = correctPadding(2 * requestedSize + m_heapSize + m_heapSize / 2); while( !is_aligned_properly(newHeapSize/2) ) newHeapSize = correctPadding(newHeapSize+1); std::printf("MM: Growing heap to %d\n", newHeapSize); - uint32_t newMediane = newHeapSize / 2; + const uint32_t newMediane = newHeapSize / 2; uint8_t** activeHeapBase = m_activeHeapOne ? &m_heapOne : &m_heapTwo; uint8_t** inactiveHeapBase = m_activeHeapOne ? &m_heapTwo : &m_heapOne; @@ -149,6 +149,7 @@ void BakerMemoryManager::growHeap(uint32_t requestedSize) std::memset(*activeHeapBase, 0, newMediane); } } + collectGarbage(); m_heapSize = newHeapSize; @@ -160,15 +161,31 @@ void* BakerMemoryManager::allocate(std::size_t requestedSize, bool* gcOccured /* if (gcOccured) *gcOccured = false; + // Quick check for the case when new object is + // considerably larger that the active heap space + if (requestedSize > m_heapSize / 2) { + const uint32_t newHeapSize = correctPadding(2 * requestedSize + m_heapSize + m_heapSize / 2); + + if (newHeapSize < m_maxHeapSize) { + growHeap(requestedSize); + } else { + std::fprintf(stderr, "Could not allocate %u bytes because doing so would exceed heap limit %u\n", requestedSize, m_maxHeapSize); + return 0; + } + + if (gcOccured) + *gcOccured = true; + } + std::size_t attempts = 2; while (attempts-- > 0) { if (m_activeHeapPointer - requestedSize < m_activeHeapBase) { collectGarbage(); // If even after collection there is too less space - // we may try to expand the heap + // we may try to expand the heap if limit is not yet reached const uintptr_t distance = m_activeHeapPointer - m_activeHeapBase; - if ((m_heapSize < m_maxHeapSize) && (distance < m_heapSize / 6)) + if ((distance < m_heapSize / 16) && (m_heapSize < m_maxHeapSize)) growHeap(requestedSize); if (gcOccured) From 4ae5fffcc923c6fdbff837463a0647c98259fe28 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Sat, 31 Jan 2015 16:01:06 +0300 Subject: [PATCH 44/44] Bumps the version and year --- CMakeLists.txt | 4 +- ChangeLog | 224 ++++++++++++++++++++++++++++++ image/imageSource.st | 4 +- include/CompletionEngine.h | 6 +- include/Core.ll | 6 +- include/args.h | 6 +- include/ib.h | 6 +- include/jit.h | 6 +- include/llstDebuggingPass.h | 6 +- include/llstPass.h | 6 +- include/memory.h | 6 +- include/opcodes.h | 6 +- include/primitives.h | 6 +- include/types.h | 6 +- include/vm.h | 6 +- src/BakerMemoryManager.cpp | 6 +- src/CompletionEngine.cpp | 6 +- src/GenerationalMemoryManager.cpp | 6 +- src/Image.cpp | 6 +- src/JITRuntime.cpp | 6 +- src/LLVMMemoryManager.cpp | 6 +- src/MethodCompiler.cpp | 6 +- src/NonCollectMemoryManager.cpp | 6 +- src/TDictionary.cpp | 6 +- src/TInstruction.cpp | 6 +- src/TSymbol.cpp | 6 +- src/args.cpp | 12 +- src/llstDebuggingPass.cpp | 6 +- src/llstPass.cpp | 6 +- src/main.cpp | 6 +- src/primitives.cpp | 6 +- src/vm.cpp | 6 +- 32 files changed, 318 insertions(+), 94 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 23b0de5..07ed8b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,8 +126,8 @@ 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 "2") -set (CPACK_PACKAGE_VERSION_PATCH "1") +set (CPACK_PACKAGE_VERSION_MINOR "3") +set (CPACK_PACKAGE_VERSION_PATCH "0") set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set (CPACK_SOURCE_GENERATOR "TGZ") set (CPACK_SOURCE_IGNORE_FILES "build/" "\\\\.kdev.*" "\\\\.git.*" "\\\\.hgignore" ".*\\\\.image") diff --git a/ChangeLog b/ChangeLog index e1e87c9..c22b408 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,165 @@ [Current] + +[v_0.3] +2015-01-30 Dmitry Kashitsyn + + Fixes Baker MM reallocation + + Issue: #14 + +2015-01-30 Roman Proskuryakov + + Moves to llvm 3.3 + + Issue: #49 + +2015-01-30 Roman Proskuryakov + + Fixes the deps of debian package. + +2014-03-25 Roman Proskuryakov + + The code generated page fault during execution of movdqa instruction + This SSE instruction requered the data to be alined by 16 bytes. + + The code corresponding to the bug is: + + @SmalltalkVM::newOrdinaryObject + for (uint32_t index = 0; index < fieldsCount; index++) + instance->putField(index, globals.nilObject); + + movdqa moves a double quadword from src to dst. The compiler optimized this loop into a set of movdqa instructions. + That means that 'instance' was aligned neither by 16 bytes nor by 4 bytes. + + When BakerMemoryManager::growHeap does its job it divides newHeapSize by 2. + newHeapSize/2 must be equal to correctPadding(newHeapSize/2). But it is not. + + Issue: #28 + +2014-05-14 Roman + + Updates README.md + + Issue: #50 +2014-05-14 Roman Proskuryakov + + Moves targets 'doc' and 'image' into their own CMakeLists.txt + + Issue: #50 + +2014-04-09 Roman Proskuryakov + + Adds FindPOD2MAN.cmake and FindGZIP.cmake + + Adds option 'BUILD_DOCS'. + Now cmake is able to convert pod files into man pages. + + Issue: #50 + +2014-05-09 Roman Proskuryakov + + Adds toolchain for mingw32 + + Issue: #50 + +2014-05-12 Roman Proskuryakov + + Adds check for Threads in CMake script + + Issue: #50 + +2014-05-12 Roman Proskuryakov + + Adds cmake module to find LLVM + + Issue: #50 + +2014-05-12 Roman Proskuryakov + + Adds cmake module to find libreadline and libtinfo + + Issue: #50 + +2014-05-12 Roman Proskuryakov + + Moves common vars into cmake/variables.cmake + + Issue: #50 + +2014-05-12 Roman Proskuryakov + + Adds target `make uninstall` + + Issue: #50 + +2014-02-26 Roman Proskuryakov + + Adds CLI arg `-v, --version` + + Issue: #50 + +2014-03-22 Roman Proskuryakov + + Fixes -Wall -Wextra warnings + + Issue: #50 + +2014-01-08 Dmitry Kashitsyn + + Adds include guard to completion engine header + +2013-12-31 Roman Proskuryakov + + Adds handling of READLINE option in cmake + + Now usage of readline library may be controlled + by passing a -DREADLINE=(ON|OFF) parameter to cmake. + + If parameter is passed library usage depends on value. + If parameter is omitted it defaults to ON. + + Issue: #52 + +2013-12-31 Roman Proskuryakov + + Adds a dumb version of CompletionEngine without libreadline + + Issue: #52 + +2013-12-25 Roman Proskuryakov + + Makes the code compile with MinGW + + Issue: #46 + +2013-12-24 Roman Proskuryakov + + Makes Image::loadImage() cross-platform + + It worked fine for GNU/Linux, FreeBSD, but the is no mmap in MS \|/iNdOwS. + The function is rewritten with std::ifstream. + + Issue: #46 + +2014-01-06 Roman Proskuryakov + + Adds a new cmake target to compress and install ChangeLog + + Issue: #43 + +2013-12-31 Roman Proskuryakov + + Removes redundant static_cast for TInteger + + Issue: #51 + +2013-12-31 Roman Proskuryakov + + Implements primitive 'readline' inside CompletionEngine + + Issue: #52 + 2013-12-29 Roman Proskuryakov Adds script to generate ChangeLog @@ -20,6 +180,70 @@ Issue: #43 +2013-12-28 Roman Proskuryakov + + TInteger keeps m_value of type int32_t, not TObject* + + Issue: #51 + +2013-12-28 Roman Proskuryakov + + Fixes JIT compilation + + Issue: #51 + +2013-12-26 Roman Proskuryakov + + Adds TInteger::operator +-(int32_t) + + With these operators we can write a code like: + TInteger x = 42; + int y = x + 2; + + Issue: #51 + +2013-12-22 Roman Proskuryakov + + Replaces `typedef int32_t TInteger` with a real class + + Issue: #51 + +2013-12-07 Roman Proskuryakov + + Fixes compilation warnings for Arch Linux + + Issue: #46 + +2013-12-07 Roman Proskuryakov + + Fixes llvm asserts for Arch Linux + + Issue: #46 + +2013-12-03 Roman Proskuryakov + + Requires CMake 2.8.4 due to cygwin warnings + + Issue: #46 + +2013-12-03 Roman Proskuryakov + + Adds `#include ` to resolve type FILE + + Issue: #46 + +2013-12-03 Roman Proskuryakov + + Adds EOL to args.h + + Issue: #46 + +2013-12-03 Roman Proskuryakov + + Fixes error with undeclared 'EXIT_SUCCESS' for RPi + + Issue: #46 + 2013-12-02 Roman Proskuryakov Adds bash completion for llst installed with deb diff --git a/image/imageSource.st b/image/imageSource.st index b1d25b1..33bcf35 100644 --- a/image/imageSource.st +++ b/image/imageSource.st @@ -14,8 +14,8 @@ COMMENT Copyright (C) 2007 by Charles R. Childers COMMENT Copyright (C) 2005-2007 by Danny Reinhold COMMENT COMMENT Some parts of this file are -COMMENT Copyright (C) 2012-2013 Dmitry Kashitsyn -COMMENT Copyright (C) 2012-2013 Roman Proskuryakov +COMMENT Copyright (C) 2012-2015 Dmitry Kashitsyn +COMMENT Copyright (C) 2012-2015 Roman Proskuryakov COMMENT COMMENT ============================================================================ COMMENT This license applies to the virtual machine and to the initial image of diff --git a/include/CompletionEngine.h b/include/CompletionEngine.h index e396070..e78d5e0 100644 --- a/include/CompletionEngine.h +++ b/include/CompletionEngine.h @@ -3,11 +3,11 @@ * * Console completion proposals engine * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/include/Core.ll b/include/Core.ll index 2db3be9..4391424 100644 --- a/include/Core.ll +++ b/include/Core.ll @@ -9,11 +9,11 @@ ; small and almost all of them gets inlined, so it does not ; affect the perfomance of JIT code. ; -; LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 +; LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 ; ; LLST is -; Copyright (C) 2012-2013 by Dmitry Kashitsyn -; Copyright (C) 2012-2013 by Roman Proskuryakov +; Copyright (C) 2012-2015 by Dmitry Kashitsyn +; Copyright (C) 2012-2015 by Roman Proskuryakov ; ; LLST is based on the LittleSmalltalk which is ; Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/include/args.h b/include/args.h index d288057..b44a6d1 100644 --- a/include/args.h +++ b/include/args.h @@ -3,11 +3,11 @@ * * Helper functions for command line argument parsing * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/include/ib.h b/include/ib.h index 7c84659..2729e41 100644 --- a/include/ib.h +++ b/include/ib.h @@ -3,11 +3,11 @@ * * Interface for the native method compiler * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/include/jit.h b/include/jit.h index dd8dc91..cfc61e7 100644 --- a/include/jit.h +++ b/include/jit.h @@ -3,11 +3,11 @@ * * LLVM related routines * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/include/llstDebuggingPass.h b/include/llstDebuggingPass.h index 44fffa1..5d5be6a 100644 --- a/include/llstDebuggingPass.h +++ b/include/llstDebuggingPass.h @@ -3,11 +3,11 @@ * * Debugging LLVM pass * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/include/llstPass.h b/include/llstPass.h index 26a9b27..af13767 100644 --- a/include/llstPass.h +++ b/include/llstPass.h @@ -4,11 +4,11 @@ * Optimizing LLVM pass for JIT code generator. * Tries to remove redundant memory loads and roots. * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/include/memory.h b/include/memory.h index b705eed..3c80acc 100644 --- a/include/memory.h +++ b/include/memory.h @@ -3,11 +3,11 @@ * * LLST memory management routines and interfaces * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/include/opcodes.h b/include/opcodes.h index 0381933..554e324 100644 --- a/include/opcodes.h +++ b/include/opcodes.h @@ -3,11 +3,11 @@ * * Instruction codes of the Smalltalk virtual machine * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/include/primitives.h b/include/primitives.h index 41fb132..892082e 100644 --- a/include/primitives.h +++ b/include/primitives.h @@ -3,11 +3,11 @@ * * Primitive handling functions which are part of soft VM * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/include/types.h b/include/types.h index f8791da..7dc7cfc 100644 --- a/include/types.h +++ b/include/types.h @@ -3,11 +3,11 @@ * * Basic Smalltalk related types and structures * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/include/vm.h b/include/vm.h index 44f5e4f..dbe4aed 100644 --- a/include/vm.h +++ b/include/vm.h @@ -3,11 +3,11 @@ * * LLST virtual machine related classes and structures * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/BakerMemoryManager.cpp b/src/BakerMemoryManager.cpp index 2089105..c2f4739 100644 --- a/src/BakerMemoryManager.cpp +++ b/src/BakerMemoryManager.cpp @@ -3,11 +3,11 @@ * * Implementation of BakerMemoryManager class * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/CompletionEngine.cpp b/src/CompletionEngine.cpp index 18060fe..e01cf56 100644 --- a/src/CompletionEngine.cpp +++ b/src/CompletionEngine.cpp @@ -3,11 +3,11 @@ * * Smalltalk aware completion functions for readline library * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/GenerationalMemoryManager.cpp b/src/GenerationalMemoryManager.cpp index 7a2fa9c..6141c86 100644 --- a/src/GenerationalMemoryManager.cpp +++ b/src/GenerationalMemoryManager.cpp @@ -5,11 +5,11 @@ * original Baker memory manager by introducing asymmetrical * handling of heap parts. * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/Image.cpp b/src/Image.cpp index ab109b1..0d383fc 100644 --- a/src/Image.cpp +++ b/src/Image.cpp @@ -3,11 +3,11 @@ * * Implementation of Image class which loads the file image into memory * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/JITRuntime.cpp b/src/JITRuntime.cpp index 306b3d4..0c97fda 100644 --- a/src/JITRuntime.cpp +++ b/src/JITRuntime.cpp @@ -3,11 +3,11 @@ * * LLST Runtime environment * -* LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 +* LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is -* Copyright (C) 2012-2013 by Dmitry Kashitsyn -* Copyright (C) 2012-2013 by Roman Proskuryakov +* Copyright (C) 2012-2015 by Dmitry Kashitsyn +* Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/LLVMMemoryManager.cpp b/src/LLVMMemoryManager.cpp index 9544d7c..98704ae 100644 --- a/src/LLVMMemoryManager.cpp +++ b/src/LLVMMemoryManager.cpp @@ -4,11 +4,11 @@ * Implementation of the MM aware of LLVM specifics * such as function stack traversing. * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/MethodCompiler.cpp b/src/MethodCompiler.cpp index fa68af4..346fa79 100644 --- a/src/MethodCompiler.cpp +++ b/src/MethodCompiler.cpp @@ -4,11 +4,11 @@ * Implementation of MethodCompiler class which is used to * translate smalltalk bytecodes to LLVM IR code * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/NonCollectMemoryManager.cpp b/src/NonCollectMemoryManager.cpp index 7070079..9910999 100644 --- a/src/NonCollectMemoryManager.cpp +++ b/src/NonCollectMemoryManager.cpp @@ -9,11 +9,11 @@ * production code. However, it may be helpful in various * test scenarios where small tasks are performed in one shot. * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/TDictionary.cpp b/src/TDictionary.cpp index e00016d..10cb539 100644 --- a/src/TDictionary.cpp +++ b/src/TDictionary.cpp @@ -3,11 +3,11 @@ * * Implementation of TDictionary lookup methods * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/TInstruction.cpp b/src/TInstruction.cpp index 5ec2d54..f129902 100644 --- a/src/TInstruction.cpp +++ b/src/TInstruction.cpp @@ -3,11 +3,11 @@ * * Helper functions for TInstruction class * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/TSymbol.cpp b/src/TSymbol.cpp index 309cd9c..ddfb06d 100644 --- a/src/TSymbol.cpp +++ b/src/TSymbol.cpp @@ -3,11 +3,11 @@ * * Helper functions for TSymbol class * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/args.cpp b/src/args.cpp index 28607c3..d6d5dbb 100644 --- a/src/args.cpp +++ b/src/args.cpp @@ -3,11 +3,11 @@ * * Helper functions for command line argument parsing * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd @@ -124,9 +124,9 @@ std::string args::getHelp() std::string args::getVersion() { return - "llst 0.2.1\n" - "Copyright (C) 2012-2014 by Dmitry Kashitsyn \n" - "Copyright (C) 2012-2014 by Roman Proskuryakov \n" + "llst 0.3.0\n" + "Copyright (C) 2012-2015 by Dmitry Kashitsyn \n" + "Copyright (C) 2012-2015 by Roman Proskuryakov \n" "This is free software; see the source for copying conditions. There is NO\n" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."; } diff --git a/src/llstDebuggingPass.cpp b/src/llstDebuggingPass.cpp index 23bbae5..7cab9f5 100644 --- a/src/llstDebuggingPass.cpp +++ b/src/llstDebuggingPass.cpp @@ -3,11 +3,11 @@ * * Debugging LLVM pass * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/llstPass.cpp b/src/llstPass.cpp index 1731f95..7b9296c 100644 --- a/src/llstPass.cpp +++ b/src/llstPass.cpp @@ -4,11 +4,11 @@ * Optimizing LLVM pass for JIT code generator. * Tries to remove redundant memory loads and roots. * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/main.cpp b/src/main.cpp index 90d66fe..75f40c4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,11 +3,11 @@ * * Program entry point * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/primitives.cpp b/src/primitives.cpp index 53af5cd..0364906 100644 --- a/src/primitives.cpp +++ b/src/primitives.cpp @@ -3,11 +3,11 @@ * * Implementation of primitive handling functions which are part of soft VM * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd diff --git a/src/vm.cpp b/src/vm.cpp index 1134f5b..e2a93c4 100644 --- a/src/vm.cpp +++ b/src/vm.cpp @@ -3,11 +3,11 @@ * * Implementation of the virtual machine (SmalltalkVM class) * - * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.2 + * LLST (LLVM Smalltalk or Low Level Smalltalk) version 0.3 * * LLST is - * Copyright (C) 2012-2013 by Dmitry Kashitsyn - * Copyright (C) 2012-2013 by Roman Proskuryakov + * Copyright (C) 2012-2015 by Dmitry Kashitsyn + * Copyright (C) 2012-2015 by Roman Proskuryakov * * LLST is based on the LittleSmalltalk which is * Copyright (C) 1987-2005 by Timothy A. Budd