* parse.y (node_assign_gen): NODE_CALL is not passed to
node_assign_gen. NODE_CALL is not assignable. Assignable
method call (array set and attr set) is represented by NODE_ATTRASGN.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_trace.c (rb_exec_event_hooks): we don't need to use goto statement.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (node_assign_gen): NODE_ATTRASGN is created
before rhs is created. It is needed to set location
after rhs is created to rhs range be included to the
location of NODE_ATTRASGN.
e.g. The locations of NODE_ATTRASGN is fixed:
```
a[1] = 2
```
* Before
```
NODE_ATTRASGN (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 4)
```
* After
```
NODE_ATTRASGN (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 8)
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c (rb_iseq_trace_set): remove a wrong assertion.
This assertion checked `insn` is `trace_` prefix instruction
but threaded code `insn` is original code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_core.h (EXEC_EVENT_HOOK_VM_TRACE): added to pass vm_event_flags
(== ruby_vm_event_flags) as a macro parameter.
* vm_insnhelper.c (vm_trace): use an added macro.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_trace.c (update_global_event_hook): set only when tracing is added.
If tracing was off (event flags are decreased), then ignore them.
Next `trace_` prefix instruction will trace off itself (lazy tracing off).
* vm_insnhelper.c (vm_trace): trace-off for when trace is not needed.
* iseq.c (rb_iseq_trace_set): fix trace-off process (it was never off tracing).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (node_assign_gen): In some case assignable nodes
are created before rhs is created. In this case it is
needed to set location after rhs is shifted to
rhs range be included to assignable nodes.
e.g. The locations of NODE_DASGN_CURR is fixed:
```
a = 10
```
* Before
```
NODE_DASGN_CURR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 1)
```
* After
```
NODE_DASGN_CURR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 6)
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* common.mk (update-gems): `old.delete("gems/#{gem}")` always returns nil
because when really downloading new gem, the filename is not in `old`.
the real intention of this condition might be checking `old` is empty or not.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to unify signature with pthread's one
I'm planning to use functions for rb_nativethread_cond_t and
rb_nativethread_mutex_t in the future JIT introduction.
In that case, I want them to have the same signature. To prevent the case
that its return value is used in somewhere and it becomes harder to unify
signature, I want to drop unused return value.
[close GH-1751]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c (rb_iterator_p): removed because nobody use it
and not exposed by headers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_backtrace.c (rb_ec_backtrace_location_ary): make it static and
remove `rb_` prefix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_method.c (rb_resolve_refined_method_callable): make it static.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm.c (rb_proc_create_from_captured): make this func static and renmae
with vm_ prefix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c (rb_raise_method_missing): make this func static and renmae with
vm_ prefix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm.c (rb_source_loc): rename to rb_source_location_cstr()
to make behavior clear compare with rb_source_location().
* error.c (warning_string): use rb_source_location_cstr() directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (k_return): prohibit return in class/module body except
for singleton class.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm.c (rb_source_location): return nil if path is not found.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm.c (rb_sourcefilename): removed because nobody use it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c (DECL_BRANCH_BASE, ADD_TRACE_BRANCH_COVERAGE): Add
a last location to arguments.
* compile.c (compile_if, compile_case, compile_case2, compile_loop, iseq_compile_each0):
Pass a last location to macros.
* ext/coverage/coverage.c (branch_coverage): Add a last location to
a return value.
* test/coverage/test_coverage.rb: Follow-up these changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_trace.c: before this patch, deleted hooks are remvoed at
*the beggining* of hooks (exec_hooks_precheck).
This patch cleanup deleted hooks at
(1) just after hook is deleted (TracePoint#disable and so on)
(2) just after executing hooks (exec_hooks_postcheck)
Most of time (1) is enough, but if some threads running hooks,
we need to wait cleaning up deleted hooks until threads finish
running the hooks. This is why (2) is introduced (and this is
why current impl cleanup deleted hooks at the beggining of hooks).
* test/lib/tracepointchecker.rb: check also the number of delete
waiting hooks.
* cont.c (cont_restore_thread): fix VM->trace_running count.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (new_op_assign_gen): Fix location of asgn node.
Assignable node (e.g. NODE_LASGN) is generated before rhs
is generated, so we reset the location when nd_value of
asgn is fixed.
e.g. :
```
a -= 10
```
* Before
```
NODE_DASGN_CURR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 1)
```
* After
```
NODE_DASGN_CURR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 7)
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y (parser_params): Add prevline to store previous line.
* parse.y (yycompile0): Initialize prevline with 0.
* parse.y (parser_nextline): Store previous line on prevline.
* parse.y (parser_nextc): Check parser is on EOF or has nextline.
Now parser_yylex does not always set lex_p as lex_pend, we should check
EOF flag and nextline is set.
* parse.y (parser_yylex): Restore previous line, set lex_p and tokp
on '\n'. Before this commit, tokp is on the head of next line of '\n'
and lex_p is on the tail of next line when next token is '\n'.
By this behavior, in some case the last column of NODE_CALL (or NODE_QCALL) is
set to the last column of next line. NODE_CALL can be generated
via `primary_value call_op operation2 {} opt_paren_args` and opt_paren_args
can be none. If none is generated with next token '\n', the last column of
none is set to the last column of next line.
e.g. :
```
a.b
cd.ef
```
The location of NODE_CALL of first line is set to,
* Before
```
NODE_CALL (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 6)
```
* After
```
NODE_CALL (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 3)
```
* parse.y (parser_mark): GC mark prevline.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_core.h (rb_thread_t): remove rb_thread_t::event_hooks.
* vm_trace.c: all hooks are connected to vm->event_hooks and
add rb_event_hook_t::filter::th to filter invoke thread.
It will simplify invoking hooks code.
* thread.c (thread_start_func_2): clear thread specific trace_func.
* test/ruby/test_settracefunc.rb: add a test for Thread#add_trace_func.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e