summaryrefslogtreecommitdiffhomepage
path: root/src/dump.c
AgeCommit message (Collapse)Author
2020-05-09Remove byteorder constants; ref 87576b8dearblue
The `FLAG_BYTEORDER_NATIVE` and `FLAG_BYTEORDER_NONATIVE` are no longer needed.
2020-05-07Remove endian information/flags from compiled binary format.Yukihiro "Matz" Matsumoto
Since `mruby 2.0`, compiled bytecode no longer depends on the endian of the machine.
2019-10-17delete extern in Cyuri
2019-09-25Rename symbol-to-string functions; close #4684Yukihiro "Matz" Matsumoto
* mrb_sym2name -> mrb_sym_name * mrb_sym2name_len -> mrb_sym_name_len * mrb_sym2str -> mrb_sym_str
2019-01-11Use `%g` instead of `%e` for float representation in dump formatKOBAYASHI Shuji
`%g` use shorter representation than `%e`.
2019-01-08Fix dump/load float leteral evaluate to infinityKOBAYASHI Shuji
Example: # example.rb p(2e308) p(-2e308) Good: $ bin/mruby example.rb inf -inf Bad: $ bin/mrbc example.rb $ bin/mruby -b example.mrb 0 -0 Cause: Float infinity representation is `inf` on dump and it is converted by corresponding `String#to_f` on load. Treatment: - Introduce new representations (`i`: +infinity, `I`: -infinity) - Allow old representations (`inf`, `-inf`, `infinity`, `-infinity`) too - Raise error for unknown representations (use corresponding `Kernel#Float`)
2018-11-15Remove `filename`&`lines` from `mrb_irep` struct.Yukihiro "Matz" Matsumoto
This patch slightly reduce memory consumption (2% for my test).
2018-11-15Small renaming refactor in `dump.c`Yukihiro "Matz" Matsumoto
2018-11-02Suppress warningtake-cheeze
2018-11-02Fix dump and load with endianesstake-cheeze
2017-10-11Add MRB_WITHOUT_FLOATYAMAMOTO Masaya
2017-09-27fix: src\dump.c(710): warning C4244: 'function': conversion from 'mrb_int' ↵Tomasz Dąbrowski
to 'uint16_t', possible loss of data
2017-09-27fix: src\dump.c(657): warning C4244: 'function': conversion from 'mrb_int' ↵Tomasz Dąbrowski
to 'uint16_t', possible loss of data
2017-08-19Reduce signed/unsigned warnings in dump.cYukihiro "Matz" Matsumoto
2017-08-12Reduce integer type mismatch warnings in VC.Yukihiro "Matz" Matsumoto
2017-04-03Unify `else` clause styleYukihiro "Matz" Matsumoto
2016-11-24Add constant export declaration for MRBC output compiled as C++Tomasz Dąbrowski
Otherwise, C++ compilers will skip this constant when producing object files.
2015-12-22fix build on VS2012Yasuhiro Matsumoto
2015-11-27include changed from by quotes ("") to by brackets (<>); close #3032Yukihiro "Matz" Matsumoto
2015-11-17DISABLE_STDIO/ENABLE_DEBUG macros to rename; close #3014Yukihiro "Matz" Matsumoto
changes: * rename DISABLE_STDIO -> MRB_DISABLE_STDIO * rename ENABLE_DEBUG -> MRB_ENABLE_DEBUG_HOOK * no more opposite macro definitions (e.g. ENABLE_STDIO, DISABLE_DEBUG). * rewrite above macro references throughout the code. * update documents
2015-08-17fix irep float dump format string for MRB_USE_FLOATcremno
IEC 60559 single format has 6 to 9 significant decimal digits precision. However the printf conversion specifier e (and E, of course) already writes 1 digit - the one before the decimal point - and precision specifies the number of digits to write after the decimal point.
2015-07-16delete mrb_free()-related non-NULL checkscremno
No need to optimize since a program only exits once and errors are rare. Also the mruby source code doesn't have these kind of checks elsewhere. The ones in {Time,Random}#initialize are kept because there it actually matters since initialization always happens and re-initialization is unlikely.
2015-07-03remove unnecessary default casecremno
2015-05-28remove unnecessary including of <ctype.h>cremno
Not needed anymore since 85075bef7583edd0a48cfbdfaa632cbdacf78f2c
2015-05-15let the C compiler validate the identifiercremno
Some C compilers may allow other characters in identifiers such as $. They may also implement C99's extended identifiers (\u30EB\u30D3\u30FC, ルビー).
2015-05-14Reenable mrb_dump_irep under DISABLE_STDIO.Simon Génier
2015-03-22refactor write_pool_block()cremno
No need to write the same assertion in each case (except the default one). Instead we can assert after the switch statement.
2015-02-13re-implement mrb_float_to_str()cremno
The new implementation is backwards incompatible, but I couldn't find any usage outside mruby and I also couldn't think of a different and good name. All ISO C99 printf conversion specifiers for floating point numbers and an optional precision are supported. It is largely based on code from the MIT licensed musl libc (http://www.musl-libc.org/) and its floating point printing is exact (unlike the current code behind Float#to_s).
2015-02-02Replace int with mrb_bool in dump_bigendian_p funcJun Hiroe
2015-02-02allow endian specification of mrb files by `mrbc -e/-E`Yukihiro "Matz" Matsumoto
`mruby -b` now accepts both big/little endian mrb (compiled binary) files. `mrbc` generates mrb files in big endian for .mrb files and in native endian for C files (with -B option specified) by default. If you are cross compiling, you need to specify target endian by -e/-E options if it is different from host endian.
2014-11-06%zu format is not supported by MSVCHiroshi Mimaki
2014-11-04specify alignment specifier for GCC and MSC; ref #2630Yukihiro "Matz" Matsumoto
2014-11-04Fix misaligned access when reading irep; close #2630Yukihiro "Matz" Matsumoto
Add padding bytes before iseq block that may be used as mrb_code[]. Note that dumped mrb format has changed. Based on a patch from kimu_shu <[email protected]>
2014-09-04wrong iseq conversion flagYukihiro "Matz" Matsumoto
2014-09-04avoid iseq allocation from static irep binary. it reduces 424KB allocation ↵Yukihiro "Matz" Matsumoto
for mrbtest
2014-08-28Fix error handlings for fputs().Tatsuhiko Kubo
2014-08-28Fix error handlings for fprintf().Tatsuhiko Kubo
2014-08-27Remove discareded NULL checks.Tatsuhiko Kubo
2014-07-12check the return value of `fwrite`cremno
2014-06-13Fixed dead increment in 'dump.c' reported by 'clang-analyzer'Jose Narvaez
2014-05-22remove unnecessary assignment; ref #2301Yukihiro "Matz" Matsumoto
2014-05-21Reduce children filenames listing.take_cheeze
It is executed per each debug filenames in irep to same ireps(children).
2014-05-21Reduce filename table creation in irep dumping to once.take_cheeze
2014-05-19allow NULL (no variable) in lvar section of mrb format; fix #2294Yukihiro "Matz" Matsumoto
This fix use UINT16_MAX for NULL symbol tag, that means maximum symbol length is not UINT16_MAX-1.
2014-05-15Support `LVAR` section removing.take_cheeze
2014-05-14resize register number in LVAR section from 32bits to 16bitsYukihiro "Matz" Matsumoto
2014-05-14Merge branch 'dump_lv' of https://github.com/take-cheeze/mruby into ↵Yukihiro "Matz" Matsumoto
take-cheeze-dump_lv
2014-05-02add namespace prefix to `dump_irep`cremno
2014-04-30Added dump_irep in header.Thiago Scalone
2014-04-29Remove `lv_len` and use `nlocals - 1` instead.take_cheeze
Check that `lv`'s length is always `nlocals - 1`.