code = <@>================================ 0000 trace 1 ( 1) 0002 putspecialobject 3 0004 putnil 0005 defineclass :NilClass, , 0 0009 leave == disasm: #@>========================== 0000 trace 2 ( 1) 0002 trace 1 ( 2) 0004 putspecialobject 1 0006 putobject :null? 0008 putiseq null? 0010 opt_send_without_block , 0013 trace 4 ( 5) 0015 leave ( 2) == disasm: #>===================================== 0000 trace 8 ( 2) 0002 trace 1 ( 3) 0004 putobject true 0006 trace 16 ( 4) 0008 leave // Observe that first a class NilClass is defined // (it already exists, but Ruby byte-compiler may not know this), // and that is done by opcode "defineclass" on the special // object VM_SPECIAL_OBJECT_CONST_BASE . // Then the method null? for it is defined, by calling // define_method on the special object VM_SPECIAL_OBJECT_CBASE enum vm_special_object_type { VM_SPECIAL_OBJECT_VMCORE = 1, VM_SPECIAL_OBJECT_CBASE, // 2 VM_SPECIAL_OBJECT_CONST_BASE // 3 }; // Compare it with how "def" works: // http://stackoverflow.com/questions/896078/how-does-the-putspecialobject-opcode-in-the-rubyvm-work // You see that whenever "def" occurs in your code.