Interpreter Implementation of Advice Weaving
        
            
    ID
              TR-2010-01
          Publishing date
              January 22, 2010
          Length
              12 pages
          Abstract
              When late-binding of advice is used for incremental development or configuration, implementing advice weaving using code rewriting external to the VM can cause performance problems during application startup. We present an interpreter-based (non-rewriting) weaver that uses a simple table and cache structure for matching pointcuts against dynamic join points together with a simple mechanism for calling the matched advice.  An implementation of our approach in the Jikes RVM shows its feasibility. Internal micro-benchmarks show dynamic join point execution overhead of approximately 28% in the common case where no advice is applicable and that start-up performance is improved over    VM-external weavers. The cache and table structures could be used    during later (i.e. JIT time) per-method rewrite based weaving to reduce pointcut matching overhead. We conclude that it is worthwhile to develop and evaluate a complete in-VM hybrid implementation, comprising both non-rewriting and rewriting based advice weaving.