script_core 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/ext/enterprise_script_service/libseccomp/.travis.yml +3 -5
- data/ext/enterprise_script_service/libseccomp/CHANGELOG +10 -0
- data/ext/enterprise_script_service/libseccomp/CREDITS +3 -0
- data/ext/enterprise_script_service/libseccomp/README.md +18 -0
- data/ext/enterprise_script_service/libseccomp/configure.ac +1 -1
- data/ext/enterprise_script_service/libseccomp/include/seccomp-syscalls.h +7 -0
- data/ext/enterprise_script_service/libseccomp/src/arch-s390-syscalls.c +16 -0
- data/ext/enterprise_script_service/libseccomp/src/arch-s390x-syscalls.c +16 -0
- data/ext/enterprise_script_service/libseccomp/tests/.gitignore +1 -0
- data/ext/enterprise_script_service/libseccomp/tests/15-basic-resolver.c +3 -3
- data/ext/enterprise_script_service/libseccomp/tests/52-basic-load.c +48 -0
- data/ext/enterprise_script_service/libseccomp/tests/52-basic-load.py +38 -0
- data/ext/enterprise_script_service/libseccomp/tests/52-basic-load.tests +11 -0
- data/ext/enterprise_script_service/libseccomp/tests/Makefile.am +6 -3
- data/ext/enterprise_script_service/libseccomp/tests/regression +4 -0
- data/ext/enterprise_script_service/libseccomp/tools/Makefile.am +0 -3
- data/ext/enterprise_script_service/libseccomp/tools/scmp_bpf_sim.c +2 -0
- data/ext/enterprise_script_service/mruby/.github/workflows/build.yml +106 -0
- data/ext/enterprise_script_service/mruby/.github/workflows/main.yml +24 -0
- data/ext/enterprise_script_service/mruby/.gitignore +3 -0
- data/ext/enterprise_script_service/mruby/.travis.yml +6 -9
- data/ext/enterprise_script_service/mruby/AUTHORS +1 -0
- data/ext/enterprise_script_service/mruby/Doxyfile +1 -1
- data/ext/enterprise_script_service/mruby/LICENSE +1 -1
- data/ext/enterprise_script_service/mruby/README.md +6 -2
- data/ext/enterprise_script_service/mruby/appveyor.yml +9 -12
- data/ext/enterprise_script_service/mruby/appveyor_config.rb +9 -0
- data/ext/enterprise_script_service/mruby/build_config.rb +6 -6
- data/ext/enterprise_script_service/mruby/doc/guides/compile.md +6 -2
- data/ext/enterprise_script_service/mruby/doc/guides/debugger.md +1 -1
- data/ext/enterprise_script_service/mruby/doc/guides/mrbconf.md +4 -8
- data/ext/enterprise_script_service/mruby/doc/limitations.md +10 -10
- data/ext/enterprise_script_service/mruby/doc/opcode.md +108 -95
- data/ext/enterprise_script_service/mruby/examples/targets/build_config_ArduinoDue.rb +2 -2
- data/ext/enterprise_script_service/mruby/examples/targets/build_config_IntelEdison.rb +2 -2
- data/ext/enterprise_script_service/mruby/examples/targets/build_config_IntelGalileo.rb +2 -2
- data/ext/enterprise_script_service/mruby/examples/targets/build_config_RX630.rb +2 -2
- data/ext/enterprise_script_service/mruby/examples/targets/build_config_chipKITMax32.rb +2 -2
- data/ext/enterprise_script_service/mruby/examples/targets/build_config_dreamcast_shelf.rb +108 -0
- data/ext/enterprise_script_service/mruby/include/mrbconf.h +10 -7
- data/ext/enterprise_script_service/mruby/include/mruby.h +11 -9
- data/ext/enterprise_script_service/mruby/include/mruby/array.h +4 -0
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_nan.h +11 -2
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_word.h +0 -9
- data/ext/enterprise_script_service/mruby/include/mruby/common.h +10 -0
- data/ext/enterprise_script_service/mruby/include/mruby/compile.h +11 -3
- data/ext/enterprise_script_service/mruby/include/mruby/dump.h +1 -17
- data/ext/enterprise_script_service/mruby/include/mruby/irep.h +10 -0
- data/ext/enterprise_script_service/mruby/include/mruby/istruct.h +4 -1
- data/ext/enterprise_script_service/mruby/include/mruby/khash.h +23 -5
- data/ext/enterprise_script_service/mruby/include/mruby/numeric.h +1 -0
- data/ext/enterprise_script_service/mruby/include/mruby/ops.h +3 -2
- data/ext/enterprise_script_service/mruby/include/mruby/string.h +2 -1
- data/ext/enterprise_script_service/mruby/include/mruby/value.h +7 -12
- data/ext/enterprise_script_service/mruby/include/mruby/version.h +4 -4
- data/ext/enterprise_script_service/mruby/lib/mruby/build.rb +2 -30
- data/ext/enterprise_script_service/mruby/lib/mruby/build/command.rb +21 -46
- data/ext/enterprise_script_service/mruby/lib/mruby/gem.rb +9 -0
- data/ext/enterprise_script_service/mruby/lib/mruby/source.rb +3 -1
- data/ext/enterprise_script_service/mruby/mrbgems/default.gembox +7 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +0 -31
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/test/array.rb +0 -13
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-config/mrbgem.rake +5 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h +5 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +5 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c +7 -11
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/mrbgem.rake +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +6 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c +6 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-class-ext/src/class.c +6 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/codegen.c +76 -48
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/parse.y +107 -32
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/y.tab.c +13153 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/mrbgem.rake +13 -15
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-error/src/exception.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/src/eval.c +2 -213
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/test/eval.rb +21 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/src/hash-ext.c +1 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/include/mruby/ext/io.h +39 -7
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrbgem.rake +2 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/file_constants.rb +0 -16
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/io.rb +7 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file.c +76 -30
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file_test.c +9 -10
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/io.c +323 -120
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file.rb +18 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/io.rb +32 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/mruby_io_test.c +57 -49
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/src/metaprog.c +15 -17
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/test/metaprog.rb +9 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/src/method.c +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/src/object.c +3 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/src/pack.c +113 -10
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-print/src/print.c +5 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/src/proc.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/src/rational.c +9 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/src/mrb_sleep.c +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/mrbgem.rake +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/test/sockettest.c +3 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/sprintf.c +61 -24
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/test/sprintf.rb +5 -23
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/src/string.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/mrbgem.rake +1 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/src/time.c +6 -5
- data/ext/enterprise_script_service/mruby/mrblib/hash.rb +3 -3
- data/ext/enterprise_script_service/mruby/src/array.c +11 -0
- data/ext/enterprise_script_service/mruby/src/backtrace.c +2 -2
- data/ext/enterprise_script_service/mruby/src/class.c +26 -11
- data/ext/enterprise_script_service/mruby/src/codedump.c +4 -0
- data/ext/enterprise_script_service/mruby/src/debug.c +8 -5
- data/ext/enterprise_script_service/mruby/src/dump.c +3 -65
- data/ext/enterprise_script_service/mruby/src/error.c +57 -5
- data/ext/enterprise_script_service/mruby/src/etc.c +13 -4
- data/ext/enterprise_script_service/mruby/src/fmt_fp.c +98 -21
- data/ext/enterprise_script_service/mruby/src/gc.c +10 -275
- data/ext/enterprise_script_service/mruby/src/hash.c +5 -6
- data/ext/enterprise_script_service/mruby/src/kernel.c +2 -2
- data/ext/enterprise_script_service/mruby/src/load.c +56 -30
- data/ext/enterprise_script_service/mruby/src/numeric.c +22 -10
- data/ext/enterprise_script_service/mruby/src/object.c +12 -4
- data/ext/enterprise_script_service/mruby/src/print.c +27 -3
- data/ext/enterprise_script_service/mruby/src/proc.c +21 -1
- data/ext/enterprise_script_service/mruby/src/state.c +34 -11
- data/ext/enterprise_script_service/mruby/src/string.c +69 -35
- data/ext/enterprise_script_service/mruby/src/symbol.c +12 -10
- data/ext/enterprise_script_service/mruby/src/vm.c +21 -30
- data/ext/enterprise_script_service/mruby/tasks/gitlab.rake +19 -22
- data/ext/enterprise_script_service/mruby/tasks/mrbgems.rake +1 -1
- data/ext/enterprise_script_service/mruby/tasks/toolchains/android.rake +46 -1
- data/ext/enterprise_script_service/mruby/tasks/toolchains/gcc.rake +3 -3
- data/ext/enterprise_script_service/mruby/tasks/toolchains/openwrt.rake +6 -6
- data/ext/enterprise_script_service/mruby/tasks/toolchains/visualcpp.rake +8 -8
- data/ext/enterprise_script_service/mruby/test/assert.rb +5 -4
- data/ext/enterprise_script_service/mruby/test/t/ensure.rb +8 -26
- data/ext/enterprise_script_service/mruby/test/t/exception.rb +2 -2
- data/ext/enterprise_script_service/mruby/test/t/kernel.rb +8 -24
- data/ext/enterprise_script_service/mruby/travis_config.rb +0 -14
- data/ext/enterprise_script_service/msgpack/.github/depends/boost.sh +56 -0
- data/ext/enterprise_script_service/msgpack/.github/workflows/coverage.yml +62 -0
- data/ext/enterprise_script_service/msgpack/.github/workflows/gha.yml +304 -0
- data/ext/enterprise_script_service/msgpack/CHANGELOG.md +11 -0
- data/ext/enterprise_script_service/msgpack/CMakeLists.txt +82 -39
- data/ext/enterprise_script_service/msgpack/Files.cmake +22 -12
- data/ext/enterprise_script_service/msgpack/QUICKSTART-C.md +26 -29
- data/ext/enterprise_script_service/msgpack/README.md +3 -2
- data/ext/enterprise_script_service/msgpack/appveyor.yml +6 -2
- data/ext/enterprise_script_service/msgpack/ci/build_cmake.sh +3 -1
- data/ext/enterprise_script_service/msgpack/cmake/CodeCoverage.cmake +55 -0
- data/ext/enterprise_script_service/msgpack/codecov.yml +36 -0
- data/ext/enterprise_script_service/msgpack/example/CMakeLists.txt +9 -5
- data/ext/enterprise_script_service/msgpack/example/boost/CMakeLists.txt +1 -1
- data/ext/enterprise_script_service/msgpack/example/c/CMakeLists.txt +17 -6
- data/ext/enterprise_script_service/msgpack/example/c/boundary.c +296 -0
- data/ext/enterprise_script_service/msgpack/example/c/jsonconv.c +419 -0
- data/ext/enterprise_script_service/msgpack/example/c/simple_c.c +1 -1
- data/ext/enterprise_script_service/msgpack/example/cpp03/CMakeLists.txt +3 -3
- data/ext/enterprise_script_service/msgpack/example/cpp11/CMakeLists.txt +2 -2
- data/ext/enterprise_script_service/msgpack/example/x3/CMakeLists.txt +2 -2
- data/ext/enterprise_script_service/msgpack/include/msgpack/pack.h +24 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/array_ref.hpp +5 -4
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/boost/optional.hpp +4 -4
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp17/vector_byte.hpp +8 -8
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/map.hpp +4 -4
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/vector.hpp +4 -4
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/vector_char.hpp +8 -8
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/vector_unsigned_char.hpp +8 -8
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/wstring.hpp +4 -4
- data/ext/enterprise_script_service/msgpack/include/msgpack/v3/unpack.hpp +6 -6
- data/ext/enterprise_script_service/msgpack/include/msgpack/version_master.h +2 -2
- data/ext/enterprise_script_service/msgpack/include/msgpack/zbuffer.h +4 -4
- data/ext/enterprise_script_service/msgpack/make_file_list.sh +38 -11
- data/ext/enterprise_script_service/msgpack/src/vrefbuffer.c +6 -0
- data/ext/enterprise_script_service/msgpack/test/CMakeLists.txt +86 -64
- data/ext/enterprise_script_service/msgpack/test/array_ref.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/boost_fusion.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/boost_optional.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/boost_string_ref.cpp +4 -1
- data/ext/enterprise_script_service/msgpack/test/boost_string_view.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/boost_variant.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/buffer.cpp +4 -47
- data/ext/enterprise_script_service/msgpack/test/buffer_c.cpp +148 -0
- data/ext/enterprise_script_service/msgpack/test/carray.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/cases.cpp +8 -4
- data/ext/enterprise_script_service/msgpack/test/convert.cpp +8 -4
- data/ext/enterprise_script_service/msgpack/test/fixint.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/fixint_c.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/fuzz_unpack_pack_fuzzer_cpp11.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/iterator_cpp11.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/json.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/limit.cpp +8 -4
- data/ext/enterprise_script_service/msgpack/test/msgpack_basic.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_c.cpp +159 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_container.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_cpp11.cpp +32 -27
- data/ext/enterprise_script_service/msgpack/test/msgpack_cpp17.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_stream.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_tuple.cpp +4 -1
- data/ext/enterprise_script_service/msgpack/test/msgpack_vref.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_x3_parse.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/object.cpp +4 -1
- data/ext/enterprise_script_service/msgpack/test/object_with_zone.cpp +12 -8
- data/ext/enterprise_script_service/msgpack/test/pack_unpack.cpp +30 -26
- data/ext/enterprise_script_service/msgpack/test/pack_unpack_c.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/raw.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/reference.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/reference_cpp11.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/reference_wrapper_cpp11.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/shared_ptr_cpp11.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/size_equal_only.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/streaming.cpp +8 -4
- data/ext/enterprise_script_service/msgpack/test/streaming_c.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/unique_ptr_cpp11.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/user_class.cpp +16 -12
- data/ext/enterprise_script_service/msgpack/test/version.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/visitor.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/zone.cpp +4 -0
- data/lib/script_core/version.rb +1 -1
- data/script_core.gemspec +1 -1
- metadata +23 -9
- data/ext/enterprise_script_service/msgpack/.travis.yml +0 -258
@@ -48,14 +48,14 @@ sym_validate_len(mrb_state *mrb, size_t len)
|
|
48
48
|
static const char pack_table[] = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
49
49
|
|
50
50
|
static mrb_sym
|
51
|
-
sym_inline_pack(const char *name,
|
51
|
+
sym_inline_pack(const char *name, size_t len)
|
52
52
|
{
|
53
|
-
const
|
54
|
-
const
|
53
|
+
const size_t lower_length_max = (MRB_SYMBOL_BIT - 2) / 5;
|
54
|
+
const size_t mix_length_max = (MRB_SYMBOL_BIT - 2) / 6;
|
55
55
|
|
56
56
|
char c;
|
57
57
|
const char *p;
|
58
|
-
|
58
|
+
size_t i;
|
59
59
|
mrb_sym sym = 0;
|
60
60
|
mrb_bool lower = TRUE;
|
61
61
|
|
@@ -124,7 +124,7 @@ symhash(const char *key, size_t len)
|
|
124
124
|
}
|
125
125
|
|
126
126
|
static mrb_sym
|
127
|
-
find_symbol(mrb_state *mrb, const char *name,
|
127
|
+
find_symbol(mrb_state *mrb, const char *name, size_t len, uint8_t *hashp)
|
128
128
|
{
|
129
129
|
mrb_sym i;
|
130
130
|
symbol_name *sname;
|
@@ -172,11 +172,13 @@ sym_intern(mrb_state *mrb, const char *name, size_t len, mrb_bool lit)
|
|
172
172
|
if (sym > 0) return sym;
|
173
173
|
|
174
174
|
/* registering a new symbol */
|
175
|
-
sym =
|
175
|
+
sym = mrb->symidx + 1;
|
176
176
|
if (mrb->symcapa < sym) {
|
177
|
-
|
178
|
-
|
179
|
-
|
177
|
+
size_t symcapa = mrb->symcapa;
|
178
|
+
if (symcapa == 0) symcapa = 100;
|
179
|
+
else symcapa = (size_t)(symcapa * 6 / 5);
|
180
|
+
mrb->symtbl = (symbol_name*)mrb_realloc(mrb, mrb->symtbl, sizeof(symbol_name)*(symcapa+1));
|
181
|
+
mrb->symcapa = symcapa;
|
180
182
|
}
|
181
183
|
sname = &mrb->symtbl[sym];
|
182
184
|
sname->len = (uint16_t)len;
|
@@ -201,7 +203,7 @@ sym_intern(mrb_state *mrb, const char *name, size_t len, mrb_bool lit)
|
|
201
203
|
else {
|
202
204
|
sname->prev = 0;
|
203
205
|
}
|
204
|
-
mrb->symhash[hash] = sym;
|
206
|
+
mrb->symhash[hash] = mrb->symidx = sym;
|
205
207
|
|
206
208
|
return sym<<SYMBOL_NORMAL_SHIFT;
|
207
209
|
}
|
@@ -6,7 +6,9 @@
|
|
6
6
|
|
7
7
|
#include <stddef.h>
|
8
8
|
#include <stdarg.h>
|
9
|
+
#ifndef MRB_WITHOUT_FLOAT
|
9
10
|
#include <math.h>
|
11
|
+
#endif
|
10
12
|
#include <mruby.h>
|
11
13
|
#include <mruby/array.h>
|
12
14
|
#include <mruby/class.h>
|
@@ -322,6 +324,7 @@ cipop(mrb_state *mrb)
|
|
322
324
|
}
|
323
325
|
|
324
326
|
void mrb_exc_set(mrb_state *mrb, mrb_value exc);
|
327
|
+
static mrb_value mrb_run(mrb_state *mrb, struct RProc* proc, mrb_value self);
|
325
328
|
|
326
329
|
static void
|
327
330
|
ecall(mrb_state *mrb)
|
@@ -333,10 +336,12 @@ ecall(mrb_state *mrb)
|
|
333
336
|
struct REnv *env;
|
334
337
|
ptrdiff_t cioff;
|
335
338
|
int ai = mrb_gc_arena_save(mrb);
|
336
|
-
uint16_t i
|
339
|
+
uint16_t i;
|
337
340
|
int nregs;
|
338
341
|
|
339
|
-
if (
|
342
|
+
if (c->eidx == 0) return;
|
343
|
+
i = --c->eidx;
|
344
|
+
|
340
345
|
/* restrict total call depth of ecall() */
|
341
346
|
if (++mrb->ecall_nest > MRB_ECALL_DEPTH_MAX) {
|
342
347
|
mrb_exc_raise(mrb, mrb_obj_value(mrb->stack_err));
|
@@ -428,6 +433,7 @@ MRB_API mrb_value
|
|
428
433
|
mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc, const mrb_value *argv, mrb_value blk)
|
429
434
|
{
|
430
435
|
mrb_value val;
|
436
|
+
int ai = mrb_gc_arena_save(mrb);
|
431
437
|
|
432
438
|
if (!mrb->jmp) {
|
433
439
|
struct mrb_jmpbuf c_jmp;
|
@@ -516,19 +522,17 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc
|
|
516
522
|
mrb->c->stack[argc+1] = blk;
|
517
523
|
|
518
524
|
if (MRB_METHOD_CFUNC_P(m)) {
|
519
|
-
int ai = mrb_gc_arena_save(mrb);
|
520
|
-
|
521
525
|
ci->acc = CI_ACC_DIRECT;
|
522
526
|
val = MRB_METHOD_CFUNC(m)(mrb, self);
|
523
527
|
mrb->c->stack = mrb->c->ci->stackent;
|
524
528
|
cipop(mrb);
|
525
|
-
mrb_gc_arena_restore(mrb, ai);
|
526
529
|
}
|
527
530
|
else {
|
528
531
|
ci->acc = CI_ACC_SKIP;
|
529
532
|
val = mrb_run(mrb, MRB_METHOD_PROC(m), self);
|
530
533
|
}
|
531
534
|
}
|
535
|
+
mrb_gc_arena_restore(mrb, ai);
|
532
536
|
mrb_gc_protect(mrb, val);
|
533
537
|
return val;
|
534
538
|
}
|
@@ -623,7 +627,7 @@ mrb_f_send(mrb_state *mrb, mrb_value self)
|
|
623
627
|
ci->argc--;
|
624
628
|
}
|
625
629
|
else { /* variable length arguments */
|
626
|
-
|
630
|
+
regs[0] = mrb_ary_subseq(mrb, regs[0], 1, RARRAY_LEN(regs[0]) - 1);
|
627
631
|
}
|
628
632
|
|
629
633
|
if (MRB_METHOD_CFUNC_P(m)) {
|
@@ -647,8 +651,7 @@ eval_under(mrb_state *mrb, mrb_value self, mrb_value blk, struct RClass *c)
|
|
647
651
|
}
|
648
652
|
ci = mrb->c->ci;
|
649
653
|
if (ci->acc == CI_ACC_DIRECT) {
|
650
|
-
|
651
|
-
return mrb_yield_cont(mrb, blk, self, 1, &self);
|
654
|
+
return mrb_yield_with_class(mrb, blk, 1, &self, self, c);
|
652
655
|
}
|
653
656
|
ci->target_class = c;
|
654
657
|
p = mrb_proc_ptr(blk);
|
@@ -723,26 +726,11 @@ mrb_value
|
|
723
726
|
mrb_obj_instance_eval(mrb_state *mrb, mrb_value self)
|
724
727
|
{
|
725
728
|
mrb_value a, b;
|
726
|
-
mrb_value cv;
|
727
|
-
struct RClass *c;
|
728
729
|
|
729
730
|
if (mrb_get_args(mrb, "|S&", &a, &b) == 1) {
|
730
731
|
mrb_raise(mrb, E_NOTIMP_ERROR, "instance_eval with string not implemented");
|
731
732
|
}
|
732
|
-
|
733
|
-
case MRB_TT_SYMBOL:
|
734
|
-
case MRB_TT_FIXNUM:
|
735
|
-
#ifndef MRB_WITHOUT_FLOAT
|
736
|
-
case MRB_TT_FLOAT:
|
737
|
-
#endif
|
738
|
-
c = 0;
|
739
|
-
break;
|
740
|
-
default:
|
741
|
-
cv = mrb_singleton_class(mrb, self);
|
742
|
-
c = mrb_class_ptr(cv);
|
743
|
-
break;
|
744
|
-
}
|
745
|
-
return eval_under(mrb, self, b, c);
|
733
|
+
return eval_under(mrb, self, b, mrb_singleton_class_ptr(mrb, self));
|
746
734
|
}
|
747
735
|
|
748
736
|
MRB_API mrb_value
|
@@ -1061,6 +1049,11 @@ RETRY_TRY_BLOCK:
|
|
1061
1049
|
NEXT;
|
1062
1050
|
}
|
1063
1051
|
|
1052
|
+
CASE(OP_LOADI16, BS) {
|
1053
|
+
SET_INT_VALUE(regs[a], (mrb_int)(int16_t)b);
|
1054
|
+
NEXT;
|
1055
|
+
}
|
1056
|
+
|
1064
1057
|
CASE(OP_LOADSYM, BB) {
|
1065
1058
|
SET_SYM_VALUE(regs[a], syms[b]);
|
1066
1059
|
NEXT;
|
@@ -1098,13 +1091,13 @@ RETRY_TRY_BLOCK:
|
|
1098
1091
|
}
|
1099
1092
|
|
1100
1093
|
CASE(OP_GETSV, BB) {
|
1101
|
-
mrb_value val = mrb_vm_special_get(mrb, b);
|
1094
|
+
mrb_value val = mrb_vm_special_get(mrb, syms[b]);
|
1102
1095
|
regs[a] = val;
|
1103
1096
|
NEXT;
|
1104
1097
|
}
|
1105
1098
|
|
1106
1099
|
CASE(OP_SETSV, BB) {
|
1107
|
-
mrb_vm_special_set(mrb, b, regs[a]);
|
1100
|
+
mrb_vm_special_set(mrb, syms[b], regs[a]);
|
1108
1101
|
NEXT;
|
1109
1102
|
}
|
1110
1103
|
|
@@ -1495,11 +1488,9 @@ RETRY_TRY_BLOCK:
|
|
1495
1488
|
ci->target_class = MRB_PROC_TARGET_CLASS(m);
|
1496
1489
|
ci->proc = m;
|
1497
1490
|
if (MRB_PROC_ENV_P(m)) {
|
1498
|
-
mrb_sym mid;
|
1499
1491
|
struct REnv *e = MRB_PROC_ENV(m);
|
1500
1492
|
|
1501
|
-
mid = e->mid;
|
1502
|
-
if (mid) ci->mid = mid;
|
1493
|
+
ci->mid = e->mid;
|
1503
1494
|
if (!e->stack) {
|
1504
1495
|
e->stack = mrb->c->stack;
|
1505
1496
|
}
|
@@ -2825,7 +2816,7 @@ RETRY_TRY_BLOCK:
|
|
2825
2816
|
MRB_END_EXC(&c_jmp);
|
2826
2817
|
}
|
2827
2818
|
|
2828
|
-
|
2819
|
+
static mrb_value
|
2829
2820
|
mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
|
2830
2821
|
{
|
2831
2822
|
if (mrb->c->ci->argc < 0) {
|
@@ -63,28 +63,25 @@ def run_cmd(cmd)
|
|
63
63
|
configs = []
|
64
64
|
[true, false].each do |mode_32|
|
65
65
|
['', 'MRB_USE_FLOAT'].each do |float_conf|
|
66
|
-
['', '
|
67
|
-
['', '
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
_info = _info.gsub(/ +/, ' ').strip.tr(' ', '_')
|
86
|
-
configs << { '_info' => _info, 'CFLAGS' => "#{bit}#{env}", 'LDFLAGS' => bit.strip.to_s }
|
87
|
-
end
|
66
|
+
['', 'MRB_NAN_BOXING', 'MRB_WORD_BOXING'].each do |boxing_conf|
|
67
|
+
['', 'MRB_UTF8_STRING'].each do |utf8_conf|
|
68
|
+
next if (float_conf == 'MRB_USE_FLOAT') && (boxing_conf == 'MRB_NAN_BOXING')
|
69
|
+
next if (int_conf == 'MRB_INT64') && (boxing_conf == 'MRB_NAN_BOXING')
|
70
|
+
next if (int_conf == 'MRB_INT64') && (boxing_conf == 'MRB_WORD_BOXING') && mode_32
|
71
|
+
env = [float_conf, int_conf, boxing_conf, utf8_conf].map do |conf|
|
72
|
+
conf == '' ? nil : "-D#{conf}=1"
|
73
|
+
end.compact.join(' ')
|
74
|
+
bit = mode_32 ? '-m32 ' : ''
|
75
|
+
_info = ''
|
76
|
+
_info += mode_32 ? '32bit ' : '64bit '
|
77
|
+
_info += float_conf['USE'] ? 'float ' : ''
|
78
|
+
_info += int_conf['16'] ? 'int16 ' : ''
|
79
|
+
_info += int_conf['64'] ? 'int64 ' : ''
|
80
|
+
_info += boxing_conf['NAN'] ? 'nan ' : ''
|
81
|
+
_info += boxing_conf['WORD'] ? 'word ' : ''
|
82
|
+
_info += utf8_conf['UTF8'] ? 'utf8 ' : ''
|
83
|
+
_info = _info.gsub(/ +/, ' ').strip.tr(' ', '_')
|
84
|
+
configs << { '_info' => _info, 'CFLAGS' => "#{bit}#{env}", 'LDFLAGS' => bit.strip.to_s }
|
88
85
|
end
|
89
86
|
end
|
90
87
|
end
|
@@ -7,7 +7,7 @@
|
|
7
7
|
# loader all gems
|
8
8
|
self.libmruby_objs << objfile("#{build_dir}/mrbgems/gem_init")
|
9
9
|
file objfile("#{build_dir}/mrbgems/gem_init") => ["#{build_dir}/mrbgems/gem_init.c", "#{build_dir}/LEGAL"]
|
10
|
-
file "#{build_dir}/mrbgems/gem_init.c" => [MRUBY_CONFIG, __FILE__] do |t|
|
10
|
+
file "#{build_dir}/mrbgems/gem_init.c" => [MRUBY_CONFIG, __FILE__, *Dir.glob("#{build_dir}/mrbgems/mruby-*/*.c")] do |t|
|
11
11
|
mkdir_p "#{build_dir}/mrbgems"
|
12
12
|
open(t.name, 'w') do |f|
|
13
13
|
gem_func_gems = gems.select { |g| g.generate_functions }
|
@@ -10,6 +10,7 @@ class MRuby::Toolchain::Android
|
|
10
10
|
~/Android/Sdk/ndk-bundle
|
11
11
|
%LOCALAPPDATA%/Android/android-sdk/ndk-bundle
|
12
12
|
%LOCALAPPDATA%/Android/android-ndk
|
13
|
+
%LOCALAPPDATA%/Android/Sdk/ndk/*
|
13
14
|
~/Library/Android/sdk/ndk-bundle
|
14
15
|
~/Library/Android/ndk
|
15
16
|
}
|
@@ -40,6 +41,19 @@ def message
|
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
44
|
+
class SysrootNotReady < StandardError
|
45
|
+
def message
|
46
|
+
<<-EOM
|
47
|
+
Couldn't find standard header files
|
48
|
+
Please Move/Copy important file inside
|
49
|
+
<NDK_HOME>/sysroot/usr/include/
|
50
|
+
to
|
51
|
+
<NDK_HOME>/platforms/<ANDROID_VERSION>/<ARCH>/usr/include/
|
52
|
+
Higher NDK version will be use.
|
53
|
+
EOM
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
43
57
|
attr_reader :params
|
44
58
|
|
45
59
|
def initialize(params)
|
@@ -74,6 +88,25 @@ def home_path
|
|
74
88
|
path.gsub! '%LOCALAPPDATA%', ENV['LOCALAPPDATA'] || '%LOCALAPPDATA%'
|
75
89
|
path.gsub! '\\', '/'
|
76
90
|
path.gsub! '~', Dir.home || '~'
|
91
|
+
path.gsub!('*') do
|
92
|
+
next nil unless path[-1] == "*"
|
93
|
+
dirs = Dir.glob(path).collect do |d|
|
94
|
+
m = d.match(/(\d+)\.(\d+)\.(\d+)$/)
|
95
|
+
m ? [m[1], m[2], m[3]].collect { |v| v.to_i } : nil
|
96
|
+
end
|
97
|
+
dirs.compact!
|
98
|
+
dirs.sort! do |before, after|
|
99
|
+
f = 0
|
100
|
+
if (f = (after.first <=> before.first)) != 0
|
101
|
+
next f
|
102
|
+
elsif (f = (after[1] <=> before[1])) != 0
|
103
|
+
next f
|
104
|
+
else
|
105
|
+
next after.last <=> before.last
|
106
|
+
end
|
107
|
+
end
|
108
|
+
dirs.empty? ? nil.to_s : dirs.first.join(".")
|
109
|
+
end
|
77
110
|
File.directory?(path)
|
78
111
|
} || raise(AndroidNDKHomeNotFound)
|
79
112
|
)
|
@@ -146,7 +179,8 @@ def arch
|
|
146
179
|
end
|
147
180
|
|
148
181
|
def sysroot
|
149
|
-
@sysroot
|
182
|
+
return @sysroot if @sysroot
|
183
|
+
sysroot_path = home_path.join('platforms', platform,
|
150
184
|
case arch
|
151
185
|
when /armeabi/ then 'arch-arm'
|
152
186
|
when /arm64-v8a/ then 'arch-arm64'
|
@@ -156,6 +190,11 @@ def sysroot
|
|
156
190
|
when /mips/ then 'arch-mips'
|
157
191
|
end
|
158
192
|
).to_s
|
193
|
+
if Dir.exist?(File.join(sysroot_path, "usr", "include"))
|
194
|
+
return @sysroot = sysroot_path
|
195
|
+
else
|
196
|
+
raise(SysrootNotReady)
|
197
|
+
end
|
159
198
|
end
|
160
199
|
|
161
200
|
def platform
|
@@ -259,6 +298,12 @@ def ctarget
|
|
259
298
|
def cflags
|
260
299
|
flags = []
|
261
300
|
|
301
|
+
case RUBY_PLATFORM
|
302
|
+
when /mswin|mingw|win32/
|
303
|
+
# Build for Android dont need window flag
|
304
|
+
flags += %W(-U_WIN32 -U_WIN64)
|
305
|
+
end
|
306
|
+
|
262
307
|
flags += %W(-MMD -MP -D__android__ -DANDROID --sysroot="#{sysroot}")
|
263
308
|
flags += ctarget
|
264
309
|
case toolchain
|
@@ -12,9 +12,9 @@
|
|
12
12
|
compiler.command = ENV['CC'] || default_command
|
13
13
|
compiler.flags = [c_mandatory_flags, ENV['CFLAGS'] || [compiler_flags, cxx_invalid_flags, %w(-Wwrite-strings)]]
|
14
14
|
end
|
15
|
-
compiler.option_include_path =
|
15
|
+
compiler.option_include_path = %q[-I"%s"]
|
16
16
|
compiler.option_define = '-D%s'
|
17
|
-
compiler.compile_options =
|
17
|
+
compiler.compile_options = %q[%{flags} -MMD -o "%{outfile}" -c "%{infile}"]
|
18
18
|
compiler.cxx_compile_flag = '-x c++ -std=gnu++03'
|
19
19
|
compiler.cxx_exception_flag = '-fexceptions'
|
20
20
|
compiler.cxx_invalid_flags = c_mandatory_flags + cxx_invalid_flags
|
@@ -27,7 +27,7 @@
|
|
27
27
|
linker.library_paths = []
|
28
28
|
linker.option_library = '-l%s'
|
29
29
|
linker.option_library_path = '-L%s'
|
30
|
-
linker.link_options = '%{flags} -o %{outfile} %{objs} %{flags_before_libraries} %{libs} %{flags_after_libraries}'
|
30
|
+
linker.link_options = '%{flags} -o "%{outfile}" %{objs} %{flags_before_libraries} %{libs} %{flags_after_libraries}'
|
31
31
|
end
|
32
32
|
|
33
33
|
[[conf.cc, 'c'], [conf.cxx, 'c++']].each do |cc, lang|
|
@@ -5,18 +5,18 @@
|
|
5
5
|
cc.command = ENV['TARGET_CC']
|
6
6
|
cc.flags = ENV['TARGET_CFLAGS']
|
7
7
|
cc.include_paths = ["#{MRUBY_ROOT}/include"]
|
8
|
-
cc.option_include_path =
|
8
|
+
cc.option_include_path = %q[-I"%s"]
|
9
9
|
cc.option_define = '-D%s'
|
10
|
-
cc.compile_options =
|
10
|
+
cc.compile_options = %q[%{flags} -MMD -o "%{outfile}" -c "%{infile}"]
|
11
11
|
end
|
12
12
|
|
13
13
|
[conf.cxx].each do |cxx|
|
14
14
|
cxx.command = ENV['TARGET_CXX']
|
15
15
|
cxx.flags = ENV['TARGET_CXXFLAGS']
|
16
16
|
cxx.include_paths = ["#{MRUBY_ROOT}/include"]
|
17
|
-
cxx.option_include_path =
|
17
|
+
cxx.option_include_path = %q[-I"%s"]
|
18
18
|
cxx.option_define = '-D%s'
|
19
|
-
cxx.compile_options =
|
19
|
+
cxx.compile_options = %q[%{flags} -MMD -o "%{outfile}" -c "%{infile}"]
|
20
20
|
end
|
21
21
|
|
22
22
|
conf.linker do |linker|
|
@@ -26,11 +26,11 @@
|
|
26
26
|
linker.library_paths = []
|
27
27
|
linker.option_library = '-l%s'
|
28
28
|
linker.option_library_path = '-L%s'
|
29
|
-
linker.link_options = '%{flags} -o %{outfile} %{objs} %{flags_before_libraries} %{libs} %{flags_after_libraries}'
|
29
|
+
linker.link_options = '%{flags} -o "%{outfile}" %{objs} %{flags_before_libraries} %{libs} %{flags_after_libraries}'
|
30
30
|
end
|
31
31
|
|
32
32
|
conf.archiver do |archiver|
|
33
33
|
archiver.command = ENV['TARGET_AR']
|
34
|
-
archiver.archive_options = 'rs %{outfile} %{objs}'
|
34
|
+
archiver.archive_options = 'rs "%{outfile}" %{objs}'
|
35
35
|
end
|
36
36
|
end
|
@@ -4,9 +4,9 @@
|
|
4
4
|
# C4013: implicit function declaration
|
5
5
|
cc.flags = [ENV['CFLAGS'] || %w(/c /nologo /W3 /we4013 /Zi /MD /O2 /D_CRT_SECURE_NO_WARNINGS)]
|
6
6
|
cc.defines = %w(MRB_STACK_EXTEND_DOUBLING)
|
7
|
-
cc.option_include_path =
|
7
|
+
cc.option_include_path = %q[/I"%s"]
|
8
8
|
cc.option_define = '/D%s'
|
9
|
-
cc.compile_options =
|
9
|
+
cc.compile_options = %Q[%{flags} /Fo"%{outfile}" "%{infile}"]
|
10
10
|
cc.cxx_compile_flag = '/TP'
|
11
11
|
cc.cxx_exception_flag = '/EHs'
|
12
12
|
end
|
@@ -15,9 +15,9 @@
|
|
15
15
|
cxx.command = ENV['CXX'] || 'cl.exe'
|
16
16
|
cxx.flags = [ENV['CXXFLAGS'] || ENV['CFLAGS'] || %w(/c /nologo /W3 /Zi /MD /O2 /EHs /D_CRT_SECURE_NO_WARNINGS)]
|
17
17
|
cxx.defines = %w(MRB_STACK_EXTEND_DOUBLING)
|
18
|
-
cxx.option_include_path =
|
18
|
+
cxx.option_include_path = %q[/I"%s"]
|
19
19
|
cxx.option_define = '/D%s'
|
20
|
-
cxx.compile_options =
|
20
|
+
cxx.compile_options = %Q[%{flags} /Fo"%{outfile}" "%{infile}"]
|
21
21
|
cxx.cxx_compile_flag = '/TP'
|
22
22
|
cxx.cxx_exception_flag = '/EHs'
|
23
23
|
end
|
@@ -29,22 +29,22 @@
|
|
29
29
|
linker.library_paths = %w()
|
30
30
|
linker.option_library = '%s.lib'
|
31
31
|
linker.option_library_path = '/LIBPATH:%s'
|
32
|
-
linker.link_options =
|
32
|
+
linker.link_options = %Q[%{flags} /OUT:"%{outfile}" %{objs} %{flags_before_libraries} %{libs} %{flags_after_libraries}]
|
33
33
|
end
|
34
34
|
|
35
35
|
conf.archiver do |archiver|
|
36
36
|
archiver.command = ENV['AR'] || 'lib.exe'
|
37
|
-
archiver.archive_options = '/nologo /OUT
|
37
|
+
archiver.archive_options = '/nologo /OUT:"%{outfile}" %{objs}'
|
38
38
|
end
|
39
39
|
|
40
40
|
conf.yacc do |yacc|
|
41
41
|
yacc.command = ENV['YACC'] || 'bison.exe'
|
42
|
-
yacc.compile_options =
|
42
|
+
yacc.compile_options = %q[-o "%{outfile}" "%{infile}"]
|
43
43
|
end
|
44
44
|
|
45
45
|
conf.gperf do |gperf|
|
46
46
|
gperf.command = 'gperf.exe'
|
47
|
-
gperf.compile_options =
|
47
|
+
gperf.compile_options = %q[-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" "%{infile}" > "%{outfile}"]
|
48
48
|
end
|
49
49
|
|
50
50
|
conf.exts do |exts|
|