ruby2d 0.10.0 → 0.11.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/include/SDL2/SDL.h +108 -14
- data/assets/include/SDL2/SDL_assert.h +81 -50
- data/assets/include/SDL2/SDL_atomic.h +135 -35
- data/assets/include/SDL2/SDL_audio.h +960 -355
- data/assets/include/SDL2/SDL_bits.h +11 -6
- data/assets/include/SDL2/SDL_blendmode.h +91 -14
- data/assets/include/SDL2/SDL_clipboard.h +30 -7
- data/assets/include/SDL2/SDL_config.h +3 -1
- data/assets/include/SDL2/SDL_config_android.h +11 -1
- data/assets/include/SDL2/SDL_config_emscripten.h +216 -0
- data/assets/include/SDL2/SDL_config_iphoneos.h +9 -1
- data/assets/include/SDL2/SDL_config_macosx.h +16 -2
- data/assets/include/SDL2/SDL_config_minimal.h +4 -1
- data/assets/include/SDL2/SDL_config_os2.h +37 -20
- data/assets/include/SDL2/SDL_config_pandora.h +6 -1
- data/assets/include/SDL2/SDL_config_psp.h +8 -8
- data/assets/include/SDL2/SDL_config_windows.h +39 -22
- data/assets/include/SDL2/SDL_config_winrt.h +23 -8
- data/assets/include/SDL2/SDL_config_wiz.h +6 -1
- data/assets/include/SDL2/SDL_copying.h +1 -1
- data/assets/include/SDL2/SDL_cpuinfo.h +331 -71
- data/assets/include/SDL2/SDL_egl.h +906 -280
- data/assets/include/SDL2/SDL_endian.h +101 -47
- data/assets/include/SDL2/SDL_error.h +70 -19
- data/assets/include/SDL2/SDL_events.h +387 -79
- data/assets/include/SDL2/SDL_filesystem.h +73 -64
- data/assets/include/SDL2/SDL_gamecontroller.h +585 -125
- data/assets/include/SDL2/SDL_gesture.h +36 -6
- data/assets/include/SDL2/SDL_haptic.h +304 -210
- data/assets/include/SDL2/SDL_hidapi.h +451 -0
- data/assets/include/SDL2/SDL_hints.h +1286 -897
- data/assets/include/SDL2/SDL_joystick.h +577 -130
- data/assets/include/SDL2/SDL_keyboard.h +162 -63
- data/assets/include/SDL2/SDL_keycode.h +7 -5
- data/assets/include/SDL2/SDL_loadso.h +42 -8
- data/assets/include/SDL2/SDL_locale.h +34 -32
- data/assets/include/SDL2/SDL_log.h +212 -19
- data/assets/include/SDL2/SDL_main.h +72 -17
- data/assets/include/SDL2/SDL_messagebox.h +70 -23
- data/assets/include/SDL2/SDL_metal.h +27 -32
- data/assets/include/SDL2/SDL_misc.h +19 -15
- data/assets/include/SDL2/SDL_mouse.h +262 -110
- data/assets/include/SDL2/SDL_mutex.h +286 -66
- data/assets/include/SDL2/SDL_name.h +1 -1
- data/assets/include/SDL2/SDL_opengl.h +1 -1
- data/assets/include/SDL2/SDL_opengles.h +1 -1
- data/assets/include/SDL2/SDL_opengles2.h +2 -2
- data/assets/include/SDL2/SDL_pixels.h +199 -34
- data/assets/include/SDL2/SDL_platform.h +39 -2
- data/assets/include/SDL2/SDL_power.h +23 -10
- data/assets/include/SDL2/SDL_quit.h +1 -1
- data/assets/include/SDL2/SDL_rect.h +78 -28
- data/assets/include/SDL2/SDL_render.h +1204 -472
- data/assets/include/SDL2/SDL_revision.h +2 -2
- data/assets/include/SDL2/SDL_rwops.h +605 -33
- data/assets/include/SDL2/SDL_scancode.h +1 -1
- data/assets/include/SDL2/SDL_sensor.h +76 -42
- data/assets/include/SDL2/SDL_shape.h +38 -27
- data/assets/include/SDL2/SDL_stdinc.h +96 -24
- data/assets/include/SDL2/SDL_surface.h +571 -139
- data/assets/include/SDL2/SDL_system.h +339 -101
- data/assets/include/SDL2/SDL_syswm.h +50 -20
- data/assets/include/SDL2/SDL_test.h +1 -1
- data/assets/include/SDL2/SDL_test_assert.h +2 -2
- data/assets/include/SDL2/SDL_test_common.h +23 -6
- data/assets/include/SDL2/SDL_test_compare.h +1 -1
- data/assets/include/SDL2/SDL_test_crc32.h +1 -1
- data/assets/include/SDL2/SDL_test_font.h +3 -3
- data/assets/include/SDL2/SDL_test_fuzzer.h +28 -26
- data/assets/include/SDL2/SDL_test_harness.h +6 -6
- data/assets/include/SDL2/SDL_test_images.h +1 -1
- data/assets/include/SDL2/SDL_test_log.h +1 -1
- data/assets/include/SDL2/SDL_test_md5.h +1 -1
- data/assets/include/SDL2/SDL_test_memory.h +1 -1
- data/assets/include/SDL2/SDL_test_random.h +2 -2
- data/assets/include/SDL2/SDL_thread.h +226 -128
- data/assets/include/SDL2/SDL_timer.h +129 -22
- data/assets/include/SDL2/SDL_touch.h +48 -8
- data/assets/include/SDL2/SDL_ttf.h +102 -9
- data/assets/include/SDL2/SDL_types.h +1 -1
- data/assets/include/SDL2/SDL_version.h +72 -46
- data/assets/include/SDL2/SDL_video.h +1266 -460
- data/assets/include/SDL2/SDL_vulkan.h +100 -161
- data/assets/include/SDL2/begin_code.h +22 -1
- data/assets/include/SDL2/close_code.h +1 -1
- data/assets/include/mrbconf.h +234 -0
- data/assets/include/mruby/array.h +317 -0
- data/assets/include/mruby/boxing_nan.h +130 -0
- data/assets/include/mruby/boxing_no.h +58 -0
- data/assets/include/mruby/boxing_word.h +205 -0
- data/assets/include/mruby/class.h +108 -0
- data/assets/include/mruby/common.h +92 -0
- data/assets/include/mruby/compile.h +210 -0
- data/assets/include/mruby/data.h +76 -0
- data/assets/include/mruby/debug.h +66 -0
- data/assets/include/mruby/dump.h +158 -0
- data/assets/include/mruby/endian.h +44 -0
- data/assets/include/mruby/error.h +137 -0
- data/assets/include/mruby/gc.h +92 -0
- data/assets/include/mruby/hash.h +242 -0
- data/assets/include/mruby/irep.h +147 -0
- data/assets/include/mruby/istruct.h +50 -0
- data/assets/include/mruby/khash.h +284 -0
- data/assets/include/mruby/numeric.h +169 -0
- data/assets/include/mruby/object.h +43 -0
- data/assets/include/mruby/opcode.h +43 -0
- data/assets/include/mruby/ops.h +122 -0
- data/assets/include/mruby/presym/disable.h +70 -0
- data/assets/include/mruby/presym/enable.h +37 -0
- data/assets/include/mruby/presym/scanning.h +73 -0
- data/assets/include/mruby/presym.h +40 -0
- data/assets/include/mruby/proc.h +209 -0
- data/assets/include/mruby/range.h +79 -0
- data/assets/include/mruby/re.h +16 -0
- data/assets/include/mruby/string.h +469 -0
- data/assets/include/mruby/throw.h +66 -0
- data/assets/include/mruby/value.h +400 -0
- data/assets/include/mruby/variable.h +140 -0
- data/assets/include/mruby/version.h +143 -0
- data/assets/include/mruby.h +1444 -0
- data/assets/macos/universal/bin/mrbc +0 -0
- data/assets/macos/universal/lib/libFLAC.a +0 -0
- data/assets/macos/universal/lib/libSDL2.a +0 -0
- data/assets/macos/universal/lib/libSDL2_image.a +0 -0
- data/assets/macos/{lib → universal/lib}/libSDL2_mixer.a +0 -0
- data/assets/macos/universal/lib/libSDL2_ttf.a +0 -0
- data/assets/macos/universal/lib/libfreetype.a +0 -0
- data/assets/macos/universal/lib/libgraphite2.a +0 -0
- data/assets/macos/universal/lib/libharfbuzz.a +0 -0
- data/assets/macos/universal/lib/libjpeg.a +0 -0
- data/assets/macos/universal/lib/libmodplug.a +0 -0
- data/assets/macos/{lib → universal/lib}/libmpg123.a +0 -0
- data/assets/{mingw/lib/libSDL2.a → macos/universal/lib/libmruby.a} +0 -0
- data/assets/macos/{lib → universal/lib}/libogg.a +0 -0
- data/assets/macos/universal/lib/libpng16.a +0 -0
- data/assets/macos/universal/lib/libtiff.a +0 -0
- data/assets/macos/universal/lib/libvorbis.a +0 -0
- data/assets/macos/universal/lib/libvorbisfile.a +0 -0
- data/assets/macos/universal/lib/libwebp.a +0 -0
- data/assets/test_media/README.md +3 -0
- data/assets/test_media/bitstream_vera/COPYRIGHT.txt +124 -0
- data/assets/test_media/bitstream_vera/vera.ttf +0 -0
- data/assets/test_media/boom.png +0 -0
- data/assets/test_media/coin.png +0 -0
- data/assets/test_media/colors.png +0 -0
- data/assets/test_media/controller.png +0 -0
- data/assets/test_media/dial.wav +0 -0
- data/assets/test_media/hero.png +0 -0
- data/assets/test_media/image.bmp +0 -0
- data/assets/test_media/image.jpg +0 -0
- data/assets/test_media/image.png +0 -0
- data/assets/test_media/music.flac +0 -0
- data/assets/test_media/music.mp3 +0 -0
- data/assets/test_media/music.ogg +0 -0
- data/assets/test_media/music.wav +0 -0
- data/assets/test_media/originals/boom.pxm +0 -0
- data/assets/test_media/originals/coin.pxm +0 -0
- data/assets/test_media/originals/controller.sketch +0 -0
- data/assets/test_media/originals/hero.pxm +0 -0
- data/assets/test_media/originals/image.pxm +0 -0
- data/assets/test_media/originals/music.caf +0 -0
- data/assets/test_media/originals/texture_atlas.pxm +0 -0
- data/assets/test_media/rondo_alla_turka.ogg +0 -0
- data/assets/test_media/sound.flac +0 -0
- data/assets/test_media/sound.mp3 +0 -0
- data/assets/test_media/sound.ogg +0 -0
- data/assets/test_media/sound.wav +0 -0
- data/assets/test_media/sprite_sheet.png +0 -0
- data/assets/test_media/texture_atlas.png +0 -0
- data/assets/wasm/build_config.rb +13 -0
- data/assets/wasm/libmruby.a +0 -0
- data/assets/wasm/template.html +17 -0
- data/assets/windows/glew/README.md +10 -0
- data/assets/windows/glew/glew.h +23686 -0
- data/assets/{mingw/lib → windows/glew}/libglew32.a +0 -0
- data/assets/windows/mingw-w64-x86_64/bin/mrbc.exe +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libFLAC.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libLerc.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libSDL2.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libSDL2_image.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libSDL2_mixer.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libSDL2_ttf.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libbrotlicommon.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libbrotlidec.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libbz2.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libdeflate.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libfreetype.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libglew32.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libgraphite2.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libharfbuzz.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libjbig.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libjpeg.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/liblzma.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libmodplug.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libmpg123.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libmruby.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libogg.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libopus.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libopusfile.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libpng16.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libsndfile.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libssp.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libstdc++.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libtiff.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libvorbis.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libvorbisfile.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libwebp.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libz.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libzstd.a +0 -0
- data/assets/{ios → xcode/ios}/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
- data/assets/{ios → xcode/ios}/Assets.xcassets/Contents.json +0 -0
- data/assets/{ios → xcode/ios}/Base.lproj/LaunchScreen.storyboard +0 -0
- data/assets/{ios → xcode/ios}/Info.plist +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mrbconf.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/array.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/class.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/common.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/compile.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/data.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/debug.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/dump.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/error.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/gc.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/hash.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/irep.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/istruct.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/khash.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/numeric.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/object.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/opcode.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/ops.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/proc.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/range.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/re.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/string.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/throw.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/value.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/variable.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby/version.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Headers/mruby.h +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/Info.plist +0 -0
- data/assets/{ios → xcode/ios}/MRuby.framework/MRuby +0 -0
- data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.pbxproj +0 -0
- data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
- data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
- data/assets/{ios → xcode/ios}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
- data/assets/{ios → xcode/ios}/main.c +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Assets.xcassets/LaunchImage.launchimage/Contents.json +0 -0
- data/assets/{tvos → xcode/tvos}/Info.plist +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mrbconf.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/array.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_nan.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_no.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/boxing_word.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/class.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/common.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/compile.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/data.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/debug.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/dump.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/error.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/gc.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/hash.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/irep.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/istruct.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/khash.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/numeric.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/object.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/opcode.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/ops.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/proc.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/range.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/re.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/string.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/throw.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/value.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/variable.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby/version.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Headers/mruby.h +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/Info.plist +0 -0
- data/assets/{tvos → xcode/tvos}/MRuby.framework/MRuby +0 -0
- data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.pbxproj +0 -0
- data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -0
- data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
- data/assets/{tvos → xcode/tvos}/MyApp.xcodeproj/project.xcworkspace/xcshareddata/MyApp.xcscmblueprint +0 -0
- data/assets/{tvos → xcode/tvos}/main.c +0 -0
- data/bin/ruby2d +3 -4
- data/ext/ruby2d/extconf.rb +68 -46
- data/ext/ruby2d/font.c +35 -0
- data/ext/ruby2d/gl.c +9 -58
- data/ext/ruby2d/gl2.c +8 -83
- data/ext/ruby2d/gl3.c +57 -116
- data/ext/ruby2d/gles.c +130 -151
- data/ext/ruby2d/image.c +16 -96
- data/ext/ruby2d/ruby2d.c +265 -298
- data/ext/ruby2d/ruby2d.h +69 -159
- data/ext/ruby2d/sound.c +1 -1
- data/ext/ruby2d/text.c +20 -114
- data/ext/ruby2d/window.c +257 -219
- data/lib/ruby2d/circle.rb +3 -1
- data/lib/ruby2d/cli/build.rb +239 -59
- data/lib/ruby2d/cli/colorize.rb +5 -4
- data/lib/ruby2d/cli/platform.rb +17 -0
- data/lib/ruby2d/font.rb +26 -1
- data/lib/ruby2d/image.rb +22 -17
- data/lib/ruby2d/line.rb +3 -1
- data/lib/ruby2d/quad.rb +3 -1
- data/lib/ruby2d/rectangle.rb +1 -1
- data/lib/ruby2d/renderable.rb +0 -12
- data/lib/ruby2d/sound.rb +25 -0
- data/lib/ruby2d/sprite.rb +44 -89
- data/lib/ruby2d/square.rb +1 -1
- data/lib/ruby2d/text.rb +40 -20
- data/lib/ruby2d/texture.rb +28 -0
- data/lib/ruby2d/tileset.rb +47 -28
- data/lib/ruby2d/triangle.rb +3 -1
- data/lib/ruby2d/version.rb +1 -1
- data/lib/ruby2d/vertices.rb +89 -0
- data/lib/ruby2d/window.rb +13 -3
- data/lib/ruby2d.rb +16 -20
- metadata +249 -153
- data/assets/README.md +0 -22
- data/assets/Rakefile +0 -85
- data/assets/macos/lib/libFLAC.a +0 -0
- data/assets/macos/lib/libSDL2.a +0 -0
- data/assets/macos/lib/libSDL2_image.a +0 -0
- data/assets/macos/lib/libSDL2_ttf.a +0 -0
- data/assets/macos/lib/libfreetype.a +0 -0
- data/assets/macos/lib/libjpeg.a +0 -0
- data/assets/macos/lib/libpng16.a +0 -0
- data/assets/macos/lib/libtiff.a +0 -0
- data/assets/macos/lib/libvorbis.a +0 -0
- data/assets/macos/lib/libvorbisfile.a +0 -0
- data/assets/macos/lib/libwebp.a +0 -0
- data/assets/mingw/bin/SDL2.dll +0 -0
- data/assets/mingw/bin/SDL2_image.dll +0 -0
- data/assets/mingw/bin/SDL2_mixer.dll +0 -0
- data/assets/mingw/bin/SDL2_ttf.dll +0 -0
- data/assets/mingw/bin/glew32.dll +0 -0
- data/assets/mingw/bin/libFLAC-8.dll +0 -0
- data/assets/mingw/bin/libfreetype-6.dll +0 -0
- data/assets/mingw/bin/libjpeg-9.dll +0 -0
- data/assets/mingw/bin/libmodplug-1.dll +0 -0
- data/assets/mingw/bin/libmpg123-0.dll +0 -0
- data/assets/mingw/bin/libogg-0.dll +0 -0
- data/assets/mingw/bin/libopus-0.dll +0 -0
- data/assets/mingw/bin/libopusfile-0.dll +0 -0
- data/assets/mingw/bin/libpng16-16.dll +0 -0
- data/assets/mingw/bin/libtiff-5.dll +0 -0
- data/assets/mingw/bin/libvorbis-0.dll +0 -0
- data/assets/mingw/bin/libvorbisfile-3.dll +0 -0
- data/assets/mingw/bin/libwebp-7.dll +0 -0
- data/assets/mingw/bin/zlib1.dll +0 -0
- data/assets/mingw/lib/libSDL2.dll.a +0 -0
- data/assets/mingw/lib/libSDL2_image.a +0 -0
- data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
- data/assets/mingw/lib/libSDL2_mixer.a +0 -0
- data/assets/mingw/lib/libSDL2_mixer.dll.a +0 -0
- data/assets/mingw/lib/libSDL2_test.a +0 -0
- data/assets/mingw/lib/libSDL2_ttf.a +0 -0
- data/assets/mingw/lib/libSDL2_ttf.dll.a +0 -0
- data/assets/mingw/lib/libSDL2main.a +0 -0
- data/assets/mingw/lib/libglew32.dll.a +0 -0
- data/ext/ruby2d/sprite.c +0 -147
- data/ext/ruby2d/tileset.c +0 -30
@@ -0,0 +1,284 @@
|
|
1
|
+
/**
|
2
|
+
** @file mruby/khash.h - Hash for mruby
|
3
|
+
**
|
4
|
+
** See Copyright Notice in mruby.h
|
5
|
+
*/
|
6
|
+
|
7
|
+
#ifndef MRUBY_KHASH_H
|
8
|
+
#define MRUBY_KHASH_H
|
9
|
+
|
10
|
+
#include <string.h>
|
11
|
+
|
12
|
+
#include <mruby.h>
|
13
|
+
#include "common.h"
|
14
|
+
|
15
|
+
/**
|
16
|
+
* khash definitions used in mruby's hash table.
|
17
|
+
*/
|
18
|
+
MRB_BEGIN_DECL
|
19
|
+
|
20
|
+
typedef uint32_t khint_t;
|
21
|
+
typedef khint_t khiter_t;
|
22
|
+
|
23
|
+
#ifndef KHASH_DEFAULT_SIZE
|
24
|
+
# define KHASH_DEFAULT_SIZE 32
|
25
|
+
#endif
|
26
|
+
#define KHASH_MIN_SIZE 8
|
27
|
+
|
28
|
+
#define UPPER_BOUND(x) ((x)>>2|(x)>>1)
|
29
|
+
|
30
|
+
/* extern uint8_t __m[]; */
|
31
|
+
|
32
|
+
/* mask for flags */
|
33
|
+
static const uint8_t __m_empty[] = {0x02, 0x08, 0x20, 0x80};
|
34
|
+
static const uint8_t __m_del[] = {0x01, 0x04, 0x10, 0x40};
|
35
|
+
static const uint8_t __m_either[] = {0x03, 0x0c, 0x30, 0xc0};
|
36
|
+
|
37
|
+
|
38
|
+
#define __ac_isempty(ed_flag, i) (ed_flag[(i)/4]&__m_empty[(i)%4])
|
39
|
+
#define __ac_isdel(ed_flag, i) (ed_flag[(i)/4]&__m_del[(i)%4])
|
40
|
+
#define __ac_iseither(ed_flag, i) (ed_flag[(i)/4]&__m_either[(i)%4])
|
41
|
+
#define khash_power2(v) do { \
|
42
|
+
v--;\
|
43
|
+
v |= v >> 1;\
|
44
|
+
v |= v >> 2;\
|
45
|
+
v |= v >> 4;\
|
46
|
+
v |= v >> 8;\
|
47
|
+
v |= v >> 16;\
|
48
|
+
v++;\
|
49
|
+
} while (0)
|
50
|
+
#define khash_mask(h) ((h)->n_buckets-1)
|
51
|
+
#define khash_upper_bound(h) (UPPER_BOUND((h)->n_buckets))
|
52
|
+
|
53
|
+
/* declare struct kh_xxx and kh_xxx_funcs
|
54
|
+
|
55
|
+
name: hash name
|
56
|
+
khkey_t: key data type
|
57
|
+
khval_t: value data type
|
58
|
+
kh_is_map: (0: hash set / 1: hash map)
|
59
|
+
*/
|
60
|
+
#define KHASH_DECLARE(name, khkey_t, khval_t, kh_is_map) \
|
61
|
+
typedef struct kh_##name { \
|
62
|
+
khint_t n_buckets; \
|
63
|
+
khint_t size; \
|
64
|
+
uint8_t *ed_flags; \
|
65
|
+
khkey_t *keys; \
|
66
|
+
khval_t *vals; \
|
67
|
+
} kh_##name##_t; \
|
68
|
+
void kh_alloc_##name(mrb_state *mrb, kh_##name##_t *h); \
|
69
|
+
kh_##name##_t *kh_init_##name##_size(mrb_state *mrb, khint_t size); \
|
70
|
+
kh_##name##_t *kh_init_##name(mrb_state *mrb); \
|
71
|
+
void kh_destroy_##name(mrb_state *mrb, kh_##name##_t *h); \
|
72
|
+
void kh_clear_##name(mrb_state *mrb, kh_##name##_t *h); \
|
73
|
+
khint_t kh_get_##name(mrb_state *mrb, kh_##name##_t *h, khkey_t key); \
|
74
|
+
khint_t kh_put_##name(mrb_state *mrb, kh_##name##_t *h, khkey_t key, int *ret); \
|
75
|
+
void kh_resize_##name(mrb_state *mrb, kh_##name##_t *h, khint_t new_n_buckets); \
|
76
|
+
void kh_del_##name(mrb_state *mrb, kh_##name##_t *h, khint_t x); \
|
77
|
+
kh_##name##_t *kh_copy_##name(mrb_state *mrb, kh_##name##_t *h);
|
78
|
+
|
79
|
+
static inline void
|
80
|
+
kh_fill_flags(uint8_t *p, uint8_t c, size_t len)
|
81
|
+
{
|
82
|
+
while (len-- > 0) {
|
83
|
+
*p++ = c;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
/* define kh_xxx_funcs
|
88
|
+
|
89
|
+
name: hash name
|
90
|
+
khkey_t: key data type
|
91
|
+
khval_t: value data type
|
92
|
+
kh_is_map: (0: hash set / 1: hash map)
|
93
|
+
__hash_func: hash function
|
94
|
+
__hash_equal: hash comparison function
|
95
|
+
*/
|
96
|
+
#define KHASH_DEFINE(name, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \
|
97
|
+
mrb_noreturn void mrb_raise_nomemory(mrb_state *mrb); \
|
98
|
+
int kh_alloc_simple_##name(mrb_state *mrb, kh_##name##_t *h) \
|
99
|
+
{ \
|
100
|
+
khint_t sz = h->n_buckets; \
|
101
|
+
size_t len = sizeof(khkey_t) + (kh_is_map ? sizeof(khval_t) : 0); \
|
102
|
+
uint8_t *p = (uint8_t*)mrb_malloc_simple(mrb, sizeof(uint8_t)*sz/4+len*sz); \
|
103
|
+
if (!p) { return 1; } \
|
104
|
+
h->size = 0; \
|
105
|
+
h->keys = (khkey_t *)p; \
|
106
|
+
h->vals = kh_is_map ? (khval_t *)(p+sizeof(khkey_t)*sz) : NULL; \
|
107
|
+
h->ed_flags = p+len*sz; \
|
108
|
+
kh_fill_flags(h->ed_flags, 0xaa, sz/4); \
|
109
|
+
return 0; \
|
110
|
+
} \
|
111
|
+
void kh_alloc_##name(mrb_state *mrb, kh_##name##_t *h) \
|
112
|
+
{ \
|
113
|
+
if (kh_alloc_simple_##name(mrb, h)) { \
|
114
|
+
mrb_raise_nomemory(mrb); \
|
115
|
+
} \
|
116
|
+
} \
|
117
|
+
kh_##name##_t *kh_init_##name##_size(mrb_state *mrb, khint_t size) { \
|
118
|
+
kh_##name##_t *h = (kh_##name##_t*)mrb_calloc(mrb, 1, sizeof(kh_##name##_t)); \
|
119
|
+
if (size < KHASH_MIN_SIZE) \
|
120
|
+
size = KHASH_MIN_SIZE; \
|
121
|
+
khash_power2(size); \
|
122
|
+
h->n_buckets = size; \
|
123
|
+
if (kh_alloc_simple_##name(mrb, h)) { \
|
124
|
+
mrb_free(mrb, h); \
|
125
|
+
mrb_raise_nomemory(mrb); \
|
126
|
+
} \
|
127
|
+
return h; \
|
128
|
+
} \
|
129
|
+
kh_##name##_t *kh_init_##name(mrb_state *mrb) { \
|
130
|
+
return kh_init_##name##_size(mrb, KHASH_DEFAULT_SIZE); \
|
131
|
+
} \
|
132
|
+
void kh_destroy_##name(mrb_state *mrb, kh_##name##_t *h) \
|
133
|
+
{ \
|
134
|
+
if (h) { \
|
135
|
+
mrb_free(mrb, h->keys); \
|
136
|
+
mrb_free(mrb, h); \
|
137
|
+
} \
|
138
|
+
} \
|
139
|
+
void kh_clear_##name(mrb_state *mrb, kh_##name##_t *h) \
|
140
|
+
{ \
|
141
|
+
(void)mrb; \
|
142
|
+
if (h && h->ed_flags) { \
|
143
|
+
kh_fill_flags(h->ed_flags, 0xaa, h->n_buckets/4); \
|
144
|
+
h->size = 0; \
|
145
|
+
} \
|
146
|
+
} \
|
147
|
+
khint_t kh_get_##name(mrb_state *mrb, kh_##name##_t *h, khkey_t key) \
|
148
|
+
{ \
|
149
|
+
khint_t k = __hash_func(mrb,key) & khash_mask(h), step = 0; \
|
150
|
+
(void)mrb; \
|
151
|
+
while (!__ac_isempty(h->ed_flags, k)) { \
|
152
|
+
if (!__ac_isdel(h->ed_flags, k)) { \
|
153
|
+
if (__hash_equal(mrb,h->keys[k], key)) return k; \
|
154
|
+
} \
|
155
|
+
k = (k+(++step)) & khash_mask(h); \
|
156
|
+
} \
|
157
|
+
return kh_end(h); \
|
158
|
+
} \
|
159
|
+
void kh_resize_##name(mrb_state *mrb, kh_##name##_t *h, khint_t new_n_buckets) \
|
160
|
+
{ \
|
161
|
+
if (new_n_buckets < KHASH_MIN_SIZE) \
|
162
|
+
new_n_buckets = KHASH_MIN_SIZE; \
|
163
|
+
khash_power2(new_n_buckets); \
|
164
|
+
{ \
|
165
|
+
kh_##name##_t hh; \
|
166
|
+
uint8_t *old_ed_flags = h->ed_flags; \
|
167
|
+
khkey_t *old_keys = h->keys; \
|
168
|
+
khval_t *old_vals = h->vals; \
|
169
|
+
khint_t old_n_buckets = h->n_buckets; \
|
170
|
+
khint_t i; \
|
171
|
+
hh.n_buckets = new_n_buckets; \
|
172
|
+
kh_alloc_##name(mrb, &hh); \
|
173
|
+
/* relocate */ \
|
174
|
+
for (i=0 ; i<old_n_buckets ; i++) { \
|
175
|
+
if (!__ac_iseither(old_ed_flags, i)) { \
|
176
|
+
khint_t k = kh_put_##name(mrb, &hh, old_keys[i], NULL); \
|
177
|
+
if (kh_is_map) kh_value(&hh,k) = old_vals[i]; \
|
178
|
+
} \
|
179
|
+
} \
|
180
|
+
/* copy hh to h */ \
|
181
|
+
*h = hh; \
|
182
|
+
mrb_free(mrb, old_keys); \
|
183
|
+
} \
|
184
|
+
} \
|
185
|
+
khint_t kh_put_##name(mrb_state *mrb, kh_##name##_t *h, khkey_t key, int *ret) \
|
186
|
+
{ \
|
187
|
+
khint_t k, del_k, step = 0; \
|
188
|
+
if (h->size >= khash_upper_bound(h)) { \
|
189
|
+
kh_resize_##name(mrb, h, h->n_buckets*2); \
|
190
|
+
} \
|
191
|
+
k = __hash_func(mrb,key) & khash_mask(h); \
|
192
|
+
del_k = kh_end(h); \
|
193
|
+
while (!__ac_isempty(h->ed_flags, k)) { \
|
194
|
+
if (!__ac_isdel(h->ed_flags, k)) { \
|
195
|
+
if (__hash_equal(mrb,h->keys[k], key)) { \
|
196
|
+
if (ret) *ret = 0; \
|
197
|
+
return k; \
|
198
|
+
} \
|
199
|
+
} \
|
200
|
+
else if (del_k == kh_end(h)) { \
|
201
|
+
del_k = k; \
|
202
|
+
} \
|
203
|
+
k = (k+(++step)) & khash_mask(h); \
|
204
|
+
} \
|
205
|
+
if (del_k != kh_end(h)) { \
|
206
|
+
/* put at del */ \
|
207
|
+
h->keys[del_k] = key; \
|
208
|
+
h->ed_flags[del_k/4] &= ~__m_del[del_k%4]; \
|
209
|
+
h->size++; \
|
210
|
+
if (ret) *ret = 2; \
|
211
|
+
return del_k; \
|
212
|
+
} \
|
213
|
+
else { \
|
214
|
+
/* put at empty */ \
|
215
|
+
h->keys[k] = key; \
|
216
|
+
h->ed_flags[k/4] &= ~__m_empty[k%4]; \
|
217
|
+
h->size++; \
|
218
|
+
if (ret) *ret = 1; \
|
219
|
+
return k; \
|
220
|
+
} \
|
221
|
+
} \
|
222
|
+
void kh_del_##name(mrb_state *mrb, kh_##name##_t *h, khint_t x) \
|
223
|
+
{ \
|
224
|
+
(void)mrb; \
|
225
|
+
mrb_assert(x != h->n_buckets && !__ac_iseither(h->ed_flags, x)); \
|
226
|
+
h->ed_flags[x/4] |= __m_del[x%4]; \
|
227
|
+
h->size--; \
|
228
|
+
} \
|
229
|
+
kh_##name##_t *kh_copy_##name(mrb_state *mrb, kh_##name##_t *h) \
|
230
|
+
{ \
|
231
|
+
kh_##name##_t *h2; \
|
232
|
+
khiter_t k, k2; \
|
233
|
+
\
|
234
|
+
h2 = kh_init_##name(mrb); \
|
235
|
+
for (k = kh_begin(h); k != kh_end(h); k++) { \
|
236
|
+
if (kh_exist(h, k)) { \
|
237
|
+
k2 = kh_put_##name(mrb, h2, kh_key(h, k), NULL); \
|
238
|
+
if (kh_is_map) kh_value(h2, k2) = kh_value(h, k); \
|
239
|
+
} \
|
240
|
+
} \
|
241
|
+
return h2; \
|
242
|
+
}
|
243
|
+
|
244
|
+
|
245
|
+
#define khash_t(name) kh_##name##_t
|
246
|
+
|
247
|
+
#define kh_init_size(name,mrb,size) kh_init_##name##_size(mrb,size)
|
248
|
+
#define kh_init(name,mrb) kh_init_##name(mrb)
|
249
|
+
#define kh_destroy(name, mrb, h) kh_destroy_##name(mrb, h)
|
250
|
+
#define kh_clear(name, mrb, h) kh_clear_##name(mrb, h)
|
251
|
+
#define kh_resize(name, mrb, h, s) kh_resize_##name(mrb, h, s)
|
252
|
+
#define kh_put(name, mrb, h, k) kh_put_##name(mrb, h, k, NULL)
|
253
|
+
#define kh_put2(name, mrb, h, k, r) kh_put_##name(mrb, h, k, r)
|
254
|
+
#define kh_get(name, mrb, h, k) kh_get_##name(mrb, h, k)
|
255
|
+
#define kh_del(name, mrb, h, k) kh_del_##name(mrb, h, k)
|
256
|
+
#define kh_copy(name, mrb, h) kh_copy_##name(mrb, h)
|
257
|
+
|
258
|
+
#define kh_exist(h, x) (!__ac_iseither((h)->ed_flags, (x)))
|
259
|
+
#define kh_key(h, x) ((h)->keys[x])
|
260
|
+
#define kh_val(h, x) ((h)->vals[x])
|
261
|
+
#define kh_value(h, x) ((h)->vals[x])
|
262
|
+
#define kh_begin(h) (khint_t)(0)
|
263
|
+
#define kh_end(h) ((h)->n_buckets)
|
264
|
+
#define kh_size(h) ((h)->size)
|
265
|
+
#define kh_n_buckets(h) ((h)->n_buckets)
|
266
|
+
|
267
|
+
#define kh_int_hash_func(mrb,key) (khint_t)((key)^((key)<<2)^((key)>>2))
|
268
|
+
#define kh_int_hash_equal(mrb,a, b) (a == b)
|
269
|
+
#define kh_int64_hash_func(mrb,key) (khint_t)((key)>>33^(key)^(key)<<11)
|
270
|
+
#define kh_int64_hash_equal(mrb,a, b) (a == b)
|
271
|
+
static inline khint_t __ac_X31_hash_string(const char *s)
|
272
|
+
{
|
273
|
+
khint_t h = *s;
|
274
|
+
if (h) for (++s ; *s; ++s) h = (h << 5) - h + *s;
|
275
|
+
return h;
|
276
|
+
}
|
277
|
+
#define kh_str_hash_func(mrb,key) __ac_X31_hash_string(key)
|
278
|
+
#define kh_str_hash_equal(mrb,a, b) (strcmp(a, b) == 0)
|
279
|
+
|
280
|
+
typedef const char *kh_cstr_t;
|
281
|
+
|
282
|
+
MRB_END_DECL
|
283
|
+
|
284
|
+
#endif /* MRUBY_KHASH_H */
|
@@ -0,0 +1,169 @@
|
|
1
|
+
/**
|
2
|
+
** @file mruby/numeric.h - Numeric, Integer, Float class
|
3
|
+
**
|
4
|
+
** See Copyright Notice in mruby.h
|
5
|
+
*/
|
6
|
+
|
7
|
+
#ifndef MRUBY_NUMERIC_H
|
8
|
+
#define MRUBY_NUMERIC_H
|
9
|
+
|
10
|
+
#include "common.h"
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Numeric class and it's sub-classes.
|
14
|
+
*
|
15
|
+
* Integer and Float
|
16
|
+
*/
|
17
|
+
MRB_BEGIN_DECL
|
18
|
+
|
19
|
+
#define TYPED_POSFIXABLE(f,t) ((f) <= (t)MRB_FIXNUM_MAX)
|
20
|
+
#define TYPED_NEGFIXABLE(f,t) ((f) >= (t)MRB_FIXNUM_MIN)
|
21
|
+
#define TYPED_FIXABLE(f,t) (TYPED_POSFIXABLE(f,t) && TYPED_NEGFIXABLE(f,t))
|
22
|
+
#define POSFIXABLE(f) TYPED_POSFIXABLE(f,mrb_int)
|
23
|
+
#define NEGFIXABLE(f) TYPED_NEGFIXABLE(f,mrb_int)
|
24
|
+
#define FIXABLE(f) TYPED_FIXABLE(f,mrb_int)
|
25
|
+
#ifndef MRB_NO_FLOAT
|
26
|
+
#ifdef MRB_INT64
|
27
|
+
#define FIXABLE_FLOAT(f) ((f)>=-9223372036854775808.0 && (f)<9223372036854775808.0)
|
28
|
+
#else
|
29
|
+
#define FIXABLE_FLOAT(f) TYPED_FIXABLE(f,mrb_float)
|
30
|
+
#endif
|
31
|
+
#endif
|
32
|
+
|
33
|
+
#ifndef MRB_NO_FLOAT
|
34
|
+
MRB_API mrb_value mrb_flo_to_fixnum(mrb_state *mrb, mrb_value val);
|
35
|
+
#endif
|
36
|
+
MRB_API mrb_value mrb_fixnum_to_str(mrb_state *mrb, mrb_value x, mrb_int base);
|
37
|
+
/* ArgumentError if format string doesn't match /%(\.[0-9]+)?[aAeEfFgG]/ */
|
38
|
+
#ifndef MRB_NO_FLOAT
|
39
|
+
MRB_API mrb_value mrb_float_to_str(mrb_state *mrb, mrb_value x, const char *fmt);
|
40
|
+
MRB_API int mrb_float_to_cstr(mrb_state *mrb, char *buf, size_t len, const char *fmt, mrb_float f);
|
41
|
+
MRB_API mrb_float mrb_to_flo(mrb_state *mrb, mrb_value x);
|
42
|
+
#endif
|
43
|
+
|
44
|
+
MRB_API mrb_value mrb_num_plus(mrb_state *mrb, mrb_value x, mrb_value y);
|
45
|
+
MRB_API mrb_value mrb_num_minus(mrb_state *mrb, mrb_value x, mrb_value y);
|
46
|
+
MRB_API mrb_value mrb_num_mul(mrb_state *mrb, mrb_value x, mrb_value y);
|
47
|
+
|
48
|
+
#ifndef __has_builtin
|
49
|
+
#define __has_builtin(x) 0
|
50
|
+
#endif
|
51
|
+
|
52
|
+
#if (defined(__GNUC__) && __GNUC__ >= 5) || \
|
53
|
+
(__has_builtin(__builtin_add_overflow) && \
|
54
|
+
__has_builtin(__builtin_sub_overflow) && \
|
55
|
+
__has_builtin(__builtin_mul_overflow))
|
56
|
+
# define MRB_HAVE_TYPE_GENERIC_CHECKED_ARITHMETIC_BUILTINS
|
57
|
+
#endif
|
58
|
+
|
59
|
+
/*
|
60
|
+
// Clang 3.8 and 3.9 have problem compiling mruby in 32-bit mode, when MRB_INT64 is set
|
61
|
+
// because of missing __mulodi4 and similar functions in its runtime. We need to use custom
|
62
|
+
// implementation for them.
|
63
|
+
*/
|
64
|
+
#ifdef MRB_HAVE_TYPE_GENERIC_CHECKED_ARITHMETIC_BUILTINS
|
65
|
+
#if defined(__clang__) && (__clang_major__ == 3) && (__clang_minor__ >= 8) && \
|
66
|
+
defined(MRB_32BIT) && defined(MRB_INT64)
|
67
|
+
#undef MRB_HAVE_TYPE_GENERIC_CHECKED_ARITHMETIC_BUILTINS
|
68
|
+
#endif
|
69
|
+
#endif
|
70
|
+
|
71
|
+
#ifdef MRB_HAVE_TYPE_GENERIC_CHECKED_ARITHMETIC_BUILTINS
|
72
|
+
|
73
|
+
static inline mrb_bool
|
74
|
+
mrb_int_add_overflow(mrb_int augend, mrb_int addend, mrb_int *sum)
|
75
|
+
{
|
76
|
+
return __builtin_add_overflow(augend, addend, sum);
|
77
|
+
}
|
78
|
+
|
79
|
+
static inline mrb_bool
|
80
|
+
mrb_int_sub_overflow(mrb_int minuend, mrb_int subtrahend, mrb_int *difference)
|
81
|
+
{
|
82
|
+
return __builtin_sub_overflow(minuend, subtrahend, difference);
|
83
|
+
}
|
84
|
+
|
85
|
+
static inline mrb_bool
|
86
|
+
mrb_int_mul_overflow(mrb_int multiplier, mrb_int multiplicand, mrb_int *product)
|
87
|
+
{
|
88
|
+
return __builtin_mul_overflow(multiplier, multiplicand, product);
|
89
|
+
}
|
90
|
+
|
91
|
+
#else
|
92
|
+
|
93
|
+
#define MRB_INT_OVERFLOW_MASK ((mrb_uint)1 << (MRB_INT_BIT - 1))
|
94
|
+
|
95
|
+
static inline mrb_bool
|
96
|
+
mrb_int_add_overflow(mrb_int a, mrb_int b, mrb_int *c)
|
97
|
+
{
|
98
|
+
mrb_uint x = (mrb_uint)a;
|
99
|
+
mrb_uint y = (mrb_uint)b;
|
100
|
+
mrb_uint z = (mrb_uint)(x + y);
|
101
|
+
*c = (mrb_int)z;
|
102
|
+
return !!(((x ^ z) & (y ^ z)) & MRB_INT_OVERFLOW_MASK);
|
103
|
+
}
|
104
|
+
|
105
|
+
static inline mrb_bool
|
106
|
+
mrb_int_sub_overflow(mrb_int a, mrb_int b, mrb_int *c)
|
107
|
+
{
|
108
|
+
mrb_uint x = (mrb_uint)a;
|
109
|
+
mrb_uint y = (mrb_uint)b;
|
110
|
+
mrb_uint z = (mrb_uint)(x - y);
|
111
|
+
*c = (mrb_int)z;
|
112
|
+
return !!(((x ^ z) & (~y ^ z)) & MRB_INT_OVERFLOW_MASK);
|
113
|
+
}
|
114
|
+
|
115
|
+
static inline mrb_bool
|
116
|
+
mrb_int_mul_overflow(mrb_int a, mrb_int b, mrb_int *c)
|
117
|
+
{
|
118
|
+
#ifdef MRB_INT32
|
119
|
+
int64_t n = (int64_t)a * b;
|
120
|
+
*c = (mrb_int)n;
|
121
|
+
return n > MRB_INT_MAX || n < MRB_INT_MIN;
|
122
|
+
#else /* MRB_INT64 */
|
123
|
+
if (a > 0 && b > 0 && a > MRB_INT_MAX / b) return TRUE;
|
124
|
+
if (a < 0 && b > 0 && a < MRB_INT_MIN / b) return TRUE;
|
125
|
+
if (a > 0 && b < 0 && b < MRB_INT_MIN / a) return TRUE;
|
126
|
+
if (a < 0 && b < 0 && (a <= MRB_INT_MIN || b <= MRB_INT_MIN || -a > MRB_INT_MAX / -b))
|
127
|
+
return TRUE;
|
128
|
+
*c = a * b;
|
129
|
+
return FALSE;
|
130
|
+
#endif
|
131
|
+
}
|
132
|
+
|
133
|
+
#undef MRB_INT_OVERFLOW_MASK
|
134
|
+
|
135
|
+
#endif
|
136
|
+
|
137
|
+
#ifndef MRB_NO_FLOAT
|
138
|
+
# include <stdint.h>
|
139
|
+
# include <float.h>
|
140
|
+
|
141
|
+
# define MRB_FLT_RADIX FLT_RADIX
|
142
|
+
|
143
|
+
# ifdef MRB_USE_FLOAT32
|
144
|
+
# define MRB_FLT_MANT_DIG FLT_MANT_DIG
|
145
|
+
# define MRB_FLT_EPSILON FLT_EPSILON
|
146
|
+
# define MRB_FLT_DIG FLT_DIG
|
147
|
+
# define MRB_FLT_MIN_EXP FLT_MIN_EXP
|
148
|
+
# define MRB_FLT_MIN FLT_MIN
|
149
|
+
# define MRB_FLT_MIN_10_EXP FLT_MIN_10_EXP
|
150
|
+
# define MRB_FLT_MAX_EXP FLT_MAX_EXP
|
151
|
+
# define MRB_FLT_MAX FLT_MAX
|
152
|
+
# define MRB_FLT_MAX_10_EXP FLT_MAX_10_EXP
|
153
|
+
|
154
|
+
# else /* not MRB_USE_FLOAT32 */
|
155
|
+
# define MRB_FLT_MANT_DIG DBL_MANT_DIG
|
156
|
+
# define MRB_FLT_EPSILON DBL_EPSILON
|
157
|
+
# define MRB_FLT_DIG DBL_DIG
|
158
|
+
# define MRB_FLT_MIN_EXP DBL_MIN_EXP
|
159
|
+
# define MRB_FLT_MIN DBL_MIN
|
160
|
+
# define MRB_FLT_MIN_10_EXP DBL_MIN_10_EXP
|
161
|
+
# define MRB_FLT_MAX_EXP DBL_MAX_EXP
|
162
|
+
# define MRB_FLT_MAX DBL_MAX
|
163
|
+
# define MRB_FLT_MAX_10_EXP DBL_MAX_10_EXP
|
164
|
+
# endif /* MRB_USE_FLOAT32 */
|
165
|
+
#endif /* MRB_NO_FLOAT */
|
166
|
+
|
167
|
+
MRB_END_DECL
|
168
|
+
|
169
|
+
#endif /* MRUBY_NUMERIC_H */
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/**
|
2
|
+
** @file mruby/object.h - mruby object definition
|
3
|
+
**
|
4
|
+
** See Copyright Notice in mruby.h
|
5
|
+
*/
|
6
|
+
|
7
|
+
#ifndef MRUBY_OBJECT_H
|
8
|
+
#define MRUBY_OBJECT_H
|
9
|
+
|
10
|
+
#define MRB_OBJECT_HEADER \
|
11
|
+
struct RClass *c; \
|
12
|
+
struct RBasic *gcnext; \
|
13
|
+
enum mrb_vtype tt:8; \
|
14
|
+
uint32_t color:3; \
|
15
|
+
uint32_t flags:21
|
16
|
+
|
17
|
+
#define MRB_FLAG_TEST(obj, flag) ((obj)->flags & (flag))
|
18
|
+
|
19
|
+
struct RBasic {
|
20
|
+
MRB_OBJECT_HEADER;
|
21
|
+
};
|
22
|
+
#define mrb_basic_ptr(v) ((struct RBasic*)(mrb_ptr(v)))
|
23
|
+
|
24
|
+
#define MRB_FL_OBJ_IS_FROZEN (1 << 20)
|
25
|
+
#define MRB_FROZEN_P(o) ((o)->flags & MRB_FL_OBJ_IS_FROZEN)
|
26
|
+
#define MRB_SET_FROZEN_FLAG(o) ((o)->flags |= MRB_FL_OBJ_IS_FROZEN)
|
27
|
+
#define MRB_UNSET_FROZEN_FLAG(o) ((o)->flags &= ~MRB_FL_OBJ_IS_FROZEN)
|
28
|
+
#define mrb_frozen_p(o) MRB_FROZEN_P(o)
|
29
|
+
|
30
|
+
struct RObject {
|
31
|
+
MRB_OBJECT_HEADER;
|
32
|
+
struct iv_tbl *iv;
|
33
|
+
};
|
34
|
+
#define mrb_obj_ptr(v) ((struct RObject*)(mrb_ptr(v)))
|
35
|
+
|
36
|
+
#define mrb_special_const_p(x) mrb_immediate_p(x)
|
37
|
+
|
38
|
+
struct RFiber {
|
39
|
+
MRB_OBJECT_HEADER;
|
40
|
+
struct mrb_context *cxt;
|
41
|
+
};
|
42
|
+
|
43
|
+
#endif /* MRUBY_OBJECT_H */
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/**
|
2
|
+
** @file mruby/opcode.h - RiteVM operation codes
|
3
|
+
**
|
4
|
+
** See Copyright Notice in mruby.h
|
5
|
+
*/
|
6
|
+
|
7
|
+
#ifndef MRUBY_OPCODE_H
|
8
|
+
#define MRUBY_OPCODE_H
|
9
|
+
|
10
|
+
enum mrb_insn {
|
11
|
+
#define OPCODE(x,_) OP_ ## x,
|
12
|
+
#include "mruby/ops.h"
|
13
|
+
#undef OPCODE
|
14
|
+
};
|
15
|
+
|
16
|
+
#define OP_L_STRICT 1
|
17
|
+
#define OP_L_CAPTURE 2
|
18
|
+
#define OP_L_METHOD OP_L_STRICT
|
19
|
+
#define OP_L_LAMBDA (OP_L_STRICT|OP_L_CAPTURE)
|
20
|
+
#define OP_L_BLOCK OP_L_CAPTURE
|
21
|
+
|
22
|
+
#define OP_R_NORMAL 0
|
23
|
+
#define OP_R_BREAK 1
|
24
|
+
#define OP_R_RETURN 2
|
25
|
+
|
26
|
+
#define PEEK_B(pc) (*(pc))
|
27
|
+
#define PEEK_S(pc) ((pc)[0]<<8|(pc)[1])
|
28
|
+
#define PEEK_W(pc) ((pc)[0]<<16|(pc)[1]<<8|(pc)[2])
|
29
|
+
|
30
|
+
#define READ_B() PEEK_B(pc++)
|
31
|
+
#define READ_S() (pc+=2, PEEK_S(pc-2))
|
32
|
+
#define READ_W() (pc+=3, PEEK_W(pc-3))
|
33
|
+
|
34
|
+
#define FETCH_Z() /* nothing */
|
35
|
+
#define FETCH_B() do {a=READ_B();} while (0)
|
36
|
+
#define FETCH_BB() do {a=READ_B(); b=READ_B();} while (0)
|
37
|
+
#define FETCH_BBB() do {a=READ_B(); b=READ_B(); c=READ_B();} while (0)
|
38
|
+
#define FETCH_BS() do {a=READ_B(); b=READ_S();} while (0)
|
39
|
+
#define FETCH_BSS() do {a=READ_B(); b=READ_S(); c=READ_S();} while (0)
|
40
|
+
#define FETCH_S() do {a=READ_S();} while (0)
|
41
|
+
#define FETCH_W() do {a=READ_W();} while (0)
|
42
|
+
|
43
|
+
#endif /* MRUBY_OPCODE_H */
|
@@ -0,0 +1,122 @@
|
|
1
|
+
/* operand types:
|
2
|
+
+ Z: no operand
|
3
|
+
+ B: 8bit
|
4
|
+
+ BB: 8+8bit
|
5
|
+
+ BBB: 8+8+8bit
|
6
|
+
+ BS: 8+16bit
|
7
|
+
+ BSS: 8+16+16bit
|
8
|
+
+ S: 16bit
|
9
|
+
+ W: 24bit
|
10
|
+
*/
|
11
|
+
|
12
|
+
/*-----------------------------------------------------------------------
|
13
|
+
operation code operands semantics
|
14
|
+
------------------------------------------------------------------------*/
|
15
|
+
OPCODE(NOP, Z) /* no operation */
|
16
|
+
OPCODE(MOVE, BB) /* R(a) = R(b) */
|
17
|
+
OPCODE(LOADL, BB) /* R(a) = Pool(b) */
|
18
|
+
OPCODE(LOADL16, BS) /* R(a) = Pool(b) */
|
19
|
+
OPCODE(LOADI, BB) /* R(a) = mrb_int(b) */
|
20
|
+
OPCODE(LOADINEG, BB) /* R(a) = mrb_int(-b) */
|
21
|
+
OPCODE(LOADI__1, B) /* R(a) = mrb_int(-1) */
|
22
|
+
OPCODE(LOADI_0, B) /* R(a) = mrb_int(0) */
|
23
|
+
OPCODE(LOADI_1, B) /* R(a) = mrb_int(1) */
|
24
|
+
OPCODE(LOADI_2, B) /* R(a) = mrb_int(2) */
|
25
|
+
OPCODE(LOADI_3, B) /* R(a) = mrb_int(3) */
|
26
|
+
OPCODE(LOADI_4, B) /* R(a) = mrb_int(4) */
|
27
|
+
OPCODE(LOADI_5, B) /* R(a) = mrb_int(5) */
|
28
|
+
OPCODE(LOADI_6, B) /* R(a) = mrb_int(6) */
|
29
|
+
OPCODE(LOADI_7, B) /* R(a) = mrb_int(7) */
|
30
|
+
OPCODE(LOADI16, BS) /* R(a) = mrb_int(b) */
|
31
|
+
OPCODE(LOADI32, BSS) /* R(a) = mrb_int((b<<16)+c) */
|
32
|
+
OPCODE(LOADSYM, BB) /* R(a) = Syms(b) */
|
33
|
+
OPCODE(LOADSYM16, BS) /* R(a) = Syms(b) */
|
34
|
+
OPCODE(LOADNIL, B) /* R(a) = nil */
|
35
|
+
OPCODE(LOADSELF, B) /* R(a) = self */
|
36
|
+
OPCODE(LOADT, B) /* R(a) = true */
|
37
|
+
OPCODE(LOADF, B) /* R(a) = false */
|
38
|
+
OPCODE(GETGV, BB) /* R(a) = getglobal(Syms(b)) */
|
39
|
+
OPCODE(SETGV, BB) /* setglobal(Syms(b), R(a)) */
|
40
|
+
OPCODE(GETSV, BB) /* R(a) = Special[Syms(b)] */
|
41
|
+
OPCODE(SETSV, BB) /* Special[Syms(b)] = R(a) */
|
42
|
+
OPCODE(GETIV, BB) /* R(a) = ivget(Syms(b)) */
|
43
|
+
OPCODE(SETIV, BB) /* ivset(Syms(b),R(a)) */
|
44
|
+
OPCODE(GETCV, BB) /* R(a) = cvget(Syms(b)) */
|
45
|
+
OPCODE(SETCV, BB) /* cvset(Syms(b),R(a)) */
|
46
|
+
OPCODE(GETCONST, BB) /* R(a) = constget(Syms(b)) */
|
47
|
+
OPCODE(SETCONST, BB) /* constset(Syms(b),R(a)) */
|
48
|
+
OPCODE(GETMCNST, BB) /* R(a) = R(a)::Syms(b) */
|
49
|
+
OPCODE(SETMCNST, BB) /* R(a+1)::Syms(b) = R(a) */
|
50
|
+
OPCODE(GETUPVAR, BBB) /* R(a) = uvget(b,c) */
|
51
|
+
OPCODE(SETUPVAR, BBB) /* uvset(b,c,R(a)) */
|
52
|
+
OPCODE(JMP, S) /* pc+=a */
|
53
|
+
OPCODE(JMPIF, BS) /* if R(a) pc+=b */
|
54
|
+
OPCODE(JMPNOT, BS) /* if !R(a) pc+=b */
|
55
|
+
OPCODE(JMPNIL, BS) /* if R(a)==nil pc+=b */
|
56
|
+
OPCODE(JMPUW, S) /* unwind_and_jump_to(a) */
|
57
|
+
OPCODE(EXCEPT, B) /* R(a) = exc */
|
58
|
+
OPCODE(RESCUE, BB) /* R(b) = R(a).isa?(R(b)) */
|
59
|
+
OPCODE(RAISEIF, B) /* raise(R(a)) if R(a) */
|
60
|
+
OPCODE(SENDV, BB) /* R(a) = call(R(a),Syms(b),*R(a+1)) */
|
61
|
+
OPCODE(SENDVB, BB) /* R(a) = call(R(a),Syms(b),*R(a+1),&R(a+2)) */
|
62
|
+
OPCODE(SEND, BBB) /* R(a) = call(R(a),Syms(b),R(a+1),...,R(a+c)) */
|
63
|
+
OPCODE(SENDB, BBB) /* R(a) = call(R(a),Syms(b),R(a+1),...,R(a+c),&R(a+c+1)) */
|
64
|
+
OPCODE(SENDVK, BB) /* R(a) = call(R(a),Syms(b),*R(a+1),**(a+2),&R(a+3)) # todo */
|
65
|
+
OPCODE(CALL, Z) /* R(0) = self.call(frame.argc, frame.argv) */
|
66
|
+
OPCODE(SUPER, BB) /* R(a) = super(R(a+1),... ,R(a+b+1)) */
|
67
|
+
OPCODE(ARGARY, BS) /* R(a) = argument array (16=m5:r1:m5:d1:lv4) */
|
68
|
+
OPCODE(ENTER, W) /* arg setup according to flags (23=m5:o5:r1:m5:k5:d1:b1) */
|
69
|
+
OPCODE(KEY_P, BB) /* R(a) = kdict.key?(Syms(b)) */
|
70
|
+
OPCODE(KEYEND, Z) /* raise unless kdict.empty? */
|
71
|
+
OPCODE(KARG, BB) /* R(a) = kdict[Syms(b)]; kdict.delete(Syms(b)) */
|
72
|
+
OPCODE(RETURN, B) /* return R(a) (normal) */
|
73
|
+
OPCODE(RETURN_BLK, B) /* return R(a) (in-block return) */
|
74
|
+
OPCODE(BREAK, B) /* break R(a) */
|
75
|
+
OPCODE(BLKPUSH, BS) /* R(a) = block (16=m5:r1:m5:d1:lv4) */
|
76
|
+
OPCODE(ADD, B) /* R(a) = R(a)+R(a+1) */
|
77
|
+
OPCODE(ADDI, BB) /* R(a) = R(a)+mrb_int(b) */
|
78
|
+
OPCODE(SUB, B) /* R(a) = R(a)-R(a+1) */
|
79
|
+
OPCODE(SUBI, BB) /* R(a) = R(a)-mrb_int(b) */
|
80
|
+
OPCODE(MUL, B) /* R(a) = R(a)*R(a+1) */
|
81
|
+
OPCODE(DIV, B) /* R(a) = R(a)/R(a+1) */
|
82
|
+
OPCODE(EQ, B) /* R(a) = R(a)==R(a+1) */
|
83
|
+
OPCODE(LT, B) /* R(a) = R(a)<R(a+1) */
|
84
|
+
OPCODE(LE, B) /* R(a) = R(a)<=R(a+1) */
|
85
|
+
OPCODE(GT, B) /* R(a) = R(a)>R(a+1) */
|
86
|
+
OPCODE(GE, B) /* R(a) = R(a)>=R(a+1) */
|
87
|
+
OPCODE(ARRAY, BB) /* R(a) = ary_new(R(a),R(a+1)..R(a+b)) */
|
88
|
+
OPCODE(ARRAY2, BBB) /* R(a) = ary_new(R(b),R(b+1)..R(b+c)) */
|
89
|
+
OPCODE(ARYCAT, B) /* ary_cat(R(a),R(a+1)) */
|
90
|
+
OPCODE(ARYPUSH, B) /* ary_push(R(a),R(a+1)) */
|
91
|
+
OPCODE(ARYDUP, B) /* R(a) = ary_dup(R(a)) */
|
92
|
+
OPCODE(AREF, BBB) /* R(a) = R(b)[c] */
|
93
|
+
OPCODE(ASET, BBB) /* R(a)[c] = R(b) */
|
94
|
+
OPCODE(APOST, BBB) /* *R(a),R(a+1)..R(a+c) = R(a)[b..] */
|
95
|
+
OPCODE(INTERN, B) /* R(a) = intern(R(a)) */
|
96
|
+
OPCODE(STRING, BB) /* R(a) = str_dup(Lit(b)) */
|
97
|
+
OPCODE(STRING16, BS) /* R(a) = str_dup(Lit(b)) */
|
98
|
+
OPCODE(STRCAT, B) /* str_cat(R(a),R(a+1)) */
|
99
|
+
OPCODE(HASH, BB) /* R(a) = hash_new(R(a),R(a+1)..R(a+b*2-1)) */
|
100
|
+
OPCODE(HASHADD, BB) /* R(a) = hash_push(R(a),R(a+1)..R(a+b*2)) */
|
101
|
+
OPCODE(HASHCAT, B) /* R(a) = hash_cat(R(a),R(a+1)) */
|
102
|
+
OPCODE(LAMBDA, BB) /* R(a) = lambda(SEQ[b],L_LAMBDA) */
|
103
|
+
OPCODE(LAMBDA16, BS) /* R(a) = lambda(SEQ[b],L_LAMBDA) */
|
104
|
+
OPCODE(BLOCK, BB) /* R(a) = lambda(SEQ[b],L_BLOCK) */
|
105
|
+
OPCODE(BLOCK16, BS) /* R(a) = lambda(SEQ[b],L_BLOCK) */
|
106
|
+
OPCODE(METHOD, BB) /* R(a) = lambda(SEQ[b],L_METHOD) */
|
107
|
+
OPCODE(METHOD16, BS) /* R(a) = lambda(SEQ[b],L_METHOD) */
|
108
|
+
OPCODE(RANGE_INC, B) /* R(a) = range_new(R(a),R(a+1),FALSE) */
|
109
|
+
OPCODE(RANGE_EXC, B) /* R(a) = range_new(R(a),R(a+1),TRUE) */
|
110
|
+
OPCODE(OCLASS, B) /* R(a) = ::Object */
|
111
|
+
OPCODE(CLASS, BB) /* R(a) = newclass(R(a),Syms(b),R(a+1)) */
|
112
|
+
OPCODE(MODULE, BB) /* R(a) = newmodule(R(a),Syms(b)) */
|
113
|
+
OPCODE(EXEC, BB) /* R(a) = blockexec(R(a),SEQ[b]) */
|
114
|
+
OPCODE(EXEC16, BS) /* R(a) = blockexec(R(a),SEQ[b]) */
|
115
|
+
OPCODE(DEF, BB) /* R(a).newmethod(Syms(b),R(a+1)) */
|
116
|
+
OPCODE(ALIAS, BB) /* alias_method(target_class,Syms(a),Syms(b)) */
|
117
|
+
OPCODE(UNDEF, B) /* undef_method(target_class,Syms(a)) */
|
118
|
+
OPCODE(SCLASS, B) /* R(a) = R(a).singleton_class */
|
119
|
+
OPCODE(TCLASS, B) /* R(a) = target_class */
|
120
|
+
OPCODE(DEBUG, BBB) /* print a,b,c */
|
121
|
+
OPCODE(ERR, B) /* raise(LocalJumpError, Lit(a)) */
|
122
|
+
OPCODE(STOP, Z) /* stop VM */
|