diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-06 13:42:32 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-06 13:42:32 +0000 |
commit | 5ac990e83eb4399b38542d788622c8069c7c4192 (patch) | |
tree | 3eaf556c26f92948bd2e1bd0c55ff3ef08b2010d /load.c | |
parent | 586e018c739d50be00bb7d750907d53009a0229b (diff) |
`script_compiled` TracePoint event [Feature #15287]
* vm_trace.c: add `script_compiled` event. This event invoked
after script compiling and before evaluating compiled script.
Also the following methods are added:
`TracePoint#compiled_instruction_sequence` method to get compiled
`RubyVM::InstructionSequence` instance.
`TracePoint#compiled_eval_script` method to get compiled script (String)
by *eval methods (return nil if compiling by file).
* vm_trace.c (tracepoint_attr_raised_exception):
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
-rw-r--r-- | load.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -8,6 +8,7 @@ #include "dln.h" #include "eval_intern.h" #include "probes.h" +#include "iseq.h" static VALUE ruby_dln_librefs; @@ -566,7 +567,6 @@ rb_provide(const char *feature) } NORETURN(static void load_failed(VALUE)); -const rb_iseq_t *rb_iseq_load_iseq(VALUE fname); static int rb_load_internal0(rb_execution_context_t *ec, VALUE fname, int wrap) @@ -608,6 +608,8 @@ rb_load_internal0(rb_execution_context_t *ec, VALUE fname, int wrap) fname, rb_realpath_internal(Qnil, fname, 1), NULL); rb_ast_dispose(ast); } + EXEC_EVENT_HOOK(ec, RUBY_EVENT_SCRIPT_COMPILED, + ec->cfp->self, 0, 0, 0, (VALUE)iseq); rb_iseq_eval(iseq); } EC_POP_TAG(); |