bytecode-manipulation

How to use importlib for rewriting bytecode?

I'm looking for a way to use importlib in Python 2.x to rewrite bytecode of imported modules on-the-fly. In other words, I need to hook my own function between the compilation and execution step during import. Besides that I want the import function to work just as the built-in one. I've already did that with imputil, but that library ...

How can I get the syntax tree from a coderef in Perl?

I'd like to inspect and manipulate code of arbitrary Perl procedures (got by coderefs) in Perl. Is there a tool/module/library for that? Something similar to B::Concise, except that B::Concise prints the code on output, but I'd like to inspect it programmatically. I'd like to use it like this. Given a coderef F, which is called eg. with...

Is it safe to use bytecode enhancement techniques on classes that might be serialized and why?

I haven't tried this yet, but it seems risky. The case I'm thinking of is instrumenting simple VO classes with JiBX. These VOs are going to be serialized over AMF and possibly other schemes. Can anyone confirm or deny my suspicions that doing behind-the-back stuff like bytecode enhancement might mess something up in general, and provi...

POJO to EObject EMF Bytecode Enhancement

Instead of generating code from a model, has there been any work on a bytecode enhancement process? With that, one could just write POJOs, possibly annotate them appropriately, and then they would be automatically enhanced with all EMF features. ...