Commit Graph

1128 Commits

Author SHA1 Message Date
KOBAYASHI Shuji 16b1b2978e Fix constant name validation
`X!` etc are invalid constant name.
2019-03-14 23:09:05 +09:00
Yukihiro "Matz" Matsumoto 3e0d29b7be Merge pull request #4279 from dearblue/fix-inline-packed-symbols
Fix destroyed "inline packed symbols" on 32 bit mode with `MRB_WORD_BOXING`
2019-02-17 22:13:22 +09:00
yui-knk f614eed13a Fix typos 2019-02-17 21:34:33 +09:00
dearblue d1db959cab Fix to defined MRB_SYMBOL_BITSIZE and MRB_SYMBOL_MAX always; ref #4077 2019-02-16 21:24:05 +09:00
Yukihiro "Matz" Matsumoto 37bc343e0a Disable Symbol.all_symbols. 2019-02-12 17:30:34 +09:00
Yukihiro "Matz" Matsumoto 06ba5905f0 Implement inline packed symbols.
Small symbols with all alphanumeric characters (<5) are packed in 32bit
symbol integer a la base64. This means those small symbols are not
listed in `Symbol.all_symbols`.
2019-02-12 17:30:34 +09:00
Yukihiro "Matz" Matsumoto d52f46da45 Implement symbol hash table to boost find_symbol.
In 4174e02, we removed the symbol hash table from `mrb_state` but
`find_symbol` was too slow with linear search. My performance estimation
was wrong. So we implemented a new compact hash table for symbols.
2019-02-06 22:07:11 +09:00
Yukihiro "Matz" Matsumoto 02fbb2c211 Remove symbol hash table from mrb_state structure.
Use linear search instead. Number of symbols is usually small (<1K), so
we don't need performance boost from hash tables. In our benchmark
measurement, hash tables consumes 790KB for `build/full-debug/mrbtest`.
2019-02-06 22:07:11 +09:00
KOBAYASHI Shuji 69fd1a5925 Fix Symbol#size for multi-byte characters with MRB_UTF8_STRING
Before:

  p :あ.size  #=> 3

After:

  p :あ.size  #=> 1
2019-02-04 18:11:22 +09:00
dearblue d6d02774c5 Fix memory leak sval when out of memory in Data_Wrap_Struct() 2019-01-20 14:23:22 +09:00
Yukihiro "Matz" Matsumoto 81862fd689 Update compiled binary format version; ref #4219 2019-01-08 21:44:40 +09:00
Yukihiro "Matz" Matsumoto d38a8e8807 Update OP_APOST description (typo fixed). 2019-01-08 21:43:04 +09:00
KOBAYASHI Shuji eb216fc858 range: Refactor range.h/range.c
Functions order, name, linkage and so on.
2019-01-03 20:09:41 +09:00
KOBAYASHI Shuji 648b57620a range: Embed edges in RRange on boxing environment.
[Breaking changes]

Developers must use following APIs for accessing attributes of RRange
because RRange structure depends on boxing setting.

- mrb_range_beg
- mrb_range_end
- mrb_range_excl_p
2019-01-01 15:35:56 +09:00
dearblue 49cce74c1a Suppress __STDC_VERSION__ warns for C++ 2018-12-23 17:22:59 +09:00
dearblue e9ceb865b6 Fix MRB_ENDIAN_BIG is always defined, if byte order macro is not defined 2018-12-22 20:37:51 +09:00
Yukihiro "Matz" Matsumoto ed2bc5d4ed Simplify MRB_ENDIAN_BIG macro definition; ref #4190
`cpp` does not raise error on undefined macro access in condition.
2018-12-21 09:28:19 +09:00
Yukihiro "Matz" Matsumoto f5537912ab Define MRB_ENDIAN_BIG automatically; ref #4190
You had to define this macro on big endian platforms, but it is very
error-prone. So define the macro automatically if possible.
2018-12-21 08:57:17 +09:00
dearblue e19353be25 Fix macro expressions with paren 2018-12-18 23:14:26 +09:00
dearblue 14133f4057 Fix macro arguments with paren 2018-12-18 23:05:36 +09:00
Yukihiro "Matz" Matsumoto e65d42644a Remove #include <mruby/khash.h> from mruby/hash.h. 2018-12-17 15:59:42 +09:00
dearblue 62dd4d89fc Add mrb_hash_size() function. 2018-12-14 21:41:07 +09:00
Yukihiro "Matz" Matsumoto 730b925332 Merge pull request #4184 from mruby/stable
Release mruby 2.0.0
2018-12-11 11:52:33 +09:00
Hiroshi Mimaki 1c09046c13 Update release date. 2018-12-11 10:52:20 +09:00
Yukihiro "Matz" Matsumoto 265171a28c Rename ht_foreach_func to mrb_hash_foreach_func. 2018-12-11 10:41:26 +09:00
Yukihiro "Matz" Matsumoto e935d20ab5 Add mrb_ prefix to iv_foreach_func. 2018-12-11 10:39:53 +09:00
Yukihiro "Matz" Matsumoto a0df27d8e0 Add new API mrb_iv_foreach() to iterate over instance variables. 2018-12-11 09:48:15 +09:00
Yukihiro "Matz" Matsumoto c0d91a14e7 Add API function mrb_hash_foreach() to iterate over items in a hash. 2018-12-11 09:01:05 +09:00
Yukihiro "Matz" Matsumoto 91bf55bbe5 Remove do { ... } while(0) hacks from MRB_TRY macros.
Because it can swallow `break` etc. if they are used in loops.
2018-11-25 06:05:07 +09:00
Rob Fors c9a66d4c41 Update documentation to mrb_load_irep 2018-11-20 21:27:03 -05:00
Yukihiro "Matz" Matsumoto 68c5384830 Update version number; fix #4165 2018-11-20 10:43:34 +09:00
Yukihiro "Matz" Matsumoto ec19c34a20 Fixed a bug in mirb heredoc handling; fix #3989 2018-11-20 10:39:34 +09:00
Yukihiro "Matz" Matsumoto 86d102350b Restrict total recursion number of ecall(); fix #3789 2018-11-20 09:14:34 +09:00
Yukihiro "Matz" Matsumoto 53e2df3e93 Restore mrb_string_type function for compatibility. 2018-11-19 16:13:26 +09:00
Yukihiro "Matz" Matsumoto 9516731329 Use type checking mrb_to_str instead of converting mrb_str_to_str. 2018-11-19 12:08:28 +09:00
Yukihiro "Matz" Matsumoto 698f5f707c Removed to_ary conversion method. 2018-11-19 12:08:28 +09:00
Yukihiro "Matz" Matsumoto ff08856fe3 Remove implicit conversion using to_str method; fix #3854
We have added internal convenience method `__to_str` which
does string type check.

The issue #3854 was fixed but fundamental flaw of lack of stack
depth check along with fibers still remains. Use `MRB_GC_FIXED_ARENA`
for workaround.
2018-11-19 12:05:46 +09:00
Yukihiro "Matz" Matsumoto afca99a40b Remove implicit conversion using to_int method.
The ISO standard does not include implicit type conversion using
`to_int`. This implicit conversion often causes vulnerability.
There will be no more attacks like #4120.

In addition, we have added internal convenience method `__to_int` which
does type check and conversion (from floats).
2018-11-19 11:28:51 +09:00
Yukihiro "Matz" Matsumoto 25d390d6cc Improve Hash table using variable sized segments. 2018-11-19 09:30:15 +09:00
Yukihiro "Matz" Matsumoto 7e3e8d8ed5 Shrink file name table size to uint16_t; ref #4138 2018-11-15 23:34:32 +09:00
Yukihiro "Matz" Matsumoto 61f49690e4 Remove filename&lines from mrb_irep struct.
This patch slightly reduce memory consumption (2% for my test).
2018-11-15 21:01:56 +09:00
Yukihiro "Matz" Matsumoto d9e2532552 Remove reserved symbols for now.
It should be done by planned embedded symbols.
2018-11-02 22:58:12 +09:00
take-cheeze 6a6586ca84 Reduce unnecessary symbol table entry 2018-10-29 19:40:33 +09:00
take-cheeze e022080390 Define null symbol 2018-10-29 19:22:53 +09:00
take-cheeze 3248de83b6 Reduce instruction size 2018-10-29 19:17:05 +09:00
Yukihiro "Matz" Matsumoto e8dcfe1745 Use segmented list to implement Hash [Experimental]
I know it's not hash at all, but reduce memory consumption.
2018-09-26 12:55:22 +09:00
Daniel Varga 4d5e3e1e63 Fix minor typos (#4126) 2018-09-25 09:14:01 +09:00
Yukihiro "Matz" Matsumoto 2661ac7049 Add support for iOS platforms that does not support fork; fix #4113 2018-09-16 00:41:48 +09:00
dearblue 9da9e5eb4e Fix typo for concatenate 2018-09-07 22:32:34 +09:00
Yukihiro "Matz" Matsumoto 0c6353aa2c Remove MRB_API from mrb_f_send which is not API. 2018-09-01 11:01:50 +09:00