Created
August 30, 2016 03:41
-
-
Save hibariya/eb0225db8de6ca06e0739f2ffb348af2 to your computer and use it in GitHub Desktop.
Revisions
-
hibariya created this gist
Aug 30, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ # 1 instruction puts RubyVM::InstructionSequence.compile(%('hi')).disasm # == disasm: #<ISeq:<compiled>@<compiled>>================================ # 0000 trace 1 ( 1) # 0002 putstring "hi" # 0004 leave # 1 instruction puts RubyVM::InstructionSequence.compile(%('hi'.freeze)).disasm # == disasm: #<ISeq:<compiled>@<compiled>>================================ # 0000 trace 1 ( 1) # 0002 opt_str_freeze "hi" # 0004 leave # 3 instructions puts RubyVM::InstructionSequence.compile(%('hi'.itself.freeze)).disasm # == disasm: #<ISeq:<compiled>@<compiled>>================================ # 0000 trace 1 ( 1) # 0002 putstring "hi" # 0004 opt_send_without_block <callinfo!mid:itself, argc:0, ARGS_SIMPLE>, <callcache> # 0007 opt_send_without_block <callinfo!mid:freeze, argc:0, ARGS_SIMPLE>, <callcache> # 0010 leave