Created
June 28, 2020 08:01
-
-
Save palkan/dcab4ed0978dfe6f55f9b6533d3e80a9 to your computer and use it in GitHub Desktop.
compile.c ADD_STACKPRINT
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
#define ADD_STACKPRINT(label, depth) do {\ | |
ADD_INSN1(ret, line, putobject, rb_fstring_lit(label));\ | |
ADD_SEND(ret, line, rb_intern("putme"), INT2FIX(0));\ | |
ADD_INSN(ret, line, pop);\ | |
for (int x = 0; x < depth ; x++ ){\ | |
ADD_INSN1(ret, line, topn, INT2FIX(x));\ | |
ADD_SEND(ret, line, rb_intern("putme"), INT2FIX(0));\ | |
ADD_INSN(ret, line, pop);\ | |
}\ | |
} while(0) |
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
module Kernel | |
def putme(val = self) | |
p val | |
end | |
end | |
# some code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment