Created
August 27, 2017 01:24
-
-
Save mufid/879562a8a3d78f8b6ddc898a87cb0e80 to your computer and use it in GitHub Desktop.
This file contains 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 characters
[1] pry(main)> require 'pp' | |
=> false | |
[2] pry(main)> pp RubyVM::InstructionSequence.compile('["aku", "suka", "ini"]').to_a | |
["YARVInstructionSequence/SimpleDataFormat", | |
2, | |
3, | |
1, | |
{:arg_size=>0, :local_size=>0, :stack_max=>3}, | |
"<compiled>", | |
"<compiled>", | |
nil, | |
1, | |
:top, | |
[], | |
{}, | |
[], | |
[1, | |
[:trace, 1], | |
[:putstring, "aku"], | |
[:putstring, "suka"], | |
[:putstring, "ini"], | |
[:newarray, 3], | |
[:leave]]] | |
=> ["YARVInstructionSequence/SimpleDataFormat", | |
2, | |
3, | |
1, | |
{:arg_size=>0, :local_size=>0, :stack_max=>3}, | |
"<compiled>", | |
"<compiled>", | |
nil, | |
1, | |
:top, | |
[], | |
{}, | |
[], | |
[1, [:trace, 1], [:putstring, "aku"], [:putstring, "suka"], [:putstring, "ini"], [:newarray, 3], [:leave]]] | |
[3] pry(main)> pp RubyVM::InstructionSequence.compile('%w{aku suka ini}').to_a | |
["YARVInstructionSequence/SimpleDataFormat", | |
2, | |
3, | |
1, | |
{:arg_size=>0, :local_size=>0, :stack_max=>3}, | |
"<compiled>", | |
"<compiled>", | |
nil, | |
1, | |
:top, | |
[], | |
{}, | |
[], | |
[1, | |
[:trace, 1], | |
[:putstring, "aku"], | |
[:putstring, "suka"], | |
[:putstring, "ini"], | |
[:newarray, 3], | |
[:leave]]] | |
=> ["YARVInstructionSequence/SimpleDataFormat", | |
2, | |
3, | |
1, | |
{:arg_size=>0, :local_size=>0, :stack_max=>3}, | |
"<compiled>", | |
"<compiled>", | |
nil, | |
1, | |
:top, | |
[], | |
{}, | |
[], | |
[1, [:trace, 1], [:putstring, "aku"], [:putstring, "suka"], [:putstring, "ini"], [:newarray, 3], [:leave]]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment