[macruby-changes] [724] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Mon Nov 10 16:11:52 PST 2008
Revision: 724
http://trac.macosforge.org/projects/ruby/changeset/724
Author: lsansonetti at apple.com
Date: 2008-11-10 16:11:52 -0800 (Mon, 10 Nov 2008)
Log Message:
-----------
inlining the dtrace insn probes so that they only appear once in the probes list
Modified Paths:
--------------
MacRuby/trunk/compile.c
MacRuby/trunk/iseq.c
MacRuby/trunk/vm.h
MacRuby/trunk/vm_insnhelper.c
Modified: MacRuby/trunk/compile.c
===================================================================
--- MacRuby/trunk/compile.c 2008-11-10 15:04:25 UTC (rev 723)
+++ MacRuby/trunk/compile.c 2008-11-11 00:11:52 UTC (rev 724)
@@ -4906,9 +4906,9 @@
/*
* index -> LABEL *label
*/
- static struct st_table *insn_table;
+ static struct st_table *insn_table = NULL;
- if (insn_table == 0) {
+ if (insn_table == NULL) {
insn_table = insn_make_insn_table();
GC_ROOT(&insn_table);
}
Modified: MacRuby/trunk/iseq.c
===================================================================
--- MacRuby/trunk/iseq.c 2008-11-10 15:04:25 UTC (rev 723)
+++ MacRuby/trunk/iseq.c 2008-11-11 00:11:52 UTC (rev 724)
@@ -1299,6 +1299,12 @@
return iseqval;
}
+const char *
+rb_insn_name(int insn)
+{
+ return insn_name(insn);
+}
+
void
Init_ISeq(void)
{
Modified: MacRuby/trunk/vm.h
===================================================================
--- MacRuby/trunk/vm.h 2008-11-10 15:04:25 UTC (rev 723)
+++ MacRuby/trunk/vm.h 2008-11-11 00:11:52 UTC (rev 724)
@@ -79,11 +79,38 @@
#else
-extern void rb_enter_insn_trace(rb_control_frame_t *);
-extern void rb_end_insn_trace(rb_control_frame_t *);
#define debugs
-#define DEBUG_ENTER_INSN(insn) do { if (MACRUBY_INSN_ENTRY_ENABLED()) rb_enter_insn_trace(GET_CFP()); } while (0)
-#define DEBUG_END_INSN() do { if (MACRUBY_INSN_RETURN_ENABLED()) rb_end_insn_trace(GET_CFP()); } while (0)
+extern const char *rb_insn_name(int);
+#define DEBUG_ENTER_INSN(insn) \
+ do { \
+ if (MACRUBY_INSN_ENTRY_ENABLED()) { \
+ rb_control_frame_t *cfp = GET_CFP(); \
+ rb_iseq_t *iseq = cfp->iseq; \
+ if (iseq != NULL && VM_FRAME_TYPE(cfp) != FRAME_MAGIC_FINISH) { \
+ VALUE *seq = iseq->iseq; \
+ int pc = cfp->pc - iseq->iseq_encoded; \
+ MACRUBY_INSN_ENTRY((char *)rb_insn_name(seq[pc]), \
+ (char *)rb_sourcefile(), \
+ rb_sourceline()); \
+ } \
+ } \
+ } \
+ while (0)
+#define DEBUG_END_INSN() \
+ do { \
+ if (MACRUBY_INSN_RETURN_ENABLED()) { \
+ rb_control_frame_t *cfp = GET_CFP(); \
+ rb_iseq_t *iseq = cfp->iseq; \
+ if (iseq != NULL && VM_FRAME_TYPE(cfp) != FRAME_MAGIC_FINISH) { \
+ VALUE *seq = iseq->iseq; \
+ int pc = cfp->pc - iseq->iseq_encoded; \
+ MACRUBY_INSN_RETURN((char *)rb_insn_name(seq[pc]), \
+ (char *)rb_sourcefile(), \
+ rb_sourceline()); \
+ } \
+ } \
+ } \
+ while (0)
#endif
#define throwdebug if(0)printf
Modified: MacRuby/trunk/vm_insnhelper.c
===================================================================
--- MacRuby/trunk/vm_insnhelper.c 2008-11-10 15:04:25 UTC (rev 723)
+++ MacRuby/trunk/vm_insnhelper.c 2008-11-11 00:11:52 UTC (rev 724)
@@ -1853,41 +1853,3 @@
return val;
}
-
-#include "insns_info.inc"
-
-void
-rb_enter_insn_trace(rb_control_frame_t *cfp)
-{
- /* just to get rid of compilation warnings... */
- if (0) {
- insn_op_types(0);
- insn_op_type(0, 0);
- }
-
- rb_iseq_t *iseq = cfp->iseq;
-
- if (iseq != NULL && VM_FRAME_TYPE(cfp) != FRAME_MAGIC_FINISH) {
- VALUE *seq = iseq->iseq;
- int pc = cfp->pc - iseq->iseq_encoded;
-
- MACRUBY_INSN_ENTRY((char *)insn_name(seq[pc]),
- (char *)rb_sourcefile(),
- rb_sourceline());
- }
-}
-
-void
-rb_end_insn_trace(rb_control_frame_t *cfp)
-{
- rb_iseq_t *iseq = cfp->iseq;
-
- if (iseq != NULL && VM_FRAME_TYPE(cfp) != FRAME_MAGIC_FINISH) {
- VALUE *seq = iseq->iseq;
- int pc = cfp->pc - iseq->iseq_encoded;
-
- MACRUBY_INSN_RETURN((char *)insn_name(seq[pc]),
- (char *)rb_sourcefile(),
- rb_sourceline());
- }
-}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20081110/cde0d476/attachment-0001.html>
More information about the macruby-changes
mailing list