aboutsummaryrefslogtreecommitdiffstats
path: root/insns.def
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-21 10:52:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-21 10:52:52 +0000
commitffd56ee5f8d0959f1e11ffcc5662b08220d39d85 (patch)
tree1c38fd12acbc0a3cb55bb6d0bc89970c3438d86a /insns.def
parentb648ada3be2e612e3e5f6506953aff99a27eef1c (diff)
downloadruby-ffd56ee5f8d0959f1e11ffcc5662b08220d39d85.tar.gz
insns.def: checktype
* insns.def (checktype): split branchiftype to checktype and branchif, to make branch condition negation possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def23
1 files changed, 10 insertions, 13 deletions
diff --git a/insns.def b/insns.def
index da54e0a4b1..cac337423f 100644
--- a/insns.def
+++ b/insns.def
@@ -655,6 +655,16 @@ checkkeyword
ret = vm_check_keyword(kw_bits_index, keyword_index, GET_EP());
}
+/* check if val is type. */
+DEFINE_INSN
+checktype
+(rb_num_t type)
+(VALUE val)
+(VALUE ret)
+{
+ ret = (TYPE(val) == (int)type) ? Qtrue : Qfalse;
+}
+
/* fire a coverage event (currently, this is used for line coverage and branch coverage) */
DEFINE_INSN
tracecoverage
@@ -926,19 +936,6 @@ branchnil
}
}
-/* if val is type, set PC to (PC + dst). */
-DEFINE_INSN
-branchiftype
-(rb_num_t type, OFFSET dst)
-(VALUE val)
-()
-{
- if (TYPE(val) == (int)type) {
- RUBY_VM_CHECK_INTS(ec);
- JUMP(dst);
- }
-}
-
/**********************************************************/
/* for optimize */
/**********************************************************/