Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRubyYARV bytecodeSingle-choice MCQ

In the YARV disassembly of `a = 1; b = 2; a + b`, the literal 1 is loaded with putobject_INT2FIX_1_ and the addition uses opt_plus. What does the specialized opt_plus instruction do that a generic method send would not?

# 0000 putobject_INT2FIX_1_ # 0001 setlocal_WC_0 a@0 # 0003 putobject 2 # 0005 setlocal_WC_0 b@1 # 0007 getlocal_WC_0 a@0 # 0009 getlocal_WC_0 b@1 # 0011 opt_plus <calldata!mid:+, argc:1> # 0013 leave