First commit
This commit is contained in:
+358
@@ -0,0 +1,358 @@
|
||||
2017-12-19 : 2.2.0
|
||||
nekotools : added `nekotools boot -c *.n`, which generates a C file that contains the input Neko bytecode (#130)
|
||||
nekotools : fixed `nekotools boot` not able to find neko when a value in PATH does not have a trailing slash (#148)
|
||||
cmake : recognize common install location variables by using GNUInstallDirs
|
||||
cmake : fixed various build issues, particularly for FreeBSD (Thanks, ppenzin!), and cygwin
|
||||
cmake : added NekoConfig.cmake to ease building ndll or native program using Neko with CMake
|
||||
cmake : replaces WITH_NDLLS with WITH_* (#157)
|
||||
cmake : does not recompile nekoc/nekoml unless RECOMPILE_NEKOC_NEKOML (#171)
|
||||
all : added NEKO_MODULE_PATH in neko.h that points to the installation path of the ndll files
|
||||
std : bugfix in utf8_compare (https://github.com/HaxeFoundation/haxe/issues/5308)
|
||||
ssl : handle MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY (#150)
|
||||
ssl : allow partial failure on loading certificates (#160)
|
||||
mysql : use eof terminated string when appropriated (#159)
|
||||
jit : disable jit for win64, which never worked
|
||||
all : introduced NEKO_BIG_ENDIAN and NEKO_LITTLE_ENDIAN to replace IS_BIG_ENDIAN, IS_LITTLE_ENDIAN, LITTLE_ENDIAN, BIG_ENDIAN, and BYTE_ORDER
|
||||
all : renamed TAG_BITS to NEKO_TAG_BITS
|
||||
all : add NEKO_JIT_DISABLE and NEKO_JIT_DEBUG CMake options
|
||||
all : VS2015 and 2017 compatiblity (#133 #172)
|
||||
sqlite : fixed reading 32-bit int from sqlite (#167)
|
||||
|
||||
2016-05-08 : 2.1.0
|
||||
all : switched to use CMake for building (#122)
|
||||
mod_neko/tora : use remote_ip (fixes Apache 2.2 returning 0.0.0.0 in 64 bits ?)
|
||||
std : added buffer_get_length
|
||||
std : added socket_send_to and socket_recv_from for UDP, added socket_set_keepalive
|
||||
all : increased max codesize from 65K opcodes to 1M
|
||||
nekoc : allow break/continue in try/catch
|
||||
std : bugfix in utf8_compare
|
||||
vm : added $sget16/$sget32/$sgetf/$sgetd, $sset16/$sset32/$ssetf/$ssetd, and $itof/$itod/$ftoi/$dtoi
|
||||
vm : bugfix with arrays/strings having length >128MB
|
||||
jit : bugfix on some GCC versions causing invalid array access
|
||||
std : fixed escaping of arguments in process_run
|
||||
all : nekotools boot executable can now be safely striped on Linux (#86)
|
||||
all : nekotools boot now looks for the Neko VM binary in cwd, $loader.path, and PATH in order (#110)
|
||||
std : added epoll support (#67)
|
||||
all : libneko can now be loaded from current directory
|
||||
all : libneko is now versioned
|
||||
vm : comparisons with NaN and Int/Float now always returns false
|
||||
api : added kind_lookup (#6)
|
||||
mod_neko/tora : distribute ndlls compiled against Apache 2.4 (can still manually compile against Apache 2.2)
|
||||
mysql : use MariaDB's LGPL connector/c instead of MySQL's GPL connector/c (can still use MySQL for compilation)
|
||||
all : copyright to Haxe Foundation instead of Nicolas and other license clean up (#102)
|
||||
|
||||
2013-02-23 : 2.0.0
|
||||
all : changed license to MIT
|
||||
mod_neko+mod_tora : fixed issue with get_client_ip in 64 bits mode /gcc
|
||||
mysql : added support for timestamp to date conversion
|
||||
std : added merge_sort native implementation
|
||||
std : added mem_local_size
|
||||
regexp : fix in regexp_match, ^ no longer match if pos > 0
|
||||
tools : don't abort server on invalid http request
|
||||
std : fixed sys_command error code (was <<8 on Linux/OSX)
|
||||
nekoc : added -version which adds Loop opcode and ensure correct $array evaluation order
|
||||
vm : support for bytecode version and new Loop/MakeArray2 opcodes
|
||||
mod_neko/tora : only mix POST with GET params if content-type contains 'urlencoded'
|
||||
mysql5 : added charset support check for escape()
|
||||
nekoc : fixed bug with switch tables where max >= 256
|
||||
neko : int32 is now a first class value
|
||||
std : md5 and hashing now takes the int32 value into account
|
||||
neko : max array/string size is now 256MB instead of 512MB
|
||||
std : date_new("YYYY-MM-DD") now uses localtime instead of UTC (same as Y-M-D H:M:S)
|
||||
neko : fixed missing stack for array write in interp mode with invalid index
|
||||
neko : added "-version" to print version and exit
|
||||
|
||||
2011-09-10 : 1.8.2
|
||||
vm : use 15 digits (instead of 10) for float display
|
||||
std : allow up to 512MB array/string size in serialize (instead of 1MB)
|
||||
std : bugfix in utf8 (with 4 bytes codes)
|
||||
vm : finalizers bugfix on Windows
|
||||
std : added sys_thread_cpu_time()
|
||||
vm : use VEXTERN for neko_kind_module and neko_id_module
|
||||
std : hide process console in process_run
|
||||
nekoml : added Math core module
|
||||
std : fixed timeout error for sockets on Windows
|
||||
mod_tora : added PROXY_MODE configuration
|
||||
std : fixed timeout error for sockets on Linux
|
||||
vm : fixed $int and $float - return null on invalid strings
|
||||
mysql : added result_get_fields_names
|
||||
gc : prevent issues with AV softs / GoogleDesktop which inject threads
|
||||
vm : use sse2 for fp calculus on gcc (double precision, same as msvc/flash)
|
||||
removed in updated build (some CPU are not compatible)
|
||||
mysql : added support for BINARY(size) type
|
||||
vm : keep stack infos for object/array ops (interp)
|
||||
std : added thread_stack
|
||||
vm : added $fasthash
|
||||
mysql5 : fixed 5.5 protocol change
|
||||
std : fixed sha1 for 64-bits (also fix mysql5 auth)
|
||||
std : added make_sha1
|
||||
mysql : added set_conv_funs for string + bytes wrapping support
|
||||
|
||||
2009-07-26 : 1.8.1
|
||||
nekoc : small fix in evaluation of using jump tables for switch on integers
|
||||
regexp : use a recursion limit to prevent stack overflows in pcre
|
||||
mysql5 : completely rewrote mysql client
|
||||
mod_tora : complete rearchitecture with abstract protocol
|
||||
std : added socket_set_fast_send
|
||||
mod_tora : use socket fast send to optimize timing
|
||||
mod_tora : fixed bug when .n file does not exists
|
||||
mod_tora : fix for Apache 2.x - does not set the content-type if declined
|
||||
mod_tora : added port range configuration (for random tora server)
|
||||
std, mod_tora : propagate jit mode to created threads
|
||||
nekoc : optimization for debug infos : precompute file table at compile-time
|
||||
threads : added neko_gc_register_thread (but buggy, so not used)
|
||||
mysql5 : added 5 hours network timeout while waiting for an answer
|
||||
mysql5 : fixed some additional errors handling
|
||||
mysql5 : allow big requests (more than 16MB)
|
||||
vm : optimize object table - one word and one memory block saved per object
|
||||
jit : one more crash fix for the + operation and unexisting overloaded operator
|
||||
nekoml : added Sys.is_directory, Sys.read_directory and Regexp.split
|
||||
nekoml : don't allow empty match
|
||||
vm : create pthreads in detached mode (prevent leak on osx/linux)
|
||||
std : added math_fceil,math_ffloor,math_fround,math_int,process_kill
|
||||
nekoc : forbidden usage of 'var' outside blocks
|
||||
|
||||
2008-09-23 : 1.8.0
|
||||
added mod_tora (neko application server)
|
||||
changed mod_neko get_host_name : return the http host instead of the server IP
|
||||
bugfix in nekoml : fixed usage of nekoml.std + added -nostd
|
||||
std : added EINTR handling in send/recv socket operations and fread/fwrite
|
||||
gc : upgraded windows version to 7.1
|
||||
vm : fixed comparison of bool
|
||||
vm : moved threads stuff into threads.c
|
||||
nekoml : fixed lexing engine, allow escape sequences in char groups
|
||||
mysql : link with thread_safe version on linux
|
||||
std : fixed threads issues with host_resolve and host_reverse
|
||||
libs : compile with -pthread on linux/osx to ensure thread safety
|
||||
main : turned ON jit by default for bootable executables
|
||||
std : added set_trusted primitive
|
||||
gc : use alloc_ignore_off_page for large blocks
|
||||
gc : use finalizers with no_order (prevent cycles)
|
||||
mysql : prevent hashing the fields that looks like inner requests
|
||||
vm : optimized global fields cache
|
||||
std : string_split doesn't copy the string anymore if the pattern is not found
|
||||
vm : added neko_vm_dump_stack
|
||||
std : use per-thread locale on POSIX systems
|
||||
std : url_encode does not encode anymore - and . chars
|
||||
std : fixed sleep() for unix (more accurate and deal with signals)
|
||||
std : added module_read_string and module_set_name
|
||||
std : fixed some file descriptor issues with processes and threads
|
||||
jit : fixed crash whith unsupported OO overloading
|
||||
vm : added $getkind and $iskind builtins
|
||||
std : added same_closure for closure comparison
|
||||
|
||||
2008-07-28 : 1.7.1
|
||||
nekotools : fixed set_return_code in web server
|
||||
std : display windowed application in process_run
|
||||
mod_neko : allowed to uncache module with set_main(null)
|
||||
mod_neko : use strmcpi for set_header("Content-Type")
|
||||
nekoc : one last fix for big arrays (first element was not compiled)
|
||||
mod_neko : added get_http_method
|
||||
nekoml : minor fixes in lexer
|
||||
nekoml : added -pack and -use, auto build nekoml.std
|
||||
include nekoml as part of standard distribution
|
||||
vm/security : $smake now fills the string with 0
|
||||
std/int32 : fixed need_32_bits macro (negative values)
|
||||
bugfix : >> and >>> were reversed in JIT
|
||||
bugfix : date functions are now MT-safe
|
||||
removed context.h and context.c
|
||||
added lock and tls multithread API to neko.h
|
||||
std : added date_get_tz()
|
||||
mod_neko : added log_message
|
||||
regexp : fix for unmatched optional groups, return null instead of empty string
|
||||
threads : for windows, use critical_section instead of mutex for locks
|
||||
threads : for posix, use a recursive mutex which match windows behavior
|
||||
std : added mutex and deque api (threads)
|
||||
|
||||
2008-03-16 : 1.7.0
|
||||
nekoc : allow binary ast format with -p, don't allow inline nxml
|
||||
std : allow int32_new float parameter
|
||||
vm : reduce debug infos memory size by 16
|
||||
vm : fixed $int in case of overflow
|
||||
regexp : upgraded windows ndll to use pcre 7.3 with utf8 support
|
||||
fixed : math_round(0.5) is now 1
|
||||
fixed : date_set_hour and date_set_day crash with invalid dates
|
||||
fixed : bug in vm/callback.c when stack address is >2GB
|
||||
sockets : added support for socket_poll for Windows
|
||||
sockets : added socket_poll_prepare and socket_poll_events
|
||||
thread : added tls_create, tls_set, tls_get
|
||||
vm : threaded interpreter (gcc only)
|
||||
vm : always use COMPACT_TABLE for objects
|
||||
mod_neko : log some errors into apache log
|
||||
neko+vm : added perf statistics hooks (-stats)
|
||||
mod_neko : scriptable configuration and statistics
|
||||
regexp : allow more than 10 matches
|
||||
std : added process_close
|
||||
vm : added $aconcat
|
||||
nekoc : fixed big arrays declarations
|
||||
std : added sys_is64
|
||||
|
||||
2007-07-25 : 1.6.0
|
||||
display error message when uncaught exception in neko thread
|
||||
fix bug in long run JIT programs : no C functions callable anymore
|
||||
use a smarter way to prevent C stack overflow
|
||||
nekoc : stack align error message
|
||||
set max-stack-per-function to 128 and default-stack-size to 256
|
||||
jit now check stack overflow on function entry and not on every push
|
||||
mod_neko2 set MOD_NEKO=2 env var (for version detection)
|
||||
mod_neko2 : remove Apache 2.0 error message, use 302 http code for redirect
|
||||
fixed fallback of interp operator overloading
|
||||
fix for 64-bit CPU
|
||||
minor optimization for [0] jit array access
|
||||
gnuk/freebsd support
|
||||
fixed thread messages on Windows (do not use system queue)
|
||||
thread_current returns unique value
|
||||
remove kind_import, kind_export, added kind_share
|
||||
added ui library
|
||||
added libs/std/process api functions
|
||||
new binary ast format (faster than nxml)
|
||||
|
||||
2007-01-28 : 1.5.3
|
||||
minor fixes in mod_neko multipart and POST data handling
|
||||
fixed $objremove result (was always true)
|
||||
fixed one-last-bug when using more-than-five-arguments method call return value
|
||||
fixed bug in dev webserver when accessing a directory
|
||||
added xcross support
|
||||
fixed bug with $setresolver in bytecode interpreter
|
||||
changed bootable vm implementation (easier, allow compressed bin)
|
||||
added .mode in sys_stat
|
||||
change in $version format
|
||||
|
||||
2006-11-22 : 1.5.2
|
||||
fixed std math_pow float
|
||||
minor thread cleanup
|
||||
added MySQL5.ndll for Windows
|
||||
fields hash cache is now global (instead of per-thread)
|
||||
socket_select retry on EINTR
|
||||
fixed under-second lock timeout for Linux/OSX
|
||||
added socket_poll for Linux/OSX (emulate with select() on Windows)
|
||||
fixed compilation bug when accessing 'this' in arguments and more than 5 args
|
||||
fixed string_split with empty string (was causing infinite loop)
|
||||
fixes in more-than-five-arguments-calls
|
||||
added $varargs
|
||||
|
||||
2006-10-29 : 1.5
|
||||
neko web server : get_client_header is now case-insensitive
|
||||
std : new thread and lock api
|
||||
neko : when run from commandline, SEGV on Linux are turned into exceptions
|
||||
+ added mod_neko2 error if used with Apache 2.0.x
|
||||
|
||||
2006-10-09 : 1.4.5
|
||||
sqlite : added BOOL handling
|
||||
jit : added mmap support (for execution protection)
|
||||
jit : fixed bug when unsupported operation exception
|
||||
vm : fixed bug in debug infos reading when nfiles > 255
|
||||
vm : fixed bug in interp -> jit call
|
||||
vm : default NEKOPATH is now the same on OSX/Linux
|
||||
vm : optimized debug infos runtime memory size
|
||||
std : added misc.c (float & double bytes manipulations + gc/vm functions)
|
||||
std : fixed buf in sys_read_dir on windows (directory not closed correctly)
|
||||
std : added sys_getch, sys_get_pid
|
||||
std : fixed socket_host (was returning the same as socket_peer)
|
||||
std : improved performances of serialize/unserialize
|
||||
allowed break & continues in try/catch if they don't break outside
|
||||
nekoml : fixed bug in lexer allocating too bug memory when small reads
|
||||
nekotools : bugfixes in server, added static file streaming
|
||||
nekotools : fixed boot for universal binaries
|
||||
mod_neko : minor updates for better memory handling
|
||||
mod_neko : use soft timeout for Apache 1.3
|
||||
|
||||
2006-08-02 : 1.4
|
||||
std : added a SO_REUSEADDR before socket_bind (except windows)
|
||||
nekoc/nekovm : allowed more than 127 filenames in debug infos
|
||||
nekotools server : added -rewrite for mod_rewrite'style urls
|
||||
added zlib wrapper
|
||||
mod_neko for apache 2.0
|
||||
added sqlite wrapper
|
||||
std : fixed socket_set_timeout (changed unit from millisec to seconds)
|
||||
std : fixed math_pow (integer overflow) , fixed readdir (missing closedir on Linux)
|
||||
added PPC registers
|
||||
neko.h : added NEKO_* OS/CPU flags
|
||||
added JIT for x86
|
||||
vm : (int mod 0) is now an exception (and not NaN)
|
||||
neko.h : added kind_import and kind_export to share abstracts between libraries
|
||||
std : handle signals in socket send and recv
|
||||
allowed OSX universal build
|
||||
added $setresolver for unknown object field handling
|
||||
|
||||
2006-05-11 : 1.3
|
||||
neko : fixed endianness bug needed to boot, exported neko_is_big_endian
|
||||
neko : fixed bug on Linux x86 gcc with object operators (eax get overwritten)
|
||||
neko : fixed bug : error when __string or __compare does not exist
|
||||
neko : allowed runtime printer redirection (+ added std@print_redirect)
|
||||
neko : defined a default NEKOPATH when not specified (less configuration)
|
||||
neko : fixed int32 calculus bug (need_32_bits macro)
|
||||
neko : fixed calls with a lot of arguments (some cases were failing)
|
||||
neko : fixed preservation of 'this' through tailcall, if changed inside the call
|
||||
neko : added unary operator minus parsing
|
||||
neko : fixed error reporting of unclosed parenthesis
|
||||
nekoml : added Net core module for sockets
|
||||
nekoml : when catching Neko errors, wrap them using Neko_error constructor
|
||||
std : supported serialization of C primitives and __serialize/__unserialize overrides
|
||||
added nekotools (merged nekoboot and neko webserver)
|
||||
std : fixed math_round, fixed math docs
|
||||
std : fixed bug in utf8_resize, utf8_get and utf8_iter.
|
||||
regexp : added regexp_new_options for matching options and regexp_replace_fun
|
||||
regexp : fixed invalid matched length when not index 0
|
||||
added some benchmarks in src/benchs
|
||||
neko : fixed $ablit and $sblit (when used with same array/string)
|
||||
neko : fixed multithread win32 support
|
||||
mod_neko : changed Content-Type handling for POST data
|
||||
std : added blocking sockets support
|
||||
std : changed sys_time to sys_cpu_time, added sys_time (local time).
|
||||
std : fixed put_env on Linux (GC issue)
|
||||
cleanup of some stuff needed by experimental JIT
|
||||
std : added memory module
|
||||
|
||||
2006-01-09 : 1.2
|
||||
nekoc:
|
||||
added linker : provide linked versions of neko & nekoml compilers
|
||||
added tail calls optimization
|
||||
nekoml:
|
||||
little improved nekoml->neko patterns generator
|
||||
libs:
|
||||
added md5 digest , utf8 api and base_encode/base_decode in std
|
||||
some changes in mod_neko api
|
||||
mysql api now threat tinyint(1) as booleans
|
||||
improved xml parser : support for doctype
|
||||
some fixes for OSX and C++ compilation
|
||||
neko:
|
||||
renamed 'nekovm' to 'neko'
|
||||
experimental jit support
|
||||
object prototypes
|
||||
moved args from builtin ($args) to loader ($loader.args)
|
||||
makeboot can create standalone binaries
|
||||
runtime errors on :
|
||||
- calls with invalid number of arguments
|
||||
- field accesses of not-an-object
|
||||
- binary operations on invalid types
|
||||
- array accesses on not-an-array and not-an-object
|
||||
license change : from GPL to LGPL
|
||||
|
||||
2005-11-10 : 1.1
|
||||
vm :
|
||||
ports PPC (big endian) and AMD64
|
||||
added stack conservation check at bytecode loadtime : faster VM runtime
|
||||
some more opcodes for better speed
|
||||
added exception and call stack traces
|
||||
added debug informations for bytecode
|
||||
added dispatch tables (for integer switchs)
|
||||
tuned GC usage
|
||||
reorganized VM apis
|
||||
neko:
|
||||
added labels in the language specification
|
||||
added $goto and $apply
|
||||
added switchs
|
||||
added documentation generator
|
||||
nekoml:
|
||||
added NekoML
|
||||
bootstrapped the language (no more need for ocaml)
|
||||
libs:
|
||||
rewrote and completed standard library
|
||||
added generated documentation
|
||||
|
||||
2005-08-17 : 1.0
|
||||
compiler in ocaml
|
||||
virtual machine
|
||||
mod_neko
|
||||
some small libraries
|
||||
+1282
File diff suppressed because it is too large
Load Diff
+149
@@ -0,0 +1,149 @@
|
||||

|
||||
|
||||
[](https://travis-ci.org/HaxeFoundation/neko)
|
||||
[](https://ci.appveyor.com/project/HaxeFoundation/neko)
|
||||
|
||||
# Neko Virtual Machine
|
||||
|
||||
See http://nekovm.org/
|
||||
|
||||
## Snapshot Builds
|
||||
|
||||
### Windows
|
||||
|
||||
Compiled binaries can be found in the "artifacts" tab of each [AppVeyor build](https://ci.appveyor.com/project/HaxeFoundation/neko/history).
|
||||
|
||||
### Mac
|
||||
|
||||
Neko snapshot of the latest master branch can be built using [homebrew](http://brew.sh/) in a single command: `brew install neko --HEAD`. It will install required dependencies, build, and install Neko to the system. The binaries can be found at `brew --prefix neko`.
|
||||
|
||||
Use `brew reinstall neko --HEAD` to upgrade in the future.
|
||||
|
||||
### Linux
|
||||
|
||||
Ubuntu users can use the [Haxe Foundation snapshots PPA](https://launchpad.net/~haxe/+archive/ubuntu/snapshots) to install a Neko package built from the latest master branch. To do so, run the commands as follows:
|
||||
```
|
||||
sudo add-apt-repository ppa:haxe/snapshots -y
|
||||
sudo apt-get update
|
||||
sudo apt-get install neko -y
|
||||
```
|
||||
|
||||
Users of other Linux/FreeBSD distributions should build Neko from source. See below for additional instructions.
|
||||
|
||||
## Build instruction
|
||||
|
||||
Neko can be built using CMake (version 3.x is recommended) and one of the C compilers listed as follows:
|
||||
|
||||
* Windows: Visual Studio 2010 / 2013 / 2015 / 2017
|
||||
* Mac: XCode (with its "Command line tools")
|
||||
* Linux: gcc (can be obtained by installing the "build-essential" Debian/Ubuntu package)
|
||||
|
||||
Neko needs to link with various third-party libraries, which are summarized as follows:
|
||||
|
||||
| library / tool | OS | Debian/Ubuntu package |
|
||||
|-----------------------------------------|-------------|-----------------------------------------------------------|
|
||||
| Boehm GC | all | libgc-dev |
|
||||
| OpenSSL | all | libssl-dev |
|
||||
| PCRE | all | libpcre3-dev |
|
||||
| zlib | all | zlib1g-dev |
|
||||
| Apache 2.2 / 2.4, with apr and apr-util | all | apache2-dev |
|
||||
| MariaDB / MySQL (Connector/C) | all | libmariadb-client-lgpl-dev-compat (or libmysqlclient-dev) |
|
||||
| SQLite | all | libsqlite3-dev |
|
||||
| mbed TLS | all | libmbedtls-dev |
|
||||
| GTK+2 | Linux | libgtk2.0-dev |
|
||||
|
||||
On Windows, CMake will automatically download and build the libraries in the build folder during the build process. However, you need to install [Perl](http://www.activestate.com/activeperl) manually because OpenSSL needs it for configuration. On Mac/Linux, you should install the libraries manually to your system before building Neko, or use the `STATIC_DEPS` CMake option, which will be explained in [CMake options](#cmake-options).
|
||||
|
||||
### Building on Mac/Linux
|
||||
|
||||
```shell
|
||||
# make a build directory, and change to it
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
# run cmake
|
||||
cmake ..
|
||||
|
||||
# let's build, the outputs can be located in the "bin" directory
|
||||
make
|
||||
|
||||
# install it if you want
|
||||
# default installation prefix is /usr/local
|
||||
make install
|
||||
```
|
||||
|
||||
### Building on Windows
|
||||
|
||||
Below is the instructions of building Neko in a Visual Studio command prompt.
|
||||
You may use the CMake GUI and Visual Studio to build it instead.
|
||||
|
||||
```shell
|
||||
# make a build directory, and change to it
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
# run cmake specifying the visual studio version you need
|
||||
# Visual Studio 12 2013, Visual Studio 14 2015, Visual Studio 15 2017
|
||||
# you can additionally specify platform via -A switch (x86, x64)
|
||||
cmake -G "Visual Studio 12 2013" ..
|
||||
|
||||
# let's build, the outputs can be located in the "bin" directory
|
||||
msbuild ALL_BUILD.vcxproj /p:Configuration=Release
|
||||
|
||||
# install it if you want
|
||||
# default installation location is C:\HaxeToolkit\neko
|
||||
msbuild INSTALL.vcxproj /p:Configuration=Release
|
||||
```
|
||||
|
||||
### CMake options
|
||||
|
||||
A number of options can be used to customize the build. They can be specified in the CMake GUI, or passed to `cmake` in command line as follows:
|
||||
|
||||
```shell
|
||||
cmake "-Doption=value" ..
|
||||
```
|
||||
|
||||
#### NDLLs
|
||||
|
||||
Settings that allow to exclude libraries and their dependencies from the build; available on all platforms. By default all are `ON`:
|
||||
|
||||
- `WITH_REGEXP` - Build Perl-compatible regex support
|
||||
- `WITH_UI` - Build GTK-2 UI support
|
||||
- `WITH_SSL` - Build SSL support
|
||||
- `WITH_MYSQL` - Build MySQL support
|
||||
- `WITH_SQLITE` - Build Sqlite support
|
||||
- `WITH_APACHE` - Build Apache modules
|
||||
|
||||
#### `STATIC_DEPS`
|
||||
|
||||
Default value: `all` for Windows, `none` otherwise
|
||||
|
||||
It defines the dependencies that should be linked statically. Can be `all`, `none`, or a list of library names (e.g. `BoehmGC;Zlib;OpenSSL;MariaDBConnector;PCRE;Sqlite3;APR;APRutil;Apache;MbedTLS`).
|
||||
|
||||
CMake will automatically download and build the specified dependencies into the build folder. If a library is not present in this list, it should be installed manually, and it will be linked dynamically.
|
||||
|
||||
All third-party libraries, except GTK+2 (Linux), can be linked statically. We do not support statically linking GTK+2 due to the difficulty of building it and its own dependencies.
|
||||
|
||||
#### `RELOCATABLE`
|
||||
|
||||
Available on Mac/Linux. Default value: `ON`
|
||||
|
||||
Set RPATH to `$ORIGIN` (Linux) / `@executable_path` (Mac). It allows the resulting Neko VM executable to locate libraries (e.g. "libneko" and ndll files) in its local directory, such that the libraries need not be installed to "/usr/lib" or "/usr/local/lib".
|
||||
|
||||
#### `NEKO_JIT_DISABLE`
|
||||
|
||||
Default `OFF`.
|
||||
|
||||
Disable Neko JIT. By default, Neko JIT will be enabled for platforms it supports. Setting this to `ON` disable JIT for all platforms.
|
||||
|
||||
#### `NEKO_JIT_DEBUG`
|
||||
|
||||
Default `OFF`.
|
||||
|
||||
Debug Neko JIT.
|
||||
|
||||
#### `RUN_LDCONFIG`
|
||||
|
||||
Available on Linux. Default value: `ON`
|
||||
|
||||
Whether to run `ldconfig` automatically after `make install`. It is for refreshing the shared library cache such that "libneko" can be located correctly by the Neko VM.
|
||||
+481
@@ -0,0 +1,481 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#ifndef _NEKO_H
|
||||
#define _NEKO_H
|
||||
|
||||
// OS FLAGS
|
||||
#if defined(_WIN32)
|
||||
# define NEKO_WINDOWS
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__) || defined(macintosh)
|
||||
# define NEKO_MAC
|
||||
#endif
|
||||
|
||||
#if defined(linux) || defined(__linux__)
|
||||
# define NEKO_LINUX
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD_kernel__)
|
||||
# define NEKO_GNUKBSD
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
# define NEKO_BSD
|
||||
#endif
|
||||
|
||||
#if defined(__GNU__)
|
||||
# define NEKO_HURD
|
||||
#endif
|
||||
|
||||
// COMPILER/PROCESSOR FLAGS
|
||||
#if defined(__GNUC__)
|
||||
# define NEKO_GCC
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# define NEKO_VCC
|
||||
// remove deprecated C API usage warnings
|
||||
# pragma warning( disable : 4996 )
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
# define NEKO_MINGW
|
||||
#endif
|
||||
|
||||
#if defined(__CYGWIN__)
|
||||
# define NEKO_CYGWIN
|
||||
#endif
|
||||
|
||||
#if defined(__i386__) || defined(_WIN32)
|
||||
# define NEKO_X86
|
||||
#endif
|
||||
|
||||
#if defined(__ppc__)
|
||||
# define NEKO_PPC
|
||||
#endif
|
||||
|
||||
#if defined(_64BITS) || defined(__x86_64__)
|
||||
# define NEKO_64BITS
|
||||
#endif
|
||||
|
||||
#if defined(NEKO_LINUX) || defined(NEKO_MAC) || defined(NEKO_BSD) || defined(NEKO_GNUKBSD) || defined(NEKO_HURD) || defined(NEKO_CYGWIN)
|
||||
# define NEKO_POSIX
|
||||
#endif
|
||||
|
||||
#if defined(NEKO_GCC)
|
||||
# define NEKO_THREADED
|
||||
# define NEKO_DIRECT_THREADED
|
||||
#endif
|
||||
|
||||
#ifndef NEKO_NO_THREADS
|
||||
# define NEKO_THREADS
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#ifndef NEKO_VCC
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
#define NEKO_XLOCALE_H
|
||||
|
||||
/* #undef NEKO_BIG_ENDIAN */
|
||||
|
||||
#ifndef NEKO_BIG_ENDIAN
|
||||
# define NEKO_LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
/* #undef NEKO_JIT_DISABLE */
|
||||
/* #undef NEKO_JIT_DEBUG */
|
||||
|
||||
#if !defined(NEKO_JIT_DISABLE) && defined(NEKO_X86) && !defined(NEKO_MAC) && !defined(_WIN64)
|
||||
#define NEKO_JIT_ENABLE
|
||||
#endif
|
||||
|
||||
#define NEKO_VERSION_MAJOR 2
|
||||
#define NEKO_VERSION_MINOR 2
|
||||
#define NEKO_VERSION_PATCH 0
|
||||
#define NEKO_VERSION 220
|
||||
|
||||
#define NEKO_MODULE_PATH "/usr/local/lib/neko"
|
||||
|
||||
typedef intptr_t int_val;
|
||||
|
||||
typedef enum {
|
||||
VAL_INT = 0xFF,
|
||||
VAL_NULL = 0,
|
||||
VAL_FLOAT = 1,
|
||||
VAL_BOOL = 2,
|
||||
VAL_STRING = 3,
|
||||
VAL_OBJECT = 4,
|
||||
VAL_ARRAY = 5,
|
||||
VAL_FUNCTION = 6,
|
||||
VAL_ABSTRACT = 7,
|
||||
VAL_INT32 = 8,
|
||||
VAL_PRIMITIVE = 6 | 16,
|
||||
VAL_JITFUN = 6 | 32,
|
||||
VAL_32_BITS = 0xFFFFFFFF
|
||||
} val_type;
|
||||
|
||||
struct _value {
|
||||
val_type t;
|
||||
};
|
||||
|
||||
struct _buffer;
|
||||
typedef int field;
|
||||
typedef struct { int __zero; } *vkind;
|
||||
typedef struct _value *value;
|
||||
|
||||
typedef struct {
|
||||
field id;
|
||||
value v;
|
||||
} objcell;
|
||||
|
||||
typedef struct _objtable
|
||||
{
|
||||
int count;
|
||||
objcell *cells;
|
||||
} objtable;
|
||||
|
||||
typedef struct _buffer *buffer;
|
||||
typedef double tfloat;
|
||||
|
||||
typedef void (*finalizer)(value v);
|
||||
|
||||
#pragma pack(4)
|
||||
typedef struct {
|
||||
val_type t;
|
||||
tfloat f;
|
||||
} vfloat;
|
||||
|
||||
typedef struct {
|
||||
val_type t;
|
||||
int i;
|
||||
} vint32;
|
||||
#pragma pack()
|
||||
|
||||
typedef struct _vobject {
|
||||
val_type t;
|
||||
objtable table;
|
||||
struct _vobject *proto;
|
||||
} vobject;
|
||||
|
||||
typedef struct {
|
||||
val_type t;
|
||||
int nargs;
|
||||
void *addr;
|
||||
value env;
|
||||
void *module;
|
||||
} vfunction;
|
||||
|
||||
typedef struct {
|
||||
val_type t;
|
||||
char c;
|
||||
} vstring;
|
||||
|
||||
typedef struct {
|
||||
val_type t;
|
||||
value ptr;
|
||||
} varray;
|
||||
|
||||
typedef struct {
|
||||
val_type t;
|
||||
vkind kind;
|
||||
void *data;
|
||||
} vabstract;
|
||||
|
||||
typedef struct hcell {
|
||||
int hkey;
|
||||
value key;
|
||||
value val;
|
||||
struct hcell *next;
|
||||
} hcell;
|
||||
|
||||
typedef struct {
|
||||
hcell **cells;
|
||||
int ncells;
|
||||
int nitems;
|
||||
} vhash;
|
||||
|
||||
struct _mt_local;
|
||||
struct _mt_lock;
|
||||
typedef struct _mt_local mt_local;
|
||||
typedef struct _mt_lock mt_lock;
|
||||
|
||||
#define NEKO_TAG_BITS 4
|
||||
|
||||
#define val_tag(v) (*(val_type*)(v))
|
||||
#define val_short_tag(v) (val_tag(v)&((1<<NEKO_TAG_BITS) - 1))
|
||||
#define val_is_null(v) ((v) == val_null)
|
||||
#define val_is_int(v) ((((int)(int_val)(v)) & 1) != 0)
|
||||
#define val_is_any_int(v) (val_is_int(v) || val_tag(v) == VAL_INT32)
|
||||
#define val_is_bool(v) ((v) == val_true || (v) == val_false)
|
||||
#define val_is_number(v) (val_is_int(v) || val_tag(v) == VAL_FLOAT || val_tag(v) == VAL_INT32)
|
||||
#define val_is_float(v) (!val_is_int(v) && val_tag(v) == VAL_FLOAT)
|
||||
#define val_is_int32(v) (!val_is_int(v) && val_tag(v) == VAL_INT32)
|
||||
#define val_is_string(v) (!val_is_int(v) && val_short_tag(v) == VAL_STRING)
|
||||
#define val_is_function(v) (!val_is_int(v) && val_short_tag(v) == VAL_FUNCTION)
|
||||
#define val_is_object(v) (!val_is_int(v) && val_tag(v) == VAL_OBJECT)
|
||||
#define val_is_array(v) (!val_is_int(v) && val_short_tag(v) == VAL_ARRAY)
|
||||
#define val_is_abstract(v) (!val_is_int(v) && val_tag(v) == VAL_ABSTRACT)
|
||||
#define val_is_kind(v,t) (val_is_abstract(v) && val_kind(v) == (t))
|
||||
#define val_check_kind(v,t) if( !val_is_kind(v,t) ) neko_error();
|
||||
#define val_check_function(f,n) if( !val_is_function(f) || (val_fun_nargs(f) != (n) && val_fun_nargs(f) != VAR_ARGS) ) neko_error();
|
||||
#define val_check(v,t) if( !val_is_##t(v) ) neko_error();
|
||||
#define val_data(v) ((vabstract*)(v))->data
|
||||
#define val_kind(v) ((vabstract*)(v))->kind
|
||||
|
||||
#define val_type(v) (val_is_int(v) ? VAL_INT : val_short_tag(v))
|
||||
#define val_int(v) (((int)(int_val)(v)) >> 1)
|
||||
#define val_float(v) (CONV_FLOAT ((vfloat*)(v))->f)
|
||||
#define val_int32(v) (((vint32*)(v))->i)
|
||||
#define val_any_int(v) (val_is_int(v)?val_int(v):val_int32(v))
|
||||
#define val_bool(v) ((v) == val_true)
|
||||
#define val_number(v) (val_is_int(v)?val_int(v):((val_tag(v)==VAL_FLOAT)?val_float(v):val_int32(v)))
|
||||
#define val_hdata(v) ((vhash*)val_data(v))
|
||||
#define val_string(v) (&((vstring*)(v))->c)
|
||||
#define val_strlen(v) ((signed)(((unsigned)val_tag(v)) >> NEKO_TAG_BITS))
|
||||
#define val_set_length(v,l) val_tag(v) = val_short_tag(v) | ((l) << NEKO_TAG_BITS)
|
||||
#define val_set_size val_set_length
|
||||
|
||||
#define val_array_size(v) ((signed)(((unsigned)val_tag(v)) >> NEKO_TAG_BITS))
|
||||
#define val_array_ptr(v) (&((varray*)(v))->ptr)
|
||||
#define val_fun_nargs(v) ((vfunction*)(v))->nargs
|
||||
#define alloc_int(v) ((value)(int_val)((((int)(v)) << 1) | 1))
|
||||
#define alloc_bool(b) ((b)?val_true:val_false)
|
||||
|
||||
#define max_array_size ((1 << (32 - NEKO_TAG_BITS)) - 1)
|
||||
#define max_string_size ((1 << (32 - NEKO_TAG_BITS)) - 1)
|
||||
#define invalid_comparison 0xFE
|
||||
|
||||
#undef EXTERN
|
||||
#undef EXPORT
|
||||
#undef IMPORT
|
||||
#if defined(NEKO_VCC) || defined(NEKO_MINGW)
|
||||
# define INLINE __inline
|
||||
# define EXPORT __declspec( dllexport )
|
||||
# define IMPORT __declspec( dllimport )
|
||||
#else
|
||||
# define INLINE inline
|
||||
# define EXPORT
|
||||
# define IMPORT
|
||||
#endif
|
||||
|
||||
#if defined(NEKO_SOURCES) || defined(NEKO_STANDALONE)
|
||||
# define EXTERN EXPORT
|
||||
#else
|
||||
# define EXTERN IMPORT
|
||||
#endif
|
||||
|
||||
#define VEXTERN extern EXTERN
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define C_FUNCTION_BEGIN extern "C" {
|
||||
# define C_FUNCTION_END };
|
||||
#else
|
||||
# define C_FUNCTION_BEGIN
|
||||
# define C_FUNCTION_END
|
||||
# ifndef true
|
||||
# define true 1
|
||||
# define false 0
|
||||
typedef int bool;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// the two upper bits must be either 00 or 11
|
||||
#define need_32_bits(i) ( (((unsigned int)(i)) + 0x40000000) & 0x80000000 )
|
||||
#define alloc_best_int(i) (need_32_bits(i) ? alloc_int32(i) : alloc_int(i))
|
||||
|
||||
#define neko_error() return NULL
|
||||
#define failure(msg) _neko_failure(alloc_string(msg),__FILE__,__LINE__)
|
||||
#define bfailure(buf) _neko_failure(buffer_to_string(buf),__FILE__,__LINE__)
|
||||
|
||||
#ifndef CONV_FLOAT
|
||||
# define CONV_FLOAT
|
||||
#endif
|
||||
|
||||
#ifdef NEKO_POSIX
|
||||
# include <errno.h>
|
||||
# define POSIX_LABEL(name) name:
|
||||
# define HANDLE_EINTR(label) if( errno == EINTR ) goto label
|
||||
# define HANDLE_FINTR(f,label) if( ferror(f) && errno == EINTR ) goto label
|
||||
#else
|
||||
# define POSIX_LABEL(name)
|
||||
# define HANDLE_EINTR(label)
|
||||
# define HANDLE_FINTR(f,label)
|
||||
#endif
|
||||
|
||||
#define VAR_ARGS (-1)
|
||||
#define DEFINE_PRIM_MULT(func) C_FUNCTION_BEGIN EXPORT void *func##__MULT() { return (void*)(&func); } C_FUNCTION_END
|
||||
#define DEFINE_PRIM(func,nargs) C_FUNCTION_BEGIN EXPORT void *func##__##nargs() { return (void*)(&func); } C_FUNCTION_END
|
||||
#define DEFINE_PRIM_WITH_NAME(func,name,nargs) C_FUNCTION_BEGIN EXPORT void *name##__##nargs() { return (void*)(&func); } C_FUNCTION_END
|
||||
#define DEFINE_KIND(name) int_val __kind_##name = 0; vkind name = (vkind)&__kind_##name;
|
||||
|
||||
#ifdef NEKO_STANDALONE
|
||||
# define DEFINE_ENTRY_POINT(name)
|
||||
#else
|
||||
# define DEFINE_ENTRY_POINT(name) C_FUNCTION_BEGIN void name(); EXPORT void *__neko_entry_point() { return &name; } C_FUNCTION_END
|
||||
#endif
|
||||
|
||||
#ifdef HEADER_IMPORTS
|
||||
# define H_EXTERN IMPORT
|
||||
#else
|
||||
# define H_EXTERN EXPORT
|
||||
#endif
|
||||
|
||||
#define DECLARE_PRIM(func,nargs) C_FUNCTION_BEGIN H_EXTERN void *func##__##nargs(); C_FUNCTION_END
|
||||
#define DECLARE_KIND(name) C_FUNCTION_BEGIN H_EXTERN extern vkind name; C_FUNCTION_END
|
||||
|
||||
#define alloc_int32 neko_alloc_int32
|
||||
#define alloc_float neko_alloc_float
|
||||
#define alloc_string neko_alloc_string
|
||||
#define alloc_empty_string neko_alloc_empty_string
|
||||
#define copy_string neko_copy_string
|
||||
#define val_this neko_val_this
|
||||
#define val_id neko_val_id
|
||||
#define val_field neko_val_field
|
||||
#define alloc_object neko_alloc_object
|
||||
#define alloc_field neko_alloc_field
|
||||
#define alloc_array neko_alloc_array
|
||||
#define val_call0 neko_val_call0
|
||||
#define val_call1 neko_val_call1
|
||||
#define val_call2 neko_val_call2
|
||||
#define val_call3 neko_val_call3
|
||||
#define val_callN neko_val_callN
|
||||
#define val_ocall0 neko_val_ocall0
|
||||
#define val_ocall1 neko_val_ocall1
|
||||
#define val_ocall2 neko_val_ocall2
|
||||
#define val_ocallN neko_val_ocallN
|
||||
#define val_callEx neko_val_callEx
|
||||
#define alloc_root neko_alloc_root
|
||||
#define free_root neko_free_root
|
||||
#define alloc neko_alloc
|
||||
#define alloc_private neko_alloc_private
|
||||
#define alloc_abstract neko_alloc_abstract
|
||||
#define alloc_function neko_alloc_function
|
||||
#define alloc_buffer neko_alloc_buffer
|
||||
#define buffer_append neko_buffer_append
|
||||
#define buffer_append_sub neko_buffer_append_sub
|
||||
#define buffer_append_char neko_buffer_append_char
|
||||
#define buffer_length neko_buffer_length
|
||||
#define buffer_to_string neko_buffer_to_string
|
||||
#define val_buffer neko_val_buffer
|
||||
#define val_compare neko_val_compare
|
||||
#define val_print neko_val_print
|
||||
#define val_gc neko_val_gc
|
||||
#define val_throw neko_val_throw
|
||||
#define val_rethrow neko_val_rethrow
|
||||
#define val_iter_fields neko_val_iter_fields
|
||||
#define val_field_name neko_val_field_name
|
||||
#define val_hash neko_val_hash
|
||||
#define k_hash neko_k_hash
|
||||
#define kind_share neko_kind_share
|
||||
#define kind_lookup neko_kind_lookup
|
||||
|
||||
#define alloc_local neko_alloc_local
|
||||
#define local_get neko_local_get
|
||||
#define local_set neko_local_set
|
||||
#define free_local neko_free_local
|
||||
#define alloc_lock neko_alloc_lock
|
||||
#define lock_acquire neko_lock_acquire
|
||||
#define lock_try neko_lock_try
|
||||
#define lock_release neko_lock_release
|
||||
#define free_lock neko_free_lock
|
||||
|
||||
C_FUNCTION_BEGIN
|
||||
|
||||
VEXTERN vkind k_hash;
|
||||
|
||||
VEXTERN value val_null;
|
||||
VEXTERN value val_true;
|
||||
VEXTERN value val_false;
|
||||
|
||||
EXTERN value alloc_float( tfloat t );
|
||||
EXTERN value alloc_int32( int i );
|
||||
|
||||
EXTERN value alloc_string( const char *str );
|
||||
EXTERN value alloc_empty_string( unsigned int size );
|
||||
EXTERN value copy_string( const char *str, int_val size );
|
||||
|
||||
EXTERN value val_this();
|
||||
EXTERN field val_id( const char *str );
|
||||
EXTERN value val_field( value o, field f );
|
||||
EXTERN value alloc_object( value o );
|
||||
EXTERN void alloc_field( value obj, field f, value v );
|
||||
EXTERN void val_iter_fields( value obj, void f( value v, field f, void * ), void *p );
|
||||
EXTERN value val_field_name( field f );
|
||||
|
||||
EXTERN value alloc_array( unsigned int n );
|
||||
EXTERN value alloc_abstract( vkind k, void *data );
|
||||
|
||||
EXTERN value val_call0( value f );
|
||||
EXTERN value val_call1( value f, value arg );
|
||||
EXTERN value val_call2( value f, value arg1, value arg2 );
|
||||
EXTERN value val_call3( value f, value arg1, value arg2, value arg3 );
|
||||
EXTERN value val_callN( value f, value *args, int nargs );
|
||||
EXTERN value val_ocall0( value o, field f );
|
||||
EXTERN value val_ocall1( value o, field f, value arg );
|
||||
EXTERN value val_ocall2( value o, field f, value arg1, value arg2 );
|
||||
EXTERN value val_ocallN( value o, field f, value *args, int nargs );
|
||||
EXTERN value val_callEx( value vthis, value f, value *args, int nargs, value *exc );
|
||||
|
||||
EXTERN value *alloc_root( unsigned int nvals );
|
||||
EXTERN void free_root( value *r );
|
||||
EXTERN char *alloc( unsigned int nbytes );
|
||||
EXTERN char *alloc_private( unsigned int nbytes );
|
||||
EXTERN value alloc_function( void *c_prim, unsigned int nargs, const char *name );
|
||||
|
||||
EXTERN buffer alloc_buffer( const char *init );
|
||||
EXTERN void buffer_append( buffer b, const char *s );
|
||||
EXTERN void buffer_append_sub( buffer b, const char *s, int_val len );
|
||||
EXTERN void buffer_append_char( buffer b, char c );
|
||||
EXTERN value buffer_to_string( buffer b );
|
||||
EXTERN int buffer_length( buffer b );
|
||||
EXTERN void val_buffer( buffer b, value v );
|
||||
|
||||
EXTERN int val_compare( value a, value b );
|
||||
EXTERN void val_print( value s );
|
||||
EXTERN void val_gc( value v, finalizer f );
|
||||
EXTERN void val_throw( value v );
|
||||
EXTERN void val_rethrow( value v );
|
||||
EXTERN int val_hash( value v );
|
||||
|
||||
EXTERN void kind_share( vkind *k, const char *name );
|
||||
EXTERN vkind kind_lookup( const char *name );
|
||||
EXTERN void _neko_failure( value msg, const char *file, int line );
|
||||
|
||||
// MULTITHREADING API
|
||||
EXTERN mt_local *alloc_local();
|
||||
EXTERN void *local_get( mt_local *l );
|
||||
EXTERN void local_set( mt_local *l, void *v );
|
||||
EXTERN void free_local( mt_local *l );
|
||||
|
||||
EXTERN mt_lock *alloc_lock();
|
||||
EXTERN void lock_acquire( mt_lock *l );
|
||||
EXTERN int lock_try( mt_lock *l );
|
||||
EXTERN void lock_release( mt_lock *l );
|
||||
EXTERN void free_lock( mt_lock *l );
|
||||
|
||||
C_FUNCTION_END
|
||||
|
||||
#endif
|
||||
/* ************************************************************************ */
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (C)2016-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#ifndef _NEKO_ELF_H
|
||||
#define _NEKO_ELF_H
|
||||
#include "neko.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#ifdef ABI_ELF
|
||||
# define SEPARATE_SECTION_FOR_BYTECODE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* None of this is needed on non-ELF platforms... */
|
||||
#ifdef SEPARATE_SECTION_FOR_BYTECODE
|
||||
|
||||
#include <stdio.h>
|
||||
#include <elf.h>
|
||||
|
||||
#define elf_get_Ehdr(p,f) (elf_is_32() ? ((Elf32_Ehdr*)p)->f : ((Elf64_Ehdr*)p)->f)
|
||||
#define elf_get_Shdr(p,f) (elf_is_32() ? ((Elf32_Shdr*)p)->f : ((Elf64_Shdr*)p)->f)
|
||||
|
||||
#define elf_set_Ehdr(p,f,v) { if (elf_is_32()) ((Elf32_Ehdr*)p)->f = v; else ((Elf64_Ehdr*)p)->f = v; }
|
||||
#define elf_set_Shdr(p,f,v) { if (elf_is_32()) ((Elf32_Shdr*)p)->f = v; else ((Elf64_Shdr*)p)->f = v; }
|
||||
|
||||
C_FUNCTION_BEGIN
|
||||
|
||||
VEXTERN int size_Ehdr; /* Big enough to hold Elf32_Ehdr or Elf64_Ehdr... */
|
||||
VEXTERN int size_Shdr; /* Big enough to hold Elf32_Shdr or Elf64_Shdr... */
|
||||
|
||||
EXTERN value elf_read_header(FILE *exe);
|
||||
EXTERN int elf_is_32();
|
||||
EXTERN value elf_read_section(FILE *exe, int sec, char *buf);
|
||||
EXTERN value elf_write_section(FILE *exe, int sec, char *buf);
|
||||
EXTERN int elf_find_bytecode_section(FILE *exe);
|
||||
EXTERN void elf_free_section_string_table();
|
||||
EXTERN value elf_find_embedded_bytecode(const char *file, int *beg, int *end);
|
||||
EXTERN int elf_find_bytecode_section(FILE *exe);
|
||||
|
||||
C_FUNCTION_END
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* ************************************************************************ */
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#ifndef _NEKO_MOD_H
|
||||
#define _NEKO_MOD_H
|
||||
#include "neko.h"
|
||||
|
||||
typedef struct _neko_debug {
|
||||
int base;
|
||||
unsigned int bits;
|
||||
} neko_debug;
|
||||
|
||||
typedef struct _neko_module {
|
||||
void *jit;
|
||||
unsigned int nglobals;
|
||||
unsigned int nfields;
|
||||
unsigned int codesize;
|
||||
value name;
|
||||
value *globals;
|
||||
value *fields;
|
||||
value loader;
|
||||
value exports;
|
||||
value dbgtbl;
|
||||
neko_debug *dbgidxs;
|
||||
int_val *code;
|
||||
value jit_gc;
|
||||
} neko_module;
|
||||
|
||||
typedef void *readp;
|
||||
typedef int (*reader)( readp p, void *buf, int size );
|
||||
|
||||
typedef struct {
|
||||
char *p;
|
||||
int len;
|
||||
} string_pos;
|
||||
|
||||
C_FUNCTION_BEGIN
|
||||
|
||||
VEXTERN field neko_id_module;
|
||||
VEXTERN vkind neko_kind_module;
|
||||
EXTERN neko_module *neko_read_module( reader r, readp p, value loader );
|
||||
EXTERN int neko_file_reader( readp p, void *buf, int size ); // FILE *
|
||||
EXTERN int neko_string_reader( readp p, void *buf, int size ); // string_pos *
|
||||
EXTERN value neko_select_file( value path, const char *file, const char *ext );
|
||||
|
||||
C_FUNCTION_END
|
||||
|
||||
#endif
|
||||
/* ************************************************************************ */
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (C)2005-2017 Haxe Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#ifndef _NEKO_VM_H
|
||||
#define _NEKO_VM_H
|
||||
#include "neko.h"
|
||||
|
||||
typedef void (*neko_printer)( const char *data, int size, void *param );
|
||||
typedef void (*thread_main_func)( void *param );
|
||||
|
||||
typedef struct _neko_vm neko_vm;
|
||||
|
||||
typedef void (*neko_stat_func)( neko_vm *vm, const char *kind, int start );
|
||||
|
||||
C_FUNCTION_BEGIN
|
||||
|
||||
EXTERN void neko_global_init();
|
||||
EXTERN void neko_global_free();
|
||||
EXTERN void neko_gc_major();
|
||||
EXTERN void neko_gc_loop();
|
||||
EXTERN void neko_gc_stats( int *heap, int *free );
|
||||
EXTERN int neko_thread_create( thread_main_func init, thread_main_func main, void *param, void **handle );
|
||||
EXTERN void neko_thread_blocking( thread_main_func f, void *p );
|
||||
EXTERN bool neko_thread_register( bool t );
|
||||
|
||||
EXTERN neko_vm *neko_vm_alloc( void *unused );
|
||||
EXTERN neko_vm *neko_vm_current();
|
||||
EXTERN value neko_exc_stack( neko_vm *vm );
|
||||
EXTERN value neko_call_stack( neko_vm *vm );
|
||||
EXTERN void *neko_vm_custom( neko_vm *vm, vkind k );
|
||||
EXTERN void neko_vm_set_custom( neko_vm *vm, vkind k, void *v );
|
||||
EXTERN value neko_vm_execute( neko_vm *vm, void *module );
|
||||
EXTERN void neko_vm_select( neko_vm *vm );
|
||||
EXTERN int neko_vm_jit( neko_vm *vm, int enable_jit );
|
||||
EXTERN int neko_vm_trusted( neko_vm *vm, int trusted );
|
||||
EXTERN value neko_default_loader( char **argv, int argc );
|
||||
EXTERN void neko_vm_redirect( neko_vm *vm, neko_printer print, void *param );
|
||||
EXTERN void neko_vm_set_stats( neko_vm *vm, neko_stat_func fstats, neko_stat_func pstats );
|
||||
EXTERN void neko_vm_dump_stack( neko_vm *vm );
|
||||
|
||||
EXTERN int neko_is_big_endian();
|
||||
|
||||
C_FUNCTION_END
|
||||
|
||||
#endif
|
||||
/* ************************************************************************ */
|
||||
+1
@@ -0,0 +1 @@
|
||||
libneko.so.2
|
||||
+1
@@ -0,0 +1 @@
|
||||
libneko.so.2.2.0
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user