Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PRISM] Implement
PM_KEYWORD_HASH_NODE
for defined?
Ruby code: ```ruby defined? [a: [:b, :c]] ``` Instructions (without optimizations): ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,23)> == catch table | catch type: rescue st: 0001 ed: 0007 sp: 0000 cont: 0009 | == disasm: #<ISeq:defined guard in <compiled>@<compiled>:0 (0,0)-(-1,-1)> | local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) | [ 1] "$!"@0 | 0000 putnil | 0001 leave |------------------------------------------------------------------------ 0000 putnil 0001 putobject true 0003 branchunless 9 0005 putobject "expression" 0007 swap 0008 pop 0009 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,23)> == catch table | catch type: rescue st: 0000 ed: 0009 sp: 0000 cont: 0009 | == disasm: #<ISeq:defined guard in <compiled>@<compiled>:0 (0,0)-(-1,-1)> | local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) | [ 1] "$!"@0 | 0000 putnil | 0001 leave |------------------------------------------------------------------------ 0000 putnil 0001 putobject true 0003 branchunless 9 0005 putobject "expression" 0007 swap 0008 pop 0009 leave ``` Instructions (with optimizations): ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,23)> == catch table | catch type: rescue st: 0001 ed: 0003 sp: 0000 cont: 0005 | == disasm: #<ISeq:defined guard in <compiled>@<compiled>:0 (0,0)-(-1,-1)> | local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) | [ 1] "$!"@0 | 0000 putnil | 0001 leave |------------------------------------------------------------------------ 0000 putnil 0001 putobject "expression" 0003 swap 0004 pop 0005 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,23)> == catch table | catch type: rescue st: 0000 ed: 0005 sp: 0000 cont: 0005 | == disasm: #<ISeq:defined guard in <compiled>@<compiled>:0 (0,0)-(-1,-1)> | local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) | [ 1] "$!"@0 | 0000 putnil | 0001 leave |------------------------------------------------------------------------ 0000 putnil 0001 putobject "expression" 0003 swap 0004 pop 0005 leave ```
- Loading branch information