* parse.y (struct parse_params): shrink to 320 to 304 bytes on 64-bit
Some elements may be removed/resized as well, but not as important
as reducing more-frequently allocated structures.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (mlhs_node): dynamic constant assignment in massign
should cause assign_error, like as single assign and backref
assignment in massign.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (negate_lit): alter only literal object itself, not NODE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (rb_init_parse): rename to get rid of name clash with
json/parser at statically linking.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* symbol.c, symbol.h: Symbol class implementation and internals,
split from parse.y.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
exposing IDs from collectable symbols.
[Bug #10014]
Now, rb_check_id() returns 0 if corresponding symbol is
pinned dynamic symbol.
There is remaining intern_cstr_without_pindown(), it can return
IDs from collectable symbols. We must be careful to use it
(only used in parse.y). I think it should be removed if
it does not have impact for performance.
* parse.y:
add:
* STATIC_SYM2ID()
* STATIC_ID2SYM()
rename:
* rb_pin_dynamic_symbol() -> dsymbol_pindown()
* internal.h:
remove:
* rb_check_id_without_pindown()
* rb_sym2id_without_pindown()
add:
* rb_check_symbol()
* rb_check_symbol_cstr()
* load.c: use rb_check_id() or rb_check_id_cstr().
* object.c: ditto.
* struct.c: ditto.
* thread.c: ditto.
* vm_method.c: ditto.
* string.c (sym_find): use only rb_check_symbol().
* sprintf.c (rb_str_format): use rb_check_symbol_cstr().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (new_op_assign_gen): expand is_asgn_or_id(), which call
id_type() function multiple times now.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (dsymbol_check): set RSYMBOL(sym)->fstr to 0
because we should not touch fstr after that.
* parse.y (rb_gc_free_dsymbol): skip deleting str and sym
from tables if fstr == 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(and ::pinned_dsym_minor_marked).
Mark pinned dsymbols by rb_gc_register_mark_object() because
they are immortal.
* prase.y (rb_gc_free_dsymbol): rename parameter name `ptr' to `sym'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
symbol for garbage dynamic symbol.
* common.mk: use gc.h by parse.y.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This table is not {Symbol => ID} table, but
{String => ID} table.
* parse.y (lookup_sym_id): also rename lookup_sym_id() to
lookup_str_id() because key is not Symbol, but String.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add `inline'.
* use UNLIKELY().
* check only DYNAMIC_SYM_P(), otherwise it is a bug.
* lookup_id_str() is not needed in second condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (rb_id2str): use rb_fstring_new() instead of rb_fstring()
with a new string instance.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (op_tbl): pack limited size strings. gcc/clang warn
if initializer-string for char array is too long, but no option
to err it now.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* node.h (NODE_PRIVATE_RECV): name a magic number, `self` as the
receiver of a setter method call.
* compile.c (private_recv_p), parse.y (attr_receiver): use the
named macro.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in (with-jemalloc): also check for header, for ABIs
which JEMALLOC_MANGLE is needed, i.e., Mach-O and PE-COFF
platforms. [ruby-core:62939] [Feature #9113]
* include/ruby/missing.h: include alternative malloc header to
replace memory management functions.
* dln.c, io.c, parse.y, st.c: undef malloc family before
re-definition to suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (intern_str): dynamic attrset ID is registered by
`rb_id_attrset()` already, so no further registration is needed.
[ruby-core:62861]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_number_literal_suffix): refine error message for
extra dot and digits.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (new_bv_gen): no duplicated names, if already added in
shadowing_lvar().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (arg_var_gen, local_var_gen): make void since the result
values are not used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (next_id): no reason to set ID_STATIC_SYM here, as ID
returned by rb_intern3 can be a dynamic symbol and the static
symbol flag is set otherwise. [Bug #9787]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (rb_id_attrset): should not reveal anonymous ID as an
instance variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (rb_id_attrset): turn dynamically interned Symbol into
an ID, since rb_str_dynamic_intern returns a Symbol but not an
ID. [ruby-core:62226] [Bug #9787]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (must_be_dynamic_symbol): abort if inappropriate symbol
is given, which should never happen.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e