aboutsummaryrefslogtreecommitdiffstats
path: root/insns.def
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2019-08-02 23:25:38 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-08-02 23:25:38 +0900
commit086ffe72c711179c30a773027e0b4113e908d399 (patch)
tree1ed14b8037dfe0f60d858ec5a1fa019bd1e592dc /insns.def
parente9e17cbc051e894dfd27eda5feca2939f65552db (diff)
downloadruby-086ffe72c711179c30a773027e0b4113e908d399.tar.gz
Revert "Revert "Add a specialized instruction for `.nil?` calls""
This reverts commit a0980f2446c0db735b8ffeb37e241370c458a626. Retry for macOS Mojave.
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def14
1 files changed, 14 insertions, 0 deletions
diff --git a/insns.def b/insns.def
index c971026cf6..7c93af6e4d 100644
--- a/insns.def
+++ b/insns.def
@@ -808,6 +808,20 @@ opt_str_freeze
}
}
+/* optimized nil? */
+DEFINE_INSN
+opt_nil_p
+(CALL_INFO ci, CALL_CACHE cc)
+(VALUE recv)
+(VALUE val)
+{
+ val = vm_opt_nil_p(ci, cc, recv);
+
+ if (val == Qundef) {
+ CALL_SIMPLE_METHOD();
+ }
+}
+
DEFINE_INSN
opt_str_uminus
(VALUE str, CALL_INFO ci, CALL_CACHE cc)