aboutsummaryrefslogtreecommitdiffstats
path: root/debug_counter.h
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2019-07-19 14:37:59 +0900
committerKoichi Sasada <ko1@atdot.net>2019-07-19 14:41:36 +0900
commitae750799c1b28b06d02e50cd26450b9903516526 (patch)
treebc481e13362b188265911dcbf9b11488bc0c20e4 /debug_counter.h
parenta44ad9a1451eb86385339cfd72713ff764f1c820 (diff)
downloadruby-ae750799c1b28b06d02e50cd26450b9903516526.tar.gz
Use FL_TEST_RAW() to check flags.
FL_TEST() uses FL_ABLE() which test data types. However, in array.c we don't need to check it (all of them should be T_ARRAY), so I changed from FL_TEST() to FL_TEST_RAW() which does not check FL_ABLE(). Instead of FL_ABLE(), add assertion to check given object is a T_ARRAY object. For example, rb_ary_free() becomes slim: with FL_TEST(): 0000000000006a30 <rb_ary_free>: 6a30: 40 f6 c7 07 test $0x7,%dil 6a34: 48 8b 07 mov (%rdi),%rax 6a37: 75 09 jne 6a42 <rb_ary_free+0x12> 6a39: 48 f7 c7 f7 ff ff ff test $0xfffffffffffffff7,%rdi 6a40: 75 1e jne 6a60 <rb_ary_free+0x30> 6a42: a9 00 00 00 02 test $0x2000000,%eax 6a47: 74 07 je 6a50 <rb_ary_free+0x20> 6a49: f3 c3 repz retq 6a4b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 6a50: 48 8b 7f 20 mov 0x20(%rdi),%rdi 6a54: e9 00 00 00 00 jmpq 6a59 <rb_ary_free+0x29> 6a59: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 6a60: 89 c2 mov %eax,%edx 6a62: 83 e2 1f and $0x1f,%edx 6a65: 83 fa 1b cmp $0x1b,%edx 6a68: 74 d8 je 6a42 <rb_ary_free+0x12> 6a6a: f6 c4 60 test $0x60,%ah 6a6d: 74 d3 je 6a42 <rb_ary_free+0x12> 6a6f: eb d8 jmp 6a49 <rb_ary_free+0x19>``` with FL_TEST_RAW(): 0000000000006a30 <rb_ary_free>: 6a30: 48 f7 07 00 60 00 02 testq $0x2006000,(%rdi) 6a37: 74 07 je 6a40 <rb_ary_free+0x10> 6a39: f3 c3 repz retq 6a3b: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 6a40: 48 8b 7f 20 mov 0x20(%rdi),%rdi 6a44: e9 00 00 00 00 jmpq 6a49 <rb_ary_free+0x19>
Diffstat (limited to 'debug_counter.h')
0 files changed, 0 insertions, 0 deletions