diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-24 06:09:23 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-24 06:09:23 +0000 |
commit | 3dcebce5235276e99a75c6b0c71f4f3c4f4e225c (patch) | |
tree | dcc09c9bb210e318e0ada4161c30f8d4405cebb5 /internal.h | |
parent | bd5c7507ec8dd484d5eab526c0ea1fa409d2959a (diff) | |
download | ruby-3dcebce5235276e99a75c6b0c71f4f3c4f4e225c.tar.gz |
* vm.c: add RubyVM::Backtrace object (btobj).
Backtrace information contains an array consists of location
information for each frames by string.
RubyVM::Backtrace object is lightweight backtrace information,
which contains complete information to generate traditional style
backtrace (an array of strings) with faster generation.
If someone accesses to backtrace information via
Exception#backtrace, then convert a RubyVM::Backtrace object to
traditonal style backtrace.
This change causes incompatibility on marshal dumpped binary
of Exception. If you have any trouble on it, please tell us
before Ruby 2.0 release.
Note that RubyVM::Backtrace object should not expose Ruby level.
* error.c, eval.c, vm_eval.c: ditto.
* internal.h: ditto.
* eval_error.c: fix to skip "set_backtrace" method invocation in
creating an exception object if it call a normal set_backtrace
method (defined by core).
* test/ruby/test_settracefunc.rb: fix for above change.
* vm_method.c (rb_method_defined_by): added. This function
checks that the given object responds with the given method
by the given cfunc.
* benchmark/bm_vm2_raise1.rb, benchmark/bm_vm2_raise2.rb:
add to measure exception creation speed. raise1 create
exception objects from shallow stack frame. raise2 create
exception objects from deep stack frame.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/internal.h b/internal.h index e5818429ea..6ba8e1f3b0 100644 --- a/internal.h +++ b/internal.h @@ -83,6 +83,7 @@ void rb_gc_mark_encodings(void); NORETURN(PRINTF_ARGS(void rb_compile_bug(const char*, int, const char*, ...), 3, 4)); VALUE rb_check_backtrace(VALUE); NORETURN(void rb_async_bug_errno(const char *,int)); +VALUE rb_exc_set_backtrace(VALUE exc, VALUE bt); /* eval_error.c */ void ruby_error_print(void); @@ -207,6 +208,9 @@ void rb_vm_inc_const_missing_count(void); void rb_thread_mark(void *th); const void **rb_vm_get_insns_address_table(void); VALUE rb_sourcefilename(void); +int rb_backtrace_p(VALUE obj); +VALUE rb_backtrace_to_str_ary(VALUE obj); +VALUE rb_vm_backtrace_object(); /* vm_dump.c */ void rb_vm_bugreport(void); @@ -217,6 +221,7 @@ VALUE rb_current_realfilepath(void); /* vm_method.c */ void Init_eval_method(void); +int rb_method_defined_by(VALUE obj, ID mid, VALUE (*cfunc)(ANYARGS)); /* miniprelude.c, prelude.c */ void Init_prelude(void); |