ruby-changes:69112
From: John <ko1@a...>
Date: Thu, 21 Oct 2021 08:20:52 +0900 (JST)
Subject: [ruby-changes:69112] a02002dc4f (master): More detection of immediate constants
https://git.ruby-lang.org/ruby.git/commit/?id=a02002dc4f From a02002dc4f051515c0b65c17b2ed797bac454b56 Mon Sep 17 00:00:00 2001 From: John Hawthorn <john@h...> Date: Tue, 27 Jul 2021 23:40:51 -0700 Subject: More detection of immediate constants --- yjit_codegen.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/yjit_codegen.c b/yjit_codegen.c index ebb75cbdad..388c8b1e17 100644 --- a/yjit_codegen.c +++ b/yjit_codegen.c @@ -128,9 +128,17 @@ jit_type_of_value(VALUE val) https://github.com/ruby/ruby/blob/trunk/yjit_codegen.c#L128 return TYPE_FIXNUM; } else if (NIL_P(val)) { return TYPE_NIL; + } else if (val == Qtrue) { + return TYPE_TRUE; + } else if (val == Qfalse) { + return TYPE_FALSE; + } else if (STATIC_SYM_P(val)) { + return TYPE_STATIC_SYMBOL; + } else if (FLONUM_P(val)) { + return TYPE_FLONUM; } else { - // generic immediate - return TYPE_IMM; + RUBY_ASSERT(false); + UNREACHABLE_RETURN(TYPE_IMM); } } else { switch (BUILTIN_TYPE(val)) { -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/