script_core 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +8 -6
- data/.ruby-version +1 -1
- data/Gemfile +2 -1
- data/bin/sandbox +1 -1
- data/ext/enterprise_script_service/Rakefile +1 -1
- data/ext/enterprise_script_service/flags.rb +5 -0
- data/ext/enterprise_script_service/libseccomp/CHANGELOG +15 -0
- data/ext/enterprise_script_service/libseccomp/CREDITS +3 -0
- data/ext/enterprise_script_service/libseccomp/Makefile.am +1 -1
- data/ext/enterprise_script_service/libseccomp/README.md +1 -1
- data/ext/enterprise_script_service/libseccomp/SECURITY.md +45 -0
- data/ext/enterprise_script_service/libseccomp/configure.ac +3 -3
- data/ext/enterprise_script_service/libseccomp/doc/admin/MAINTAINER_PROCESS.md +95 -0
- data/ext/enterprise_script_service/libseccomp/{RELEASE_PROCESS.md → doc/admin/RELEASE_PROCESS.md} +9 -1
- data/ext/enterprise_script_service/libseccomp/include/Makefile.am +1 -1
- data/ext/enterprise_script_service/libseccomp/include/seccomp-syscalls.h +2292 -0
- data/ext/enterprise_script_service/libseccomp/include/seccomp.h.in +3 -1065
- data/ext/enterprise_script_service/libseccomp/src/arch-aarch64-syscalls.c +35 -3
- data/ext/enterprise_script_service/libseccomp/src/arch-arm-syscalls.c +35 -3
- data/ext/enterprise_script_service/libseccomp/src/arch-mips-syscalls.c +43 -11
- data/ext/enterprise_script_service/libseccomp/src/arch-mips64-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/arch-mips64n32-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/arch-parisc-syscalls.c +34 -2
- data/ext/enterprise_script_service/libseccomp/src/arch-ppc-syscalls.c +43 -11
- data/ext/enterprise_script_service/libseccomp/src/arch-ppc64-syscalls.c +44 -12
- data/ext/enterprise_script_service/libseccomp/src/arch-s390-syscalls.c +46 -14
- data/ext/enterprise_script_service/libseccomp/src/arch-s390.c +142 -18
- data/ext/enterprise_script_service/libseccomp/src/arch-s390x-syscalls.c +47 -15
- data/ext/enterprise_script_service/libseccomp/src/arch-s390x.c +143 -17
- data/ext/enterprise_script_service/libseccomp/src/arch-x32-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/arch-x86-syscalls.c +94 -12
- data/ext/enterprise_script_service/libseccomp/src/arch-x86.c +142 -19
- data/ext/enterprise_script_service/libseccomp/src/arch-x86_64-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/db.c +1 -0
- data/ext/enterprise_script_service/libseccomp/src/gen_bpf.c +10 -3
- data/ext/enterprise_script_service/libseccomp/src/python/Makefile.am +4 -4
- data/ext/enterprise_script_service/libseccomp/src/python/seccomp.pyx +2 -0
- data/ext/enterprise_script_service/libseccomp/tests/.gitignore +1 -0
- data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.c +98 -0
- data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.py +61 -0
- data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.tests +18 -0
- data/ext/enterprise_script_service/libseccomp/tests/Makefile.am +6 -3
- data/ext/enterprise_script_service/libseccomp/tools/Makefile.am +0 -2
- data/ext/enterprise_script_service/libseccomp/tools/check-syntax +1 -0
- data/ext/enterprise_script_service/libseccomp/tools/scmp_bpf_sim.c +2 -0
- data/ext/enterprise_script_service/mruby-mpdecimal/src/ext.c +1 -1
- data/ext/enterprise_script_service/mruby/.gitignore +2 -2
- data/ext/enterprise_script_service/mruby/CONTRIBUTING.md +10 -3
- data/ext/enterprise_script_service/mruby/Doxyfile +2408 -0
- data/ext/enterprise_script_service/mruby/README.md +21 -8
- data/ext/enterprise_script_service/mruby/Rakefile +4 -13
- data/ext/enterprise_script_service/mruby/appveyor_config.rb +1 -1
- data/ext/enterprise_script_service/mruby/build_config.rb +3 -3
- data/ext/enterprise_script_service/mruby/doc/guides/compile.md +42 -42
- data/ext/enterprise_script_service/mruby/doc/guides/debugger.md +1 -1
- data/ext/enterprise_script_service/mruby/doc/guides/mrbconf.md +45 -6
- data/ext/enterprise_script_service/mruby/doc/guides/mrbgems.md +5 -0
- data/ext/enterprise_script_service/mruby/doc/limitations.md +88 -38
- data/ext/enterprise_script_service/mruby/doc/mruby_logo_red_icon.png +0 -0
- data/ext/enterprise_script_service/mruby/doc/opcode.md +94 -94
- data/ext/enterprise_script_service/mruby/include/mrbconf.h +74 -11
- data/ext/enterprise_script_service/mruby/include/mruby.h +242 -146
- data/ext/enterprise_script_service/mruby/include/mruby/array.h +7 -7
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_nan.h +2 -9
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_no.h +11 -10
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_word.h +104 -69
- data/ext/enterprise_script_service/mruby/include/mruby/class.h +7 -5
- data/ext/enterprise_script_service/mruby/include/mruby/common.h +9 -7
- data/ext/enterprise_script_service/mruby/include/mruby/compile.h +6 -6
- data/ext/enterprise_script_service/mruby/include/mruby/data.h +5 -5
- data/ext/enterprise_script_service/mruby/include/mruby/debug.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/dump.h +3 -7
- data/ext/enterprise_script_service/mruby/include/mruby/error.h +34 -6
- data/ext/enterprise_script_service/mruby/include/mruby/gc.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/hash.h +4 -11
- data/ext/enterprise_script_service/mruby/include/mruby/irep.h +16 -4
- data/ext/enterprise_script_service/mruby/include/mruby/istruct.h +4 -4
- data/ext/enterprise_script_service/mruby/include/mruby/khash.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/numeric.h +41 -7
- data/ext/enterprise_script_service/mruby/include/mruby/object.h +8 -9
- data/ext/enterprise_script_service/mruby/include/mruby/opcode.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/ops.h +6 -6
- data/ext/enterprise_script_service/mruby/include/mruby/proc.h +19 -13
- data/ext/enterprise_script_service/mruby/include/mruby/range.h +10 -4
- data/ext/enterprise_script_service/mruby/include/mruby/re.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/string.h +130 -107
- data/ext/enterprise_script_service/mruby/include/mruby/throw.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/value.h +137 -49
- data/ext/enterprise_script_service/mruby/include/mruby/variable.h +3 -5
- data/ext/enterprise_script_service/mruby/include/mruby/version.h +24 -10
- data/ext/enterprise_script_service/mruby/lib/mruby-core-ext.rb +2 -39
- data/ext/enterprise_script_service/mruby/lib/mruby/build.rb +32 -15
- data/ext/enterprise_script_service/mruby/lib/mruby/build/command.rb +63 -17
- data/ext/enterprise_script_service/mruby/lib/mruby/build/load_gems.rb +24 -10
- data/ext/enterprise_script_service/mruby/lib/mruby/gem.rb +11 -7
- data/ext/enterprise_script_service/mruby/lib/mruby/lockfile.rb +81 -0
- data/ext/enterprise_script_service/mruby/minirake +27 -11
- data/ext/enterprise_script_service/mruby/mrbgems/default.gembox +3 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrbgem.rake +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +47 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/src/array.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/test/array.rb +50 -29
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdprint.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.h +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h +4 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +28 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c +1 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/bintest/mruby.rb +75 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +134 -90
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-class-ext/src/class.c +7 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/codegen.c +69 -46
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/keywords +0 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/lex.def +51 -59
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/parse.y +430 -241
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrbgem.rake +10 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrblib/complex.rb +122 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/src/complex.c +249 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/test/complex.rb +153 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-chain/mrblib/chain.rb +19 -17
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-chain/test/enum_chain.rb +41 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-ext/mrblib/enum.rb +30 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-ext/test/enum.rb +8 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/mrbgem.rake +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/mrblib/enumerator.rb +46 -14
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/test/enumerator.rb +51 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-error/src/exception.c +10 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/src/eval.c +47 -44
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/test/eval.rb +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-exit/src/mruby-exit.c +9 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/src/fiber.c +16 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/test/fiber.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/mrbgem.rake +0 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb +3 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/test/hash.rb +3 -7
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/README.md +1 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrbgem.rake +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/file.rb +0 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/io.rb +24 -38
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/kernel.rb +16 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file.c +19 -18
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file_test.c +5 -16
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/io.c +54 -42
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file.rb +24 -20
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file_test.rb +4 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/io.rb +41 -35
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/mruby_io_test.c +9 -36
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/mrbgem.rake +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/src/kernel.c +9 -27
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/test/kernel.rb +2 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-math/src/math.c +5 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/src/metaprog.c +39 -24
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/test/metaprog.rb +48 -17
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/mrblib/method.rb +0 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/src/method.c +134 -101
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/test/method.rb +9 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb +1 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/src/numeric_ext.c +17 -37
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/test/numeric.rb +0 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/mrbgem.rake +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/mrblib/object.rb +15 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/src/object.c +35 -6
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/test/nil.rb +4 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +1 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/test/objectspace.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/src/pack.c +28 -23
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/test/pack.rb +43 -49
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-print/mrblib/print.rb +3 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/src/proc.c +6 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/test/proc.rb +21 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/random.c +157 -124
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/test/random.rb +72 -26
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/mrblib/range.rb +38 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/src/range.c +26 -11
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/test/range.rb +111 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrbgem.rake +5 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrblib/rational.rb +117 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/src/rational.c +209 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/test/rational.rb +308 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/README.md +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/src/socket.c +10 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/kernel.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/sprintf.c +22 -24
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/mrbgem.rake +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +8 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/src/string.c +116 -117
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/numeric.rb +29 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/range.rb +26 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/string.rb +32 -50
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/mrblib/struct.rb +5 -7
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/src/struct.c +43 -57
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/test/struct.rb +16 -11
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/driver.c +152 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/mrbgem.rake +4 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/vformat.c +200 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/include/mruby/time.h +2 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/src/time.c +199 -68
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/test/time.rb +81 -46
- data/ext/enterprise_script_service/mruby/mrblib/array.rb +14 -16
- data/ext/enterprise_script_service/mruby/mrblib/enum.rb +13 -9
- data/ext/enterprise_script_service/mruby/mrblib/hash.rb +5 -7
- data/ext/enterprise_script_service/mruby/mrblib/kernel.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrblib/numeric.rb +4 -4
- data/ext/enterprise_script_service/mruby/mrblib/range.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrblib/string.rb +55 -112
- data/ext/enterprise_script_service/mruby/mruby-source.gemspec +1 -1
- data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby.dict +105 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby_fuzzer.options +5 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby_proto_fuzzer.options +4 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/mruby_fuzzer.c +18 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/mruby_proto_fuzzer.cpp +44 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/proto_to_ruby.cpp +455 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/proto_to_ruby.h +55 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/ruby.proto +201 -0
- data/ext/enterprise_script_service/mruby/src/array.c +95 -46
- data/ext/enterprise_script_service/mruby/src/backtrace.c +6 -8
- data/ext/enterprise_script_service/mruby/src/class.c +370 -278
- data/ext/enterprise_script_service/mruby/src/codedump.c +34 -34
- data/ext/enterprise_script_service/mruby/src/debug.c +2 -2
- data/ext/enterprise_script_service/mruby/src/dump.c +8 -6
- data/ext/enterprise_script_service/mruby/src/enum.c +1 -1
- data/ext/enterprise_script_service/mruby/src/error.c +157 -55
- data/ext/enterprise_script_service/mruby/src/etc.c +13 -46
- data/ext/enterprise_script_service/mruby/src/fmt_fp.c +2 -2
- data/ext/enterprise_script_service/mruby/src/gc.c +30 -11
- data/ext/enterprise_script_service/mruby/src/hash.c +23 -14
- data/ext/enterprise_script_service/mruby/src/kernel.c +16 -54
- data/ext/enterprise_script_service/mruby/src/load.c +40 -76
- data/ext/enterprise_script_service/mruby/src/numeric.c +164 -94
- data/ext/enterprise_script_service/mruby/src/object.c +16 -39
- data/ext/enterprise_script_service/mruby/src/pool.c +0 -2
- data/ext/enterprise_script_service/mruby/src/proc.c +47 -48
- data/ext/enterprise_script_service/mruby/src/range.c +22 -35
- data/ext/enterprise_script_service/mruby/src/state.c +5 -94
- data/ext/enterprise_script_service/mruby/src/string.c +874 -710
- data/ext/enterprise_script_service/mruby/src/symbol.c +73 -48
- data/ext/enterprise_script_service/mruby/src/variable.c +58 -38
- data/ext/enterprise_script_service/mruby/src/vm.c +133 -304
- data/ext/enterprise_script_service/mruby/tasks/doc.rake +48 -0
- data/ext/enterprise_script_service/mruby/tasks/toolchains/clang.rake +3 -4
- data/ext/enterprise_script_service/mruby/tasks/toolchains/gcc.rake +20 -19
- data/ext/enterprise_script_service/mruby/tasks/toolchains/visualcpp.rake +0 -12
- data/ext/enterprise_script_service/mruby/test/assert.rb +186 -25
- data/ext/enterprise_script_service/mruby/test/t/array.rb +34 -6
- data/ext/enterprise_script_service/mruby/test/t/class.rb +26 -0
- data/ext/enterprise_script_service/mruby/test/t/enumerable.rb +2 -2
- data/ext/enterprise_script_service/mruby/test/t/float.rb +17 -17
- data/ext/enterprise_script_service/mruby/test/t/hash.rb +2 -0
- data/ext/enterprise_script_service/mruby/test/t/integer.rb +14 -6
- data/ext/enterprise_script_service/mruby/test/t/kernel.rb +38 -19
- data/ext/enterprise_script_service/mruby/test/t/module.rb +87 -14
- data/ext/enterprise_script_service/mruby/test/t/numeric.rb +65 -23
- data/ext/enterprise_script_service/mruby/test/t/range.rb +4 -4
- data/ext/enterprise_script_service/mruby/test/t/string.rb +211 -49
- data/ext/enterprise_script_service/mruby/test/t/syntax.rb +19 -2
- data/ext/enterprise_script_service/mruby/test/t/vformat.rb +92 -0
- data/ext/enterprise_script_service/mruby/travis_config.rb +2 -2
- data/ext/enterprise_script_service/mruby_config.rb +10 -0
- data/ext/enterprise_script_service/mruby_engine.cpp +2 -2
- data/ext/enterprise_script_service/mruby_engine.gembox +1 -0
- data/ext/enterprise_script_service/msgpack/CHANGELOG.md +14 -0
- data/ext/enterprise_script_service/msgpack/Files.cmake +4 -0
- data/ext/enterprise_script_service/msgpack/README.md +1 -1
- data/ext/enterprise_script_service/msgpack/appveyor.yml +1 -1
- data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_msgpack_tuple.hpp.erb +1 -1
- data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_msgpack_tuple_decl.hpp.erb +1 -1
- data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_zone.hpp.erb +3 -3
- data/ext/enterprise_script_service/msgpack/example/boost/asio_send_recv.cpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/adaptor/cpp11/timespec.hpp +16 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/adaptor/wstring.hpp +15 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/object.h +2 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/pack_template.h +17 -9
- data/ext/enterprise_script_service/msgpack/include/msgpack/sysdep.h +27 -16
- data/ext/enterprise_script_service/msgpack/include/msgpack/type.hpp +2 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/unpack_template.h +5 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/array_ref.hpp +0 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/check_container_size.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp11/chrono.hpp +5 -5
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp11/timespec.hpp +140 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple.hpp +32 -32
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple_decl.hpp +32 -32
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple.hpp +6 -6
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple_decl.hpp +10 -10
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/ext.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/fixint.hpp +5 -4
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/int.hpp +40 -13
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/int_decl.hpp +3 -2
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/wstring.hpp +121 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/detail/cpp03_zone.hpp +3 -3
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/detail/cpp11_zone.hpp +3 -3
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/object.hpp +6 -6
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/object_fwd.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/pack.hpp +40 -5
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/unpack.hpp +11 -11
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/vrefbuffer.hpp +7 -7
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/zbuffer.hpp +5 -5
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/adaptor/int_decl.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/create_object_visitor.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/parse.hpp +13 -13
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/x3_parse.hpp +28 -26
- data/ext/enterprise_script_service/msgpack/include/msgpack/v3/adaptor/int_decl.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v3/parse.hpp +13 -13
- data/ext/enterprise_script_service/msgpack/include/msgpack/version_master.h +2 -2
- data/ext/enterprise_script_service/msgpack/include/msgpack/zbuffer.h +6 -6
- data/ext/enterprise_script_service/msgpack/include/msgpack/zone.h +1 -1
- data/ext/enterprise_script_service/msgpack/src/objectc.c +83 -148
- data/ext/enterprise_script_service/msgpack/src/unpack.c +73 -47
- data/ext/enterprise_script_service/msgpack/test/CMakeLists.txt +1 -1
- data/ext/enterprise_script_service/msgpack/test/array_ref.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/boost_fusion.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/boost_optional.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/boost_string_ref.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/boost_string_view.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/boost_variant.cpp +15 -9
- data/ext/enterprise_script_service/msgpack/test/buffer.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/carray.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/cases.cpp +7 -1
- data/ext/enterprise_script_service/msgpack/test/convert.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/fixint.cpp +7 -1
- data/ext/enterprise_script_service/msgpack/test/fixint_c.cpp +6 -1
- data/ext/enterprise_script_service/msgpack/test/fuzz_unpack_pack_fuzzer_cpp11.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/iterator_cpp11.cpp +8 -2
- data/ext/enterprise_script_service/msgpack/test/json.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/limit.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_basic.cpp +128 -6
- data/ext/enterprise_script_service/msgpack/test/msgpack_c.cpp +7 -2
- data/ext/enterprise_script_service/msgpack/test/msgpack_container.cpp +20 -3
- data/ext/enterprise_script_service/msgpack/test/msgpack_cpp11.cpp +159 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_cpp17.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_stream.cpp +8 -3
- data/ext/enterprise_script_service/msgpack/test/msgpack_tuple.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_vref.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_x3_parse.cpp +23 -18
- data/ext/enterprise_script_service/msgpack/test/object.cpp +77 -45
- data/ext/enterprise_script_service/msgpack/test/object_with_zone.cpp +28 -10
- data/ext/enterprise_script_service/msgpack/test/pack_unpack.cpp +25 -18
- data/ext/enterprise_script_service/msgpack/test/pack_unpack_c.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/raw.cpp +17 -12
- data/ext/enterprise_script_service/msgpack/test/reference.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/reference_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/reference_wrapper_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/shared_ptr_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/size_equal_only.cpp +6 -2
- data/ext/enterprise_script_service/msgpack/test/streaming.cpp +10 -3
- data/ext/enterprise_script_service/msgpack/test/streaming_c.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/unique_ptr_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/user_class.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/version.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/visitor.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/zone.cpp +6 -0
- data/lib/script_core/version.rb +1 -1
- data/lib/tasks/mruby/engine.gembox.example +1 -0
- data/lib/tasks/script_core.rake +21 -3
- data/spec/dummy/app/helpers/fields_helper.rb +2 -2
- data/spec/dummy/mruby/engine.gembox +1 -0
- data/spec/script_core_spec.rb +1 -1
- metadata +38 -22
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/.gitignore +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/.travis.yml +0 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/run_test.rb +0 -26
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/mrblib/kernel.rb +0 -15
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/mrblib/unbound_method.rb +0 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/.gitignore +0 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/.travis.yml +0 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/packtest.rb +0 -157
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/run_test.rb +0 -26
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/mt19937ar.c +0 -224
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/mt19937ar.h +0 -80
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/random.h +0 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.gitignore +0 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.travis.yml +0 -29
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.travis_build_config.rb +0 -6
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/Rakefile +0 -29
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/.travis.yml +0 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/run_test.rb +0 -28
@@ -461,7 +461,7 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc
|
|
461
461
|
stack_init(mrb);
|
462
462
|
}
|
463
463
|
if (argc < 0) {
|
464
|
-
mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative argc for funcall (%
|
464
|
+
mrb_raisef(mrb, E_ARGUMENT_ERROR, "negative argc for funcall (%i)", argc);
|
465
465
|
}
|
466
466
|
c = mrb_class(mrb, self);
|
467
467
|
m = mrb_method_search_vm(mrb, &c, mid);
|
@@ -486,26 +486,25 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc
|
|
486
486
|
ci->argc = (int)argc;
|
487
487
|
ci->target_class = c;
|
488
488
|
mrb->c->stack = mrb->c->stack + n;
|
489
|
+
if (argc < 0) argc = 1;
|
489
490
|
if (mrb->c->stbase <= argv && argv < mrb->c->stend) {
|
490
491
|
voff = argv - mrb->c->stbase;
|
491
492
|
}
|
492
|
-
if (
|
493
|
-
mrb_stack_extend(mrb, argc + 2);
|
494
|
-
}
|
495
|
-
else if (argc >= CALL_MAXARGS) {
|
493
|
+
if (argc >= CALL_MAXARGS) {
|
496
494
|
mrb_value args = mrb_ary_new_from_values(mrb, argc, argv);
|
497
495
|
|
498
|
-
mrb_stack_extend(mrb, 3);
|
499
496
|
mrb->c->stack[1] = args;
|
500
497
|
ci->argc = -1;
|
501
498
|
argc = 1;
|
502
499
|
}
|
503
|
-
|
500
|
+
mrb_stack_extend(mrb, argc + 2);
|
501
|
+
if (MRB_METHOD_PROC_P(m)) {
|
504
502
|
struct RProc *p = MRB_METHOD_PROC(m);
|
505
503
|
|
506
504
|
ci->proc = p;
|
507
|
-
if (
|
508
|
-
|
505
|
+
if (!MRB_PROC_CFUNC_P(p)) {
|
506
|
+
mrb_stack_extend(mrb, p->body.irep->nregs + argc);
|
507
|
+
}
|
509
508
|
}
|
510
509
|
if (voff >= 0) {
|
511
510
|
argv = mrb->c->stbase + voff;
|
@@ -520,9 +519,6 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc
|
|
520
519
|
int ai = mrb_gc_arena_save(mrb);
|
521
520
|
|
522
521
|
ci->acc = CI_ACC_DIRECT;
|
523
|
-
if (MRB_METHOD_PROC_P(m)) {
|
524
|
-
ci->proc = MRB_METHOD_PROC(m);
|
525
|
-
}
|
526
522
|
val = MRB_METHOD_CFUNC(m)(mrb, self);
|
527
523
|
mrb->c->stack = mrb->c->ci->stackent;
|
528
524
|
cipop(mrb);
|
@@ -820,7 +816,7 @@ mrb_yield_cont(mrb_state *mrb, mrb_value b, mrb_value self, mrb_int argc, const
|
|
820
816
|
if (mrb_nil_p(b)) {
|
821
817
|
mrb_raise(mrb, E_ARGUMENT_ERROR, "no block given");
|
822
818
|
}
|
823
|
-
if (
|
819
|
+
if (!mrb_proc_p(b)) {
|
824
820
|
mrb_raise(mrb, E_TYPE_ERROR, "not a block");
|
825
821
|
}
|
826
822
|
|
@@ -834,39 +830,14 @@ mrb_yield_cont(mrb_state *mrb, mrb_value b, mrb_value self, mrb_int argc, const
|
|
834
830
|
return mrb_exec_irep(mrb, self, p);
|
835
831
|
}
|
836
832
|
|
837
|
-
mrb_value
|
838
|
-
mrb_mod_s_nesting(mrb_state *mrb, mrb_value mod)
|
839
|
-
{
|
840
|
-
struct RProc *proc;
|
841
|
-
mrb_value ary;
|
842
|
-
struct RClass *c = NULL;
|
843
|
-
|
844
|
-
mrb_get_args(mrb, "");
|
845
|
-
ary = mrb_ary_new(mrb);
|
846
|
-
proc = mrb->c->ci[-1].proc; /* callee proc */
|
847
|
-
mrb_assert(!MRB_PROC_CFUNC_P(proc));
|
848
|
-
while (proc) {
|
849
|
-
if (MRB_PROC_SCOPE_P(proc)) {
|
850
|
-
struct RClass *c2 = MRB_PROC_TARGET_CLASS(proc);
|
851
|
-
|
852
|
-
if (c2 != c) {
|
853
|
-
c = c2;
|
854
|
-
mrb_ary_push(mrb, ary, mrb_obj_value(c));
|
855
|
-
}
|
856
|
-
}
|
857
|
-
proc = proc->upper;
|
858
|
-
}
|
859
|
-
return ary;
|
860
|
-
}
|
861
|
-
|
862
833
|
static struct RBreak*
|
863
834
|
break_new(mrb_state *mrb, struct RProc *p, mrb_value val)
|
864
835
|
{
|
865
836
|
struct RBreak *brk;
|
866
837
|
|
867
838
|
brk = (struct RBreak*)mrb_obj_alloc(mrb, MRB_TT_BREAK, NULL);
|
868
|
-
brk
|
869
|
-
brk
|
839
|
+
mrb_break_proc_set(brk, p);
|
840
|
+
mrb_break_value_set(brk, val);
|
870
841
|
|
871
842
|
return brk;
|
872
843
|
}
|
@@ -907,13 +878,11 @@ argnum_error(mrb_state *mrb, mrb_int num)
|
|
907
878
|
}
|
908
879
|
}
|
909
880
|
if (mrb->c->ci->mid) {
|
910
|
-
str = mrb_format(mrb, "'%
|
911
|
-
|
912
|
-
mrb_fixnum_value(argc), mrb_fixnum_value(num));
|
881
|
+
str = mrb_format(mrb, "'%n': wrong number of arguments (%i for %i)",
|
882
|
+
mrb->c->ci->mid, argc, num);
|
913
883
|
}
|
914
884
|
else {
|
915
|
-
str = mrb_format(mrb, "wrong number of arguments (%
|
916
|
-
mrb_fixnum_value(argc), mrb_fixnum_value(num));
|
885
|
+
str = mrb_format(mrb, "wrong number of arguments (%i for %i)", argc, num);
|
917
886
|
}
|
918
887
|
exc = mrb_exc_new_str(mrb, E_ARGUMENT_ERROR, str);
|
919
888
|
mrb_exc_set(mrb, exc);
|
@@ -1002,10 +971,10 @@ check_target_class(mrb_state *mrb)
|
|
1002
971
|
void mrb_hash_check_kdict(mrb_state *mrb, mrb_value self);
|
1003
972
|
|
1004
973
|
MRB_API mrb_value
|
1005
|
-
mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
|
974
|
+
mrb_vm_exec(mrb_state *mrb, struct RProc *proc, const mrb_code *pc)
|
1006
975
|
{
|
1007
|
-
/* mrb_assert(
|
1008
|
-
mrb_code *pc0 = pc;
|
976
|
+
/* mrb_assert(MRB_PROC_CFUNC_P(proc)) */
|
977
|
+
const mrb_code *pc0 = pc;
|
1009
978
|
mrb_irep *irep = proc->body.irep;
|
1010
979
|
mrb_value *pool = irep->pool;
|
1011
980
|
mrb_sym *syms = irep->syms;
|
@@ -1418,7 +1387,7 @@ RETRY_TRY_BLOCK:
|
|
1418
1387
|
|
1419
1388
|
recv = regs[a];
|
1420
1389
|
blk = regs[bidx];
|
1421
|
-
if (!mrb_nil_p(blk) &&
|
1390
|
+
if (!mrb_nil_p(blk) && !mrb_proc_p(blk)) {
|
1422
1391
|
blk = mrb_convert_type(mrb, blk, MRB_TT_PROC, "Proc", "to_proc");
|
1423
1392
|
/* The stack might have been reallocated during mrb_convert_type(),
|
1424
1393
|
see #3622 */
|
@@ -1466,6 +1435,11 @@ RETRY_TRY_BLOCK:
|
|
1466
1435
|
ci->proc = p;
|
1467
1436
|
recv = p->body.func(mrb, recv);
|
1468
1437
|
}
|
1438
|
+
else if (MRB_METHOD_NOARG_P(m) &&
|
1439
|
+
(argc > 0 || (argc == -1 && RARRAY_LEN(regs[1]) != 0))) {
|
1440
|
+
argnum_error(mrb, 0);
|
1441
|
+
goto L_RAISE;
|
1442
|
+
}
|
1469
1443
|
else {
|
1470
1444
|
recv = MRB_METHOD_FUNC(m)(mrb, recv);
|
1471
1445
|
}
|
@@ -1473,7 +1447,7 @@ RETRY_TRY_BLOCK:
|
|
1473
1447
|
mrb_gc_arena_shrink(mrb, ai);
|
1474
1448
|
if (mrb->exc) goto L_RAISE;
|
1475
1449
|
ci = mrb->c->ci;
|
1476
|
-
if (
|
1450
|
+
if (mrb_proc_p(blk)) {
|
1477
1451
|
struct RProc *p = mrb_proc_ptr(blk);
|
1478
1452
|
if (p && !MRB_PROC_STRICT_P(p) && MRB_PROC_ENV(p) == ci[-1].env) {
|
1479
1453
|
p->flags |= MRB_PROC_ORPHAN;
|
@@ -1584,9 +1558,13 @@ RETRY_TRY_BLOCK:
|
|
1584
1558
|
struct RClass *cls;
|
1585
1559
|
mrb_callinfo *ci = mrb->c->ci;
|
1586
1560
|
mrb_value recv, blk;
|
1561
|
+
struct RProc *p = ci->proc;
|
1587
1562
|
mrb_sym mid = ci->mid;
|
1588
|
-
struct RClass* target_class = MRB_PROC_TARGET_CLASS(
|
1563
|
+
struct RClass* target_class = MRB_PROC_TARGET_CLASS(p);
|
1589
1564
|
|
1565
|
+
if (MRB_PROC_ENV_P(p) && p->e.env->mid && p->e.env->mid != mid) { /* alias support */
|
1566
|
+
mid = p->e.env->mid; /* restore old mid */
|
1567
|
+
}
|
1590
1568
|
mrb_assert(bidx < irep->nregs);
|
1591
1569
|
|
1592
1570
|
if (mid == 0 || !target_class) {
|
@@ -1610,7 +1588,7 @@ RETRY_TRY_BLOCK:
|
|
1610
1588
|
goto L_RAISE;
|
1611
1589
|
}
|
1612
1590
|
blk = regs[bidx];
|
1613
|
-
if (!mrb_nil_p(blk) &&
|
1591
|
+
if (!mrb_nil_p(blk) && !mrb_proc_p(blk)) {
|
1614
1592
|
blk = mrb_convert_type(mrb, blk, MRB_TT_PROC, "Proc", "to_proc");
|
1615
1593
|
/* The stack or ci stack might have been reallocated during
|
1616
1594
|
mrb_convert_type(), see #3622 and #3784 */
|
@@ -1897,7 +1875,7 @@ RETRY_TRY_BLOCK:
|
|
1897
1875
|
mrb_value kdict = regs[mrb->c->ci->argc];
|
1898
1876
|
|
1899
1877
|
if (!mrb_hash_p(kdict) || !mrb_hash_key_p(mrb, kdict, k)) {
|
1900
|
-
mrb_value str = mrb_format(mrb, "missing keyword: %
|
1878
|
+
mrb_value str = mrb_format(mrb, "missing keyword: %v", k);
|
1901
1879
|
mrb_exc_set(mrb, mrb_exc_new_str(mrb, E_ARGUMENT_ERROR, str));
|
1902
1880
|
goto L_RAISE;
|
1903
1881
|
}
|
@@ -1924,7 +1902,7 @@ RETRY_TRY_BLOCK:
|
|
1924
1902
|
if (mrb_hash_p(kdict) && !mrb_hash_empty_p(mrb, kdict)) {
|
1925
1903
|
mrb_value keys = mrb_hash_keys(mrb, kdict);
|
1926
1904
|
mrb_value key1 = RARRAY_PTR(keys)[0];
|
1927
|
-
mrb_value str = mrb_format(mrb, "unknown keyword: %
|
1905
|
+
mrb_value str = mrb_format(mrb, "unknown keyword: %v", key1);
|
1928
1906
|
mrb_exc_set(mrb, mrb_exc_new_str(mrb, E_ARGUMENT_ERROR, str));
|
1929
1907
|
goto L_RAISE;
|
1930
1908
|
}
|
@@ -1961,7 +1939,7 @@ RETRY_TRY_BLOCK:
|
|
1961
1939
|
else {
|
1962
1940
|
blk = regs[ci->argc+1];
|
1963
1941
|
}
|
1964
|
-
if (
|
1942
|
+
if (mrb_proc_p(blk)) {
|
1965
1943
|
struct RProc *p = mrb_proc_ptr(blk);
|
1966
1944
|
|
1967
1945
|
if (!MRB_PROC_STRICT_P(p) &&
|
@@ -2046,7 +2024,7 @@ RETRY_TRY_BLOCK:
|
|
2046
2024
|
if (MRB_PROC_ENV_P(dst)) {
|
2047
2025
|
struct REnv *e = MRB_PROC_ENV(dst);
|
2048
2026
|
|
2049
|
-
if (!MRB_ENV_STACK_SHARED_P(e) || e->cxt != mrb->c) {
|
2027
|
+
if (!MRB_ENV_STACK_SHARED_P(e) || (e->cxt && e->cxt != mrb->c)) {
|
2050
2028
|
localjump_error(mrb, LOCALJUMP_ERROR_RETURN);
|
2051
2029
|
goto L_RAISE;
|
2052
2030
|
}
|
@@ -2131,8 +2109,8 @@ RETRY_TRY_BLOCK:
|
|
2131
2109
|
}
|
2132
2110
|
if (FALSE) {
|
2133
2111
|
L_BREAK:
|
2134
|
-
v = ((struct RBreak*)mrb->exc)
|
2135
|
-
proc = ((struct RBreak*)mrb->exc)
|
2112
|
+
v = mrb_break_value_get((struct RBreak*)mrb->exc);
|
2113
|
+
proc = mrb_break_proc_get((struct RBreak*)mrb->exc);
|
2136
2114
|
mrb->exc = NULL;
|
2137
2115
|
ci = mrb->c->ci;
|
2138
2116
|
}
|
@@ -2178,7 +2156,7 @@ RETRY_TRY_BLOCK:
|
|
2178
2156
|
}
|
2179
2157
|
pc = ci->pc;
|
2180
2158
|
ci = mrb->c->ci;
|
2181
|
-
DEBUG(fprintf(stderr, "from :%s\n",
|
2159
|
+
DEBUG(fprintf(stderr, "from :%s\n", mrb_sym_name(mrb, ci->mid)));
|
2182
2160
|
proc = mrb->c->ci->proc;
|
2183
2161
|
irep = proc->body.irep;
|
2184
2162
|
pool = irep->pool;
|
@@ -2217,184 +2195,67 @@ RETRY_TRY_BLOCK:
|
|
2217
2195
|
}
|
2218
2196
|
|
2219
2197
|
#define TYPES2(a,b) ((((uint16_t)(a))<<8)|(((uint16_t)(b))&0xff))
|
2220
|
-
#define
|
2221
|
-
|
2222
|
-
|
2223
|
-
|
2224
|
-
|
2225
|
-
|
2226
|
-
|
2227
|
-
|
2228
|
-
|
2229
|
-
|
2230
|
-
|
2231
|
-
|
2232
|
-
|
2233
|
-
|
2234
|
-
|
2235
|
-
|
2236
|
-
|
2237
|
-
|
2238
|
-
|
2239
|
-
|
2240
|
-
|
2241
|
-
|
2242
|
-
|
2243
|
-
|
2244
|
-
|
2245
|
-
|
2246
|
-
|
2247
|
-
mrb_float y = mrb_float(regs[a+1]);
|
2248
|
-
SET_FLOAT_VALUE(mrb, regs[a], (mrb_float)x + y);
|
2249
|
-
}
|
2250
|
-
break;
|
2251
|
-
case TYPES2(MRB_TT_FLOAT,MRB_TT_FIXNUM):
|
2252
|
-
#ifdef MRB_WORD_BOXING
|
2253
|
-
{
|
2254
|
-
mrb_float x = mrb_float(regs[a]);
|
2255
|
-
mrb_int y = mrb_fixnum(regs[a+1]);
|
2256
|
-
SET_FLOAT_VALUE(mrb, regs[a], x + y);
|
2257
|
-
}
|
2258
|
-
#else
|
2259
|
-
OP_MATH_BODY(+,mrb_float,mrb_fixnum);
|
2260
|
-
#endif
|
2261
|
-
break;
|
2262
|
-
case TYPES2(MRB_TT_FLOAT,MRB_TT_FLOAT):
|
2263
|
-
#ifdef MRB_WORD_BOXING
|
2264
|
-
{
|
2265
|
-
mrb_float x = mrb_float(regs[a]);
|
2266
|
-
mrb_float y = mrb_float(regs[a+1]);
|
2267
|
-
SET_FLOAT_VALUE(mrb, regs[a], x + y);
|
2268
|
-
}
|
2198
|
+
#define OP_MATH(op_name) \
|
2199
|
+
/* need to check if op is overridden */ \
|
2200
|
+
switch (TYPES2(mrb_type(regs[a]),mrb_type(regs[a+1]))) { \
|
2201
|
+
OP_MATH_CASE_FIXNUM(op_name); \
|
2202
|
+
OP_MATH_CASE_FLOAT(op_name, fixnum, float); \
|
2203
|
+
OP_MATH_CASE_FLOAT(op_name, float, fixnum); \
|
2204
|
+
OP_MATH_CASE_FLOAT(op_name, float, float); \
|
2205
|
+
OP_MATH_CASE_STRING_##op_name(); \
|
2206
|
+
default: \
|
2207
|
+
c = 1; \
|
2208
|
+
mid = mrb_intern_lit(mrb, MRB_STRINGIZE(OP_MATH_OP_##op_name)); \
|
2209
|
+
goto L_SEND_SYM; \
|
2210
|
+
} \
|
2211
|
+
NEXT;
|
2212
|
+
#define OP_MATH_CASE_FIXNUM(op_name) \
|
2213
|
+
case TYPES2(MRB_TT_FIXNUM, MRB_TT_FIXNUM): \
|
2214
|
+
{ \
|
2215
|
+
mrb_int x = mrb_fixnum(regs[a]), y = mrb_fixnum(regs[a+1]), z; \
|
2216
|
+
if (mrb_int_##op_name##_overflow(x, y, &z)) \
|
2217
|
+
OP_MATH_OVERFLOW_INT(op_name, x, y, z); \
|
2218
|
+
else \
|
2219
|
+
SET_INT_VALUE(regs[a], z); \
|
2220
|
+
} \
|
2221
|
+
break
|
2222
|
+
#ifdef MRB_WITHOUT_FLOAT
|
2223
|
+
#define OP_MATH_CASE_FLOAT(op_name, t1, t2) (void)0
|
2224
|
+
#define OP_MATH_OVERFLOW_INT(op_name, x, y, z) SET_INT_VALUE(regs[a], z)
|
2269
2225
|
#else
|
2270
|
-
|
2271
|
-
|
2272
|
-
|
2226
|
+
#define OP_MATH_CASE_FLOAT(op_name, t1, t2) \
|
2227
|
+
case TYPES2(OP_MATH_TT_##t1, OP_MATH_TT_##t2): \
|
2228
|
+
{ \
|
2229
|
+
mrb_float z = mrb_##t1(regs[a]) OP_MATH_OP_##op_name mrb_##t2(regs[a+1]); \
|
2230
|
+
SET_FLOAT_VALUE(mrb, regs[a], z); \
|
2231
|
+
} \
|
2232
|
+
break
|
2233
|
+
#define OP_MATH_OVERFLOW_INT(op_name, x, y, z) \
|
2234
|
+
SET_FLOAT_VALUE(mrb, regs[a], (mrb_float)x OP_MATH_OP_##op_name (mrb_float)y)
|
2273
2235
|
#endif
|
2274
|
-
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2280
|
-
|
2281
|
-
|
2282
|
-
|
2283
|
-
|
2236
|
+
#define OP_MATH_CASE_STRING_add() \
|
2237
|
+
case TYPES2(MRB_TT_STRING, MRB_TT_STRING): \
|
2238
|
+
regs[a] = mrb_str_plus(mrb, regs[a], regs[a+1]); \
|
2239
|
+
mrb_gc_arena_restore(mrb, ai); \
|
2240
|
+
break
|
2241
|
+
#define OP_MATH_CASE_STRING_sub() (void)0
|
2242
|
+
#define OP_MATH_CASE_STRING_mul() (void)0
|
2243
|
+
#define OP_MATH_OP_add +
|
2244
|
+
#define OP_MATH_OP_sub -
|
2245
|
+
#define OP_MATH_OP_mul *
|
2246
|
+
#define OP_MATH_TT_fixnum MRB_TT_FIXNUM
|
2247
|
+
#define OP_MATH_TT_float MRB_TT_FLOAT
|
2248
|
+
|
2249
|
+
CASE(OP_ADD, B) {
|
2250
|
+
OP_MATH(add);
|
2284
2251
|
}
|
2285
2252
|
|
2286
2253
|
CASE(OP_SUB, B) {
|
2287
|
-
|
2288
|
-
switch (TYPES2(mrb_type(regs[a]),mrb_type(regs[a+1]))) {
|
2289
|
-
case TYPES2(MRB_TT_FIXNUM,MRB_TT_FIXNUM):
|
2290
|
-
{
|
2291
|
-
mrb_int x, y, z;
|
2292
|
-
|
2293
|
-
x = mrb_fixnum(regs[a]);
|
2294
|
-
y = mrb_fixnum(regs[a+1]);
|
2295
|
-
if (mrb_int_sub_overflow(x, y, &z)) {
|
2296
|
-
#ifndef MRB_WITHOUT_FLOAT
|
2297
|
-
SET_FLOAT_VALUE(mrb, regs[a], (mrb_float)x - (mrb_float)y);
|
2298
|
-
break;
|
2299
|
-
#endif
|
2300
|
-
}
|
2301
|
-
SET_INT_VALUE(regs[a], z);
|
2302
|
-
}
|
2303
|
-
break;
|
2304
|
-
#ifndef MRB_WITHOUT_FLOAT
|
2305
|
-
case TYPES2(MRB_TT_FIXNUM,MRB_TT_FLOAT):
|
2306
|
-
{
|
2307
|
-
mrb_int x = mrb_fixnum(regs[a]);
|
2308
|
-
mrb_float y = mrb_float(regs[a+1]);
|
2309
|
-
SET_FLOAT_VALUE(mrb, regs[a], (mrb_float)x - y);
|
2310
|
-
}
|
2311
|
-
break;
|
2312
|
-
case TYPES2(MRB_TT_FLOAT,MRB_TT_FIXNUM):
|
2313
|
-
#ifdef MRB_WORD_BOXING
|
2314
|
-
{
|
2315
|
-
mrb_float x = mrb_float(regs[a]);
|
2316
|
-
mrb_int y = mrb_fixnum(regs[a+1]);
|
2317
|
-
SET_FLOAT_VALUE(mrb, regs[a], x - y);
|
2318
|
-
}
|
2319
|
-
#else
|
2320
|
-
OP_MATH_BODY(-,mrb_float,mrb_fixnum);
|
2321
|
-
#endif
|
2322
|
-
break;
|
2323
|
-
case TYPES2(MRB_TT_FLOAT,MRB_TT_FLOAT):
|
2324
|
-
#ifdef MRB_WORD_BOXING
|
2325
|
-
{
|
2326
|
-
mrb_float x = mrb_float(regs[a]);
|
2327
|
-
mrb_float y = mrb_float(regs[a+1]);
|
2328
|
-
SET_FLOAT_VALUE(mrb, regs[a], x - y);
|
2329
|
-
}
|
2330
|
-
#else
|
2331
|
-
OP_MATH_BODY(-,mrb_float,mrb_float);
|
2332
|
-
#endif
|
2333
|
-
break;
|
2334
|
-
#endif
|
2335
|
-
default:
|
2336
|
-
c = 1;
|
2337
|
-
mid = mrb_intern_lit(mrb, "-");
|
2338
|
-
goto L_SEND_SYM;
|
2339
|
-
}
|
2340
|
-
NEXT;
|
2254
|
+
OP_MATH(sub);
|
2341
2255
|
}
|
2342
2256
|
|
2343
2257
|
CASE(OP_MUL, B) {
|
2344
|
-
|
2345
|
-
switch (TYPES2(mrb_type(regs[a]),mrb_type(regs[a+1]))) {
|
2346
|
-
case TYPES2(MRB_TT_FIXNUM,MRB_TT_FIXNUM):
|
2347
|
-
{
|
2348
|
-
mrb_int x, y, z;
|
2349
|
-
|
2350
|
-
x = mrb_fixnum(regs[a]);
|
2351
|
-
y = mrb_fixnum(regs[a+1]);
|
2352
|
-
if (mrb_int_mul_overflow(x, y, &z)) {
|
2353
|
-
#ifndef MRB_WITHOUT_FLOAT
|
2354
|
-
SET_FLOAT_VALUE(mrb, regs[a], (mrb_float)x * (mrb_float)y);
|
2355
|
-
break;
|
2356
|
-
#endif
|
2357
|
-
}
|
2358
|
-
SET_INT_VALUE(regs[a], z);
|
2359
|
-
}
|
2360
|
-
break;
|
2361
|
-
#ifndef MRB_WITHOUT_FLOAT
|
2362
|
-
case TYPES2(MRB_TT_FIXNUM,MRB_TT_FLOAT):
|
2363
|
-
{
|
2364
|
-
mrb_int x = mrb_fixnum(regs[a]);
|
2365
|
-
mrb_float y = mrb_float(regs[a+1]);
|
2366
|
-
SET_FLOAT_VALUE(mrb, regs[a], (mrb_float)x * y);
|
2367
|
-
}
|
2368
|
-
break;
|
2369
|
-
case TYPES2(MRB_TT_FLOAT,MRB_TT_FIXNUM):
|
2370
|
-
#ifdef MRB_WORD_BOXING
|
2371
|
-
{
|
2372
|
-
mrb_float x = mrb_float(regs[a]);
|
2373
|
-
mrb_int y = mrb_fixnum(regs[a+1]);
|
2374
|
-
SET_FLOAT_VALUE(mrb, regs[a], x * y);
|
2375
|
-
}
|
2376
|
-
#else
|
2377
|
-
OP_MATH_BODY(*,mrb_float,mrb_fixnum);
|
2378
|
-
#endif
|
2379
|
-
break;
|
2380
|
-
case TYPES2(MRB_TT_FLOAT,MRB_TT_FLOAT):
|
2381
|
-
#ifdef MRB_WORD_BOXING
|
2382
|
-
{
|
2383
|
-
mrb_float x = mrb_float(regs[a]);
|
2384
|
-
mrb_float y = mrb_float(regs[a+1]);
|
2385
|
-
SET_FLOAT_VALUE(mrb, regs[a], x * y);
|
2386
|
-
}
|
2387
|
-
#else
|
2388
|
-
OP_MATH_BODY(*,mrb_float,mrb_float);
|
2389
|
-
#endif
|
2390
|
-
break;
|
2391
|
-
#endif
|
2392
|
-
default:
|
2393
|
-
c = 1;
|
2394
|
-
mid = mrb_intern_lit(mrb, "*");
|
2395
|
-
goto L_SEND_SYM;
|
2396
|
-
}
|
2397
|
-
NEXT;
|
2258
|
+
OP_MATH(mul);
|
2398
2259
|
}
|
2399
2260
|
|
2400
2261
|
CASE(OP_DIV, B) {
|
@@ -2449,84 +2310,46 @@ RETRY_TRY_BLOCK:
|
|
2449
2310
|
NEXT;
|
2450
2311
|
}
|
2451
2312
|
|
2452
|
-
|
2453
|
-
|
2454
|
-
|
2455
|
-
|
2456
|
-
|
2457
|
-
|
2458
|
-
|
2459
|
-
|
2460
|
-
|
2461
|
-
|
2462
|
-
|
2463
|
-
|
2464
|
-
|
2465
|
-
|
2466
|
-
|
2467
|
-
|
2468
|
-
|
2469
|
-
|
2470
|
-
|
2471
|
-
|
2472
|
-
|
2473
|
-
|
2474
|
-
|
2475
|
-
|
2476
|
-
}
|
2313
|
+
#define OP_MATHI(op_name) \
|
2314
|
+
/* need to check if op is overridden */ \
|
2315
|
+
switch (mrb_type(regs[a])) { \
|
2316
|
+
OP_MATHI_CASE_FIXNUM(op_name); \
|
2317
|
+
OP_MATHI_CASE_FLOAT(op_name); \
|
2318
|
+
default: \
|
2319
|
+
SET_INT_VALUE(regs[a+1], b); \
|
2320
|
+
c = 1; \
|
2321
|
+
mid = mrb_intern_lit(mrb, MRB_STRINGIZE(OP_MATH_OP_##op_name)); \
|
2322
|
+
goto L_SEND_SYM; \
|
2323
|
+
} \
|
2324
|
+
NEXT;
|
2325
|
+
#define OP_MATHI_CASE_FIXNUM(op_name) \
|
2326
|
+
case MRB_TT_FIXNUM: \
|
2327
|
+
{ \
|
2328
|
+
mrb_int x = mrb_fixnum(regs[a]), y = (mrb_int)b, z; \
|
2329
|
+
if (mrb_int_##op_name##_overflow(x, y, &z)) \
|
2330
|
+
OP_MATH_OVERFLOW_INT(op_name, x, y, z); \
|
2331
|
+
else \
|
2332
|
+
SET_INT_VALUE(regs[a], z); \
|
2333
|
+
} \
|
2334
|
+
break
|
2335
|
+
#ifdef MRB_WITHOUT_FLOAT
|
2336
|
+
#define OP_MATHI_CASE_FLOAT(op_name) (void)0
|
2477
2337
|
#else
|
2478
|
-
|
2479
|
-
|
2480
|
-
|
2338
|
+
#define OP_MATHI_CASE_FLOAT(op_name) \
|
2339
|
+
case MRB_TT_FLOAT: \
|
2340
|
+
{ \
|
2341
|
+
mrb_float z = mrb_float(regs[a]) OP_MATH_OP_##op_name b; \
|
2342
|
+
SET_FLOAT_VALUE(mrb, regs[a], z); \
|
2343
|
+
} \
|
2344
|
+
break
|
2481
2345
|
#endif
|
2482
|
-
|
2483
|
-
|
2484
|
-
|
2485
|
-
mid = mrb_intern_lit(mrb, "+");
|
2486
|
-
goto L_SEND_SYM;
|
2487
|
-
}
|
2488
|
-
NEXT;
|
2346
|
+
|
2347
|
+
CASE(OP_ADDI, BB) {
|
2348
|
+
OP_MATHI(add);
|
2489
2349
|
}
|
2490
2350
|
|
2491
2351
|
CASE(OP_SUBI, BB) {
|
2492
|
-
|
2493
|
-
|
2494
|
-
/* need to check if + is overridden */
|
2495
|
-
switch (mrb_type(regs_a[0])) {
|
2496
|
-
case MRB_TT_FIXNUM:
|
2497
|
-
{
|
2498
|
-
mrb_int x = mrb_fixnum(regs_a[0]);
|
2499
|
-
mrb_int y = (mrb_int)b;
|
2500
|
-
mrb_int z;
|
2501
|
-
|
2502
|
-
if (mrb_int_sub_overflow(x, y, &z)) {
|
2503
|
-
#ifndef MRB_WITHOUT_FLOAT
|
2504
|
-
SET_FLOAT_VALUE(mrb, regs_a[0], (mrb_float)x - (mrb_float)y);
|
2505
|
-
break;
|
2506
|
-
#endif
|
2507
|
-
}
|
2508
|
-
SET_INT_VALUE(regs_a[0], z);
|
2509
|
-
}
|
2510
|
-
break;
|
2511
|
-
#ifndef MRB_WITHOUT_FLOAT
|
2512
|
-
case MRB_TT_FLOAT:
|
2513
|
-
#ifdef MRB_WORD_BOXING
|
2514
|
-
{
|
2515
|
-
mrb_float x = mrb_float(regs[a]);
|
2516
|
-
SET_FLOAT_VALUE(mrb, regs[a], (mrb_float)x - (mrb_float)b);
|
2517
|
-
}
|
2518
|
-
#else
|
2519
|
-
mrb_float(regs_a[0]) -= b;
|
2520
|
-
#endif
|
2521
|
-
break;
|
2522
|
-
#endif
|
2523
|
-
default:
|
2524
|
-
SET_INT_VALUE(regs_a[1], b);
|
2525
|
-
c = 1;
|
2526
|
-
mid = mrb_intern_lit(mrb, "-");
|
2527
|
-
goto L_SEND_SYM;
|
2528
|
-
}
|
2529
|
-
NEXT;
|
2352
|
+
OP_MATHI(sub);
|
2530
2353
|
}
|
2531
2354
|
|
2532
2355
|
#define OP_CMP_BODY(op,v1,v2) (v1(regs[a]) op v2(regs[a+1]))
|
@@ -2627,7 +2450,12 @@ RETRY_TRY_BLOCK:
|
|
2627
2450
|
|
2628
2451
|
CASE(OP_ARYCAT, B) {
|
2629
2452
|
mrb_value splat = mrb_ary_splat(mrb, regs[a+1]);
|
2630
|
-
|
2453
|
+
if (mrb_nil_p(regs[a])) {
|
2454
|
+
regs[a] = splat;
|
2455
|
+
}
|
2456
|
+
else {
|
2457
|
+
mrb_ary_concat(mrb, regs[a], splat);
|
2458
|
+
}
|
2631
2459
|
mrb_gc_arena_restore(mrb, ai);
|
2632
2460
|
NEXT;
|
2633
2461
|
}
|
@@ -3018,14 +2846,15 @@ mrb_top_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int sta
|
|
3018
2846
|
return mrb_vm_run(mrb, proc, self, stack_keep);
|
3019
2847
|
}
|
3020
2848
|
if (mrb->c->ci == mrb->c->cibase) {
|
2849
|
+
mrb->c->ci->env = NULL;
|
3021
2850
|
return mrb_vm_run(mrb, proc, self, stack_keep);
|
3022
2851
|
}
|
3023
2852
|
ci = cipush(mrb);
|
2853
|
+
ci->stackent = mrb->c->stack;
|
3024
2854
|
ci->mid = 0;
|
3025
2855
|
ci->acc = CI_ACC_SKIP;
|
3026
2856
|
ci->target_class = mrb->object_class;
|
3027
2857
|
v = mrb_vm_run(mrb, proc, self, stack_keep);
|
3028
|
-
cipop(mrb);
|
3029
2858
|
|
3030
2859
|
return v;
|
3031
2860
|
}
|