diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-08-19 07:29:46 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-08-19 07:29:46 +0900 |
| commit | b5e2d208b9030290dffffa47f2591b19b731287d (patch) | |
| tree | d604a4bc678fbf10708d71273dc6d8997093f7aa /doc | |
| parent | fe8428b33bfb337dbaca4d0af917b386b550039f (diff) | |
| parent | b5299b1c5832a4eb9d6c6becfab76d76570c91ab (diff) | |
| download | mruby-b5e2d208b9030290dffffa47f2591b19b731287d.tar.gz mruby-b5e2d208b9030290dffffa47f2591b19b731287d.zip | |
Merge pull request #4636 from davidsiaw/doxygen
Generate doxygen docs for mruby
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/guides/compile.md | 80 | ||||
| -rw-r--r-- | doc/limitations.md | 50 | ||||
| -rw-r--r-- | doc/mruby_logo_red_icon.png | bin | 0 -> 3755 bytes | |||
| -rw-r--r-- | doc/opcode.md | 188 |
4 files changed, 159 insertions, 159 deletions
diff --git a/doc/guides/compile.md b/doc/guides/compile.md index 4c8378946..6a093310a 100644 --- a/doc/guides/compile.md +++ b/doc/guides/compile.md @@ -6,11 +6,11 @@ binaries. ## Prerequisites To compile mruby out of the source code you need the following tools: -* C Compiler (e.g. ```gcc```) -* Linker (e.g. ```gcc```) -* Archive utility (e.g. ```ar```) -* Parser generator (e.g. ```bison```) -* Ruby 2.0 or later (e.g. ```ruby``` or ```jruby```) +* C Compiler (e.g. `gcc`) +* Linker (e.g. `gcc`) +* Archive utility (e.g. `ar`) +* Parser generator (e.g. `bison`) +* Ruby 2.0 or later (e.g. `ruby` or `jruby`) Optional: * GIT (to update mruby source and integrate mrbgems easier) @@ -32,10 +32,10 @@ All tools necessary to compile mruby can be set or modified here. In case you want to maintain an additional *build_config.rb* you can define a customized path using the *$MRUBY_CONFIG* environment variable. -To compile just call ```./minirake``` inside of the mruby source root. To -generate and execute the test tools call ```./minirake test```. To clean -all build files call ```./minirake clean```. To see full command line on -build, call ```./minirake -v```. +To compile just call `./minirake` inside of the mruby source root. To +generate and execute the test tools call `./minirake test`. To clean +all build files call `./minirake clean`. To see full command line on +build, call `./minirake -v`. ## Build Configuration @@ -79,7 +79,7 @@ toolchain :android ``` Requires the custom standalone Android NDK and the toolchain path -in ```ANDROID_STANDALONE_TOOLCHAIN```. +in `ANDROID_STANDALONE_TOOLCHAIN`. ### Binaries @@ -97,7 +97,7 @@ conf.gem "#{root}/mrbgems/mruby-bin-mirb" ### File Separator Some environments require a different file separator character. It is possible to -set the character via ```conf.file_separator```. +set the character via `conf.file_separator`. ```ruby conf.file_separator = '/' ``` @@ -119,7 +119,7 @@ end C Compiler has header searcher to detect installed library. -If you need a include path of header file use ```search_header_path```: +If you need a include path of header file use `search_header_path`: ```ruby # Searches ```iconv.h```. # If found it will return include path of the header file. @@ -127,7 +127,7 @@ If you need a include path of header file use ```search_header_path```: fail 'iconv.h not found' unless conf.cc.search_header_path 'iconv.h' ``` -If you need a full file name of header file use ```search_header```: +If you need a full file name of header file use `search_header`: ```ruby # Searches ```iconv.h```. # If found it will return full path of the header file. @@ -136,11 +136,11 @@ iconv_h = conf.cc.search_header 'iconv.h' print "iconv.h found: #{iconv_h}\n" ``` -Header searcher uses compiler's ```include_paths``` by default. +Header searcher uses compiler's `include_paths` by default. When you are using GCC toolchain (including clang toolchain since its base is gcc toolchain) -it will use compiler specific include paths too. (For example ```/usr/local/include```, ```/usr/include```) +it will use compiler specific include paths too. (For example `/usr/local/include`, `/usr/include`) -If you need a special header search paths define a singleton method ```header_search_paths``` to C compiler: +If you need a special header search paths define a singleton method `header_search_paths` to C compiler: ```ruby def conf.cc.header_search_paths ['/opt/local/include'] + include_paths @@ -222,7 +222,7 @@ See doc/mrbgems/README.md for more option about mrbgems. Configuration Mrbtest build process. -If you want mrbtest.a only, You should set ```conf.build_mrbtest_lib_only``` +If you want mrbtest.a only, You should set `conf.build_mrbtest_lib_only` ```ruby conf.build_mrbtest_lib_only ``` @@ -230,9 +230,9 @@ conf.build_mrbtest_lib_only ### Bintest Tests for mrbgem tools using CRuby. -To have bintests place \*.rb scripts to ```bintest/``` directory of mrbgems. -See ```mruby-bin-*/bintest/*.rb``` if you need examples. -If you want a temporary files use `tempfile` module of CRuby instead of ```/tmp/```. +To have bintests place \*.rb scripts to `bintest/` directory of mrbgems. +See `mruby-bin-*/bintest/*.rb` if you need examples. +If you want a temporary files use `tempfile` module of CRuby instead of `/tmp/`. You can enable it with following: ```ruby @@ -247,8 +247,8 @@ correctly. To support mrbgems written in C++, mruby can be configured to use C++ exception. There are two levels of C++ exception handling. The one is -```enable_cxx_exception``` that enables C++ exception, but -uses C ABI. The other is ```enable_cxx_abi``` where all +`enable_cxx_exception` that enables C++ exception, but +uses C ABI. The other is `enable_cxx_abi` where all files are compiled by C++ compiler. When you mix C++ code, C++ exception would be enabled automatically. @@ -266,7 +266,7 @@ C++ exception, add following: conf.disable_cxx_exception ``` and you will get an error when you try to use C++ gem. -Note that it must be called before ```enable_cxx_exception``` or ```gem``` method. +Note that it must be called before `enable_cxx_exception` or `gem` method. ### Debugging mode @@ -276,17 +276,17 @@ conf.enable_debug ``` When debugging mode is enabled -* Macro ```MRB_DEBUG``` would be defined. - * Which means ```mrb_assert()``` macro is enabled. -* Debug information of irep would be generated by ```mrbc```. - * Because ```-g``` flag would be added to ```mrbc``` runner. +* Macro `MRB_DEBUG` would be defined. + * Which means `mrb_assert()` macro is enabled. +* Debug information of irep would be generated by `mrbc`. + * Because `-g` flag would be added to `mrbc` runner. * You can have better backtrace of mruby scripts with this. ## Cross-Compilation mruby can also be cross-compiled from one platform to another. To achieve this the *build_config.rb* needs to contain an instance of -```MRuby::CrossBuild```. This instance defines the compilation +`MRuby::CrossBuild`. This instance defines the compilation tools and flags for the target platform. An example could look like this: ```ruby @@ -298,12 +298,12 @@ MRuby::CrossBuild.new('32bit') do |conf| end ``` -All configuration options of ```MRuby::Build``` can also be used -in ```MRuby::CrossBuild```. +All configuration options of `MRuby::Build` can also be used +in `MRuby::CrossBuild`. ### Mrbtest in Cross-Compilation -In cross compilation, you can run ```mrbtest``` on emulator if +In cross compilation, you can run `mrbtest` on emulator if you have it by changing configuration of test runner. ```ruby conf.test_runner do |t| @@ -350,15 +350,15 @@ in *build/host/src*) result will be stored in *build/host/src/y.tab.c*) * compile *build/host/src/y.tab.c* to *build/host/src/y.tab.o* * create *build/host/lib/libmruby_core.a* out of all object files (C only) -* create ```build/host/bin/mrbc``` by compiling *tools/mrbc/mrbc.c* and +* create `build/host/bin/mrbc` by compiling *tools/mrbc/mrbc.c* and linking with *build/host/lib/libmruby_core.a* * create *build/host/mrblib/mrblib.c* by compiling all \*.rb files -under *mrblib* with ```build/host/bin/mrbc``` +under *mrblib* with `build/host/bin/mrbc` * compile *build/host/mrblib/mrblib.c* to *build/host/mrblib/mrblib.o* * create *build/host/lib/libmruby.a* out of all object files (C and Ruby) -* create ```build/host/bin/mruby``` by compiling *mrbgems/mruby-bin-mruby/tools/mruby/mruby.c* and +* create `build/host/bin/mruby` by compiling *mrbgems/mruby-bin-mruby/tools/mruby/mruby.c* and linking with *build/host/lib/libmruby.a* -* create ```build/host/bin/mirb``` by compiling *mrbgems/mruby-bin-mirb/tools/mirb/mirb.c* and +* create `build/host/bin/mirb` by compiling *mrbgems/mruby-bin-mirb/tools/mirb/mirb.c* and linking with *build/host/lib/libmruby.a* ``` @@ -427,15 +427,15 @@ in *build/i386/src*) result will be stored in *build/i386/src/y.tab.c*) * cross-compile *build/i386/src/y.tab.c* to *build/i386/src/y.tab.o* * create *build/i386/mrblib/mrblib.c* by compiling all \*.rb files -under *mrblib* with the native ```build/host/bin/mrbc``` +under *mrblib* with the native `build/host/bin/mrbc` * cross-compile *build/host/mrblib/mrblib.c* to *build/host/mrblib/mrblib.o* * create *build/i386/lib/libmruby.a* out of all object files (C and Ruby) -* create ```build/i386/bin/mruby``` by cross-compiling *mrbgems/mruby-bin-mruby/tools/mruby/mruby.c* and +* create `build/i386/bin/mruby` by cross-compiling *mrbgems/mruby-bin-mruby/tools/mruby/mruby.c* and linking with *build/i386/lib/libmruby.a* -* create ```build/i386/bin/mirb``` by cross-compiling *mrbgems/mruby-bin-mirb/tools/mirb/mirb.c* and +* create `build/i386/bin/mirb` by cross-compiling *mrbgems/mruby-bin-mirb/tools/mirb/mirb.c* and linking with *build/i386/lib/libmruby.a* * create *build/i386/lib/libmruby_core.a* out of all object files (C only) -* create ```build/i386/bin/mrbc``` by cross-compiling *tools/mrbc/mrbc.c* and +* create `build/i386/bin/mrbc` by cross-compiling *tools/mrbc/mrbc.c* and linking with *build/i386/lib/libmruby_core.a* ``` @@ -482,7 +482,7 @@ all usages of stdio and doesn't compile any binaries (e.g. mrbc). ## Test Environment mruby's build process includes a test environment. In case you start the testing -of mruby, a native binary called ```mrbtest``` will be generated and executed. +of mruby, a native binary called `mrbtest` will be generated and executed. This binary contains all test cases which are defined under *test/t*. In case of a cross-compilation an additional cross-compiled *mrbtest* binary is generated. You can copy this binary and run on your target system. diff --git a/doc/limitations.md b/doc/limitations.md index 9b4ed9c6f..20e2dc52f 100644 --- a/doc/limitations.md +++ b/doc/limitations.md @@ -14,17 +14,17 @@ This document does not contain a complete list of limitations. Please help to improve it by submitting your findings. -## ```1/2``` gives ```0.5``` +## `1/2` gives `0.5` -Since mruby does not have ```Bignum```, bigger integers are represented -by ```Float``` numbers. To enhance interoperability between ```Fixnum``` -and ```Float```, mruby provides ```Float#upto``` and other iterating -methods for the ```Float``` class. As a side effect, ```1/2``` gives ```0.5``` -not ```0```. +Since mruby does not have `Bignum`, bigger integers are represented +by `Float` numbers. To enhance interoperability between `Fixnum` +and `Float`, mruby provides `Float#upto` and other iterating +methods for the `Float` class. As a side effect, `1/2` gives `0.5` +not `0`. -## ```Array``` passed to ```puts``` +## `Array` passed to `puts` -Passing an Array to ```puts``` results in different output. +Passing an Array to `puts` results in different output. ```ruby puts [1,2,3] @@ -44,9 +44,9 @@ puts [1,2,3] [1, 2, 3] ``` -## ```Kernel.raise``` in rescue clause +## `Kernel.raise` in rescue clause -```Kernel.raise``` without arguments does not raise the current exception within +`Kernel.raise` without arguments does not raise the current exception within a rescue clause. ```ruby @@ -59,7 +59,7 @@ end #### Ruby [ruby 2.0.0p645 (2015-04-13 revision 50299)] -```ZeroDivisionError``` is raised. +`ZeroDivisionError` is raised. #### mruby [2.0.1 (2019-4-4)] @@ -67,13 +67,13 @@ No exception is raised. ## Fiber execution can't cross C function boundary -mruby's ```Fiber``` is implemented in a similar way to Lua's co-routine. This +mruby's `Fiber` is implemented in a similar way to Lua's co-routine. This results in the consequence that you can't switch context within C functions. -Only exception is ```mrb_fiber_yield``` at return. +Only exception is `mrb_fiber_yield` at return. -## ```Array``` does not support instance variables +## `Array` does not support instance variables -To reduce memory consumption ```Array``` does not support instance variables. +To reduce memory consumption `Array` does not support instance variables. ```ruby class Liste < Array @@ -87,11 +87,11 @@ p Liste.new "foobar" #### Ruby [ruby 2.0.0p645 (2015-04-13 revision 50299)] -``` [] ``` +` [] ` #### mruby [2.0.1 (2019-4-4)] -```ArgumentError``` is raised. +`ArgumentError` is raised. ## Method visibility @@ -128,8 +128,8 @@ true ## defined? -The ```defined?``` keyword is considered too complex to be fully -implemented. It is recommended to use ```const_defined?``` and +The `defined?` keyword is considered too complex to be fully +implemented. It is recommended to use `const_defined?` and other reflection methods instead. ```ruby @@ -144,9 +144,9 @@ nil #### mruby [2.0.1 (2019-4-4)] -```NameError``` is raised. +`NameError` is raised. -## ```alias``` on global variables +## `alias` on global variables Aliasing a global variable works in CRuby but is not part of the ISO standard. @@ -157,7 +157,7 @@ alias $a $__a__ #### Ruby [ruby 2.0.0p645 (2015-04-13 revision 50299)] -``` nil ``` +` nil ` #### mruby [2.0.1 (2019-4-4)] @@ -178,12 +178,12 @@ end #### Ruby [ruby 2.0.0p645 (2015-04-13 revision 50299)] -```ArgumentError``` is raised. -The re-defined ```+``` operator does not accept any arguments. +`ArgumentError` is raised. +The re-defined `+` operator does not accept any arguments. #### mruby [2.0.1 (2019-4-4)] -``` 'ab' ``` +` 'ab' ` Behavior of the operator wasn't changed. ## Kernel#binding is not supported diff --git a/doc/mruby_logo_red_icon.png b/doc/mruby_logo_red_icon.png Binary files differnew file mode 100644 index 000000000..084908542 --- /dev/null +++ b/doc/mruby_logo_red_icon.png diff --git a/doc/opcode.md b/doc/opcode.md index eab82a26f..574a3c83f 100644 --- a/doc/opcode.md +++ b/doc/opcode.md @@ -31,97 +31,97 @@ with `"`, either `OP_EXT1` or `OP_EXT2` or `OP_EXT2` can be prefixed. ## table.1 Instruction Table -|Instruction Name |Operand type |Semantics -|-----------------|-------------|----------------- -|OP_NOP | - | -|OP_MOVE" |BB |R(a) = R(b) -|OP_LOADL" |BB |R(a) = Pool(b) -|OP_LOADI" |BsB |R(a) = mrb_int(b) -|OP_LOADI_0' |B |R(a) = 0 -|OP_LOADI_1' |B |R(a) = 1 -|OP_LOADI_2' |B |R(a) = 2 -|OP_LOADI_3' |B |R(a) = 3 -|OP_LOADSYM" |BB |R(a) = Syms(b) -|OP_LOADNIL' |B |R(a) = nil -|OP_LOADSELF' |B |R(a) = self -|OP_LOADT' |B |R(a) = true -|OP_LOADF' |B |R(a) = false -|OP_GETGV" |BB |R(a) = getglobal(Syms(b)) -|OP_SETGV" |BB |setglobal(Syms(b), R(a)) -|OP_GETSV" |BB |R(a) = Special[b] -|OP_SETSV" |BB |Special[b] = R(a) -|OP_GETIV" |BB |R(a) = ivget(Syms(b)) -|OP_SETIV" |BB |ivset(Syms(b),R(a)) -|OP_GETCV" |BB |R(a) = cvget(Syms(b)) -|OP_SETCV" |BB |cvset(Syms(b),R(a)) -|OP_GETCONST" |BB |R(a) = constget(Syms(b)) -|OP_SETCONST" |BB |constset(Syms(b),R(a)) -|OP_GETMCNST" |BB |R(a) = R(a)::Syms(b) -|OP_SETMCNST" |BB |R(a+1)::Syms(b) = R(a) -|OP_GETUPVAR' |BBB |R(a) = uvget(b,c) -|OP_SETUPVAR' |BBB |uvset(b,c,R(a)) -|OP_JMP |S |pc+=a -|OP_JMPIF' |SB |if R(b) pc+=a -|OP_JMPNOT' |SB |if !R(b) pc+=a -|OP_ONERR |sS |rescue_push(pc+a) -|OP_EXCEPT' |B |R(a) = exc -|OP_RESCUE" |BB |R(b) = R(a).isa?(R(b)) -|OP_POPERR |B |a.times{rescue_pop()} -|OP_RAISE' |B |raise(R(a)) -|OP_EPUSH' |B |ensure_push(SEQ[a]) -|OP_EPOP |B |A.times{ensure_pop().call} -|OP_SENDV" |BB |R(a) = call(R(a),Syms(b),*R(a+1)) -|OP_SENDVB" |BB |R(a) = call(R(a),Syms(b),*R(a+1),&R(a+2)) -|OP_SEND" |BBB |R(a) = call(R(a),Syms(b),R(a+1),...,R(a+c)) -|OP_SENDB" |BBB |R(a) = call(R(a),Syms(Bx),R(a+1),...,R(a+c),&R(a+c+1)) -|OP_CALL' |B |R(a) = self.call(frame.argc, frame.argv) -|OP_SUPER' |BB |R(a) = super(R(a+1),... ,R(a+b+1)) -|OP_ARGARY' |BS |R(a) = argument array (16=5:1:5:1:4) -|OP_ENTER |W |arg setup according to flags (23=5:5:1:5:5:1:1) -|OP_KARG" |BB |R(a) = kdict[Syms(Bx)] # todo -|OP_KARG2" |BB |R(a) = kdict[Syms(Bx)]; kdict.rm(Syms(b)) # todo -|OP_RETURN' |B |return R(a) (normal) -|OP_RETURN_BLK' |B |return R(a) (in-block return) -|OP_BREAK' |B |break R(a) -|OP_BLKPUSH' |BS |R(a) = block (16=5:1:5:1:4) -|OP_ADD" |BB |R(a) = R(a)+R(a+1) -|OP_ADDI" |BBB |R(a) = R(a)+mrb_int(c) -|OP_SUB" |BB |R(a) = R(a)-R(a+1) -|OP_SUBI" |BB |R(a) = R(a)-C -|OP_MUL" |BB |R(a) = R(a)*R(a+1) -|OP_DIV" |BB |R(a) = R(a)/R(a+1) -|OP_EQ" |BB |R(a) = R(a)==R(a+1) -|OP_LT" |BB |R(a) = R(a)<R(a+1) -|OP_LE" |BB |R(a) = R(a)<=R(a+1) -|OP_GT" |BB |R(a) = R(a)>R(a+1) -|OP_GE" |BB |R(a) = R(a)>=R(a+1) -|OP_ARRAY' |BB |R(a) = ary_new(R(a),R(a+1)..R(a+b)) -|OP_ARRAY2" |BB |R(a) = ary_new(R(b),R(b+1)..R(b+c)) -|OP_ARYCAT' |B |ary_cat(R(a),R(a+1)) -|OP_ARYPUSH' |B |ary_push(R(a),R(a+1)) -|OP_AREF' |BB |R(a) = R(a)[b] -|OP_ASET' |BB |R(a)[b] = R(a+1) -|OP_APOST' |BB |*R(a),R(A+1)..R(A+C) = R(a)[B..] -|OP_STRING" |BB |R(a) = str_dup(Lit(b)) -|OP_STRCAT' |B |str_cat(R(a),R(a+1)) -|OP_HASH' |BB |R(a) = hash_new(R(a),R(a+1)..R(a+b)) -|OP_HASHADD' |BB |R(a) = hash_push(R(a),R(a+1)..R(a+b)) -|OP_LAMBDA" |BB |R(a) = lambda(SEQ[b],OP_L_LAMBDA) -|OP_BLOCK" |BB |R(a) = lambda(SEQ[b],OP_L_BLOCK) -|OP_METHOD" |BB |R(a) = lambda(SEQ[b],OP_L_METHOD) -|OP_RANGE_INC' |B |R(a) = range_new(R(a),R(a+1),FALSE) -|OP_RANGE_EXC' |B |R(a) = range_new(R(a),R(a+1),TRUE) -|OP_OCLASS' |B |R(a) = ::Object -|OP_CLASS" |BB |R(a) = newclass(R(a),Syms(b),R(a+1)) -|OP_MODULE" |BB |R(a) = newmodule(R(a),Syms(b)) -|OP_EXEC" |BB |R(a) = blockexec(R(a),SEQ[b]) -|OP_DEF" |BB |R(a).newmethod(Syms(b),R(a+1)) -|OP_ALIAS' |B |alias_method(R(a),R(a+1),R(a+2)) -|OP_UNDEF" |BB |undef_method(R(a),Syms(b)) -|OP_SCLASS' |B |R(a) = R(a).singleton_class -|OP_TCLASS' |B |R(a) = target_class -|OP_ERR' |B |raise(RuntimeError, Lit(Bx)) -|OP_EXT1 |- |make 1st operand 16bit -|OP_EXT2 |- |make 2nd operand 16bit -|OP_EXT3 |- |make 1st and 2nd operands 16bit -|OP_STOP |- |stop VM +| Instruction Name | Operand type | Semantics | +|:-----------------|--------------|---------------------| +| OP_NOP | - | | +| OP_MOVE" | BB | R(a) = R(b) +| OP_LOADL" | BB | R(a) = Pool(b) +| OP_LOADI" | BsB | R(a) = mrb_int(b) +| OP_LOADI_0' | B | R(a) = 0 +| OP_LOADI_1' | B | R(a) = 1 +| OP_LOADI_2' | B | R(a) = 2 +| OP_LOADI_3' | B | R(a) = 3 +| OP_LOADSYM" | BB | R(a) = Syms(b) +| OP_LOADNIL' | B | R(a) = nil +| OP_LOADSELF' | B | R(a) = self +| OP_LOADT' | B | R(a) = true +| OP_LOADF' | B | R(a) = false +| OP_GETGV" | BB | R(a) = getglobal(Syms(b)) +| OP_SETGV" | BB | setglobal(Syms(b), R(a)) +| OP_GETSV" | BB | R(a) = Special[b] +| OP_SETSV" | BB | Special[b] = R(a) +| OP_GETIV" | BB | R(a) = ivget(Syms(b)) +| OP_SETIV" | BB | ivset(Syms(b),R(a)) +| OP_GETCV" | BB | R(a) = cvget(Syms(b)) +| OP_SETCV" | BB | cvset(Syms(b),R(a)) +| OP_GETCONST" | BB | R(a) = constget(Syms(b)) +| OP_SETCONST" | BB | constset(Syms(b),R(a)) +| OP_GETMCNST" | BB | R(a) = R(a)::Syms(b) +| OP_SETMCNST" | BB | R(a+1)::Syms(b) = R(a) +| OP_GETUPVAR' | BBB | R(a) = uvget(b,c) +| OP_SETUPVAR' | BBB | uvset(b,c,R(a)) +| OP_JMP | S | pc+=a +| OP_JMPIF' | SB | if R(b) pc+=a +| OP_JMPNOT' | SB | if !R(b) pc+=a +| OP_ONERR | sS | rescue_push(pc+a) +| OP_EXCEPT' | B | R(a) = exc +| OP_RESCUE" | BB | R(b) = R(a).isa?(R(b)) +| OP_POPERR | B | a.times{rescue_pop()} +| OP_RAISE' | B | raise(R(a)) +| OP_EPUSH' | B | ensure_push(SEQ[a]) +| OP_EPOP | B | A.times{ensure_pop().call} +| OP_SENDV" | BB | R(a) = call(R(a),Syms(b),*R(a+1)) +| OP_SENDVB" | BB | R(a) = call(R(a),Syms(b),*R(a+1),&R(a+2)) +| OP_SEND" | BBB | R(a) = call(R(a),Syms(b),R(a+1),...,R(a+c)) +| OP_SENDB" | BBB | R(a) = call(R(a),Syms(Bx),R(a+1),...,R(a+c),&R(a+c+1)) +| OP_CALL' | B | R(a) = self.call(frame.argc, frame.argv) +| OP_SUPER' | BB | R(a) = super(R(a+1),... ,R(a+b+1)) +| OP_ARGARY' | BS | R(a) = argument array (16=5:1:5:1:4) +| OP_ENTER | W | arg setup according to flags (23=5:5:1:5:5:1:1) +| OP_KARG" | BB | R(a) = kdict[Syms(Bx)] # todo +| OP_KARG2" | BB | R(a) = kdict[Syms(Bx)]; kdict.rm(Syms(b)) # todo +| OP_RETURN' | B | return R(a) (normal) +| OP_RETURN_BLK' | B | return R(a) (in-block return) +| OP_BREAK' | B | break R(a) +| OP_BLKPUSH' | BS | R(a) = block (16=5:1:5:1:4) +| OP_ADD" | BB | R(a) = R(a)+R(a+1) +| OP_ADDI" | BBB | R(a) = R(a)+mrb_int(c) +| OP_SUB" | BB | R(a) = R(a)-R(a+1) +| OP_SUBI" | BB | R(a) = R(a)-C +| OP_MUL" | BB | R(a) = R(a)*R(a+1) +| OP_DIV" | BB | R(a) = R(a)/R(a+1) +| OP_EQ" | BB | R(a) = R(a)==R(a+1) +| OP_LT" | BB | R(a) = R(a)<R(a+1) +| OP_LE" | BB | R(a) = R(a)<=R(a+1) +| OP_GT" | BB | R(a) = R(a)>R(a+1) +| OP_GE" | BB | R(a) = R(a)>=R(a+1) +| OP_ARRAY' | BB | R(a) = ary_new(R(a),R(a+1)..R(a+b)) +| OP_ARRAY2" | BB | R(a) = ary_new(R(b),R(b+1)..R(b+c)) +| OP_ARYCAT' | B | ary_cat(R(a),R(a+1)) +| OP_ARYPUSH' | B | ary_push(R(a),R(a+1)) +| OP_AREF' | BB | R(a) = R(a)[b] +| OP_ASET' | BB | R(a)[b] = R(a+1) +| OP_APOST' | BB | *R(a),R(A+1)..R(A+C) = R(a)[B..] +| OP_STRING" | BB | R(a) = str_dup(Lit(b)) +| OP_STRCAT' | B | str_cat(R(a),R(a+1)) +| OP_HASH' | BB | R(a) = hash_new(R(a),R(a+1)..R(a+b)) +| OP_HASHADD' | BB | R(a) = hash_push(R(a),R(a+1)..R(a+b)) +| OP_LAMBDA" | BB | R(a) = lambda(SEQ[b],OP_L_LAMBDA) +| OP_BLOCK" | BB | R(a) = lambda(SEQ[b],OP_L_BLOCK) +| OP_METHOD" | BB | R(a) = lambda(SEQ[b],OP_L_METHOD) +| OP_RANGE_INC' | B | R(a) = range_new(R(a),R(a+1),FALSE) +| OP_RANGE_EXC' | B | R(a) = range_new(R(a),R(a+1),TRUE) +| OP_OCLASS' | B | R(a) = ::Object +| OP_CLASS" | BB | R(a) = newclass(R(a),Syms(b),R(a+1)) +| OP_MODULE" | BB | R(a) = newmodule(R(a),Syms(b)) +| OP_EXEC" | BB | R(a) = blockexec(R(a),SEQ[b]) +| OP_DEF" | BB | R(a).newmethod(Syms(b),R(a+1)) +| OP_ALIAS' | B | alias_method(R(a),R(a+1),R(a+2)) +| OP_UNDEF" | BB | undef_method(R(a),Syms(b)) +| OP_SCLASS' | B | R(a) = R(a).singleton_class +| OP_TCLASS' | B | R(a) = target_class +| OP_ERR' | B | raise(RuntimeError, Lit(Bx)) +| OP_EXT1 | - | make 1st operand 16bit +| OP_EXT2 | - | make 2nd operand 16bit +| OP_EXT3 | - | make 1st and 2nd operands 16bit +| OP_STOP | - | stop VM |
