Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316616 - [compiler][otre] OT/J: support for callin-interception of constructor-calls
Summary: [compiler][otre] OT/J: support for callin-interception of constructor-calls
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 1.4   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 2.2 RC1   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard: trac
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2010-06-11 10:19 EDT by Stephan Herrmann CLA
Modified: 2013-06-06 14:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2010-06-11 10:19:16 EDT
(originally from http://trac.objectteams.org/ot/ticket/184)
Just to put this on our long-term radar.

Besides basic method interception there are several cases where a constructor call needs to be intercepted by a callin directly.

(comment:1)
We need to carefully distinguish here:

  * after callins to a constructor are feasible with only some changes even in 
    the current implementation, because the additional dispatch code can be 
    inserted to the end of a constructor (about remaining differences /
    difficulties see below).
  * before and replace callins to a constructor would have to happen at the 
    call site => not further investigating since we don't do call-site-weaving.

Remaining difficulties for after:
  * We cannot use the pattern of initial-wrapper, orig-method, chaining-
    wrapper, because the original constructor cannot be renamed, and any 
    chaining of constructors would need to happen before any additional code is 
    executed. A probable solution:
    o inline the lookup of active teams (normally done in the initial wrapper) 
      into the end of the constructor.
    o generate a chaining wrapper containing only calls to after callins. 
  * It will have to be checked, whether this proposed pattern solves all issues 
    of inheritance in the same way as the normal callin implementation does. 

---
(above descriptions partly updated wrt the original trac issue).

Question: why would a chaining wrapper be needed when only calling
after bindings?
Comment 1 Stephan Herrmann CLA 2013-05-19 19:06:42 EDT
Support for callin-after to constructor has been released for 2.2 RC1 via
commit 12a20748e9e180d0cb9ed70d2f88cf8f1c309085.

A first application can already be found in the fix for bug 408460.
Comment 2 Stephan Herrmann CLA 2013-06-06 14:10:07 EDT
Verified for 2.2 using build 201306040500