Skip to content

WIP: Try to add a fake frame when iseq compilation#5998

Closed
casperisfine wants to merge 1 commit intoruby:masterfrom
Shopify:parser-frame
Closed

WIP: Try to add a fake frame when iseq compilation#5998
casperisfine wants to merge 1 commit intoruby:masterfrom
Shopify:parser-frame

Conversation

@casperisfine
Copy link
Contributor

Ref: https://bugs.ruby-lang.org/issues/18559

When tracing allocations, all the objects created by the compiler are attributed to Kernel.require, making it impossible to measure the static overhead of various parts of an application.

I paired on this with @peterzhu2118, we found a way to push a stack frame before an iseq is compiled, allowing TracePoint to report the right sourcefile.

We haven't however figured a way to set the line number, so all these allocations are reported on line 0.

@casperisfine
Copy link
Contributor Author

Another limitation is that for now it doesn't work with cached iseqs loaded with RubyVM::InstructionSequence.load_from_binary. This one might be tricky since the source path is in the ISeq itself. It might be worth trying to have it loaded at the very first thing and then push it on the stack.

@casperisfine
Copy link
Contributor Author

Closing in favor of #6057

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants