Project

General

Profile

Feature #7122

convert default getter/setter as plain Java methods

Added by Constantin Asofiei about 1 year ago. Updated about 2 months ago.

Status:
WIP
Priority:
Normal
Target version:
-
Start date:
Due date:
% Done:

80%

billable:
No
vendor_id:
GCD

Related issues

Related to Base Language - Bug #7176: cleanup p2j.oo code considering the #7045 and #7122 New

History

#1 Updated by Constantin Asofiei about 1 year ago

I don't see any reason to have the BlockManager.function/procedure wrappers for default scalar getter/setter Java methods (I'm not sure yet if extent, too, and objects/memptr will need special attention). I think it should be safe to just emit the assignment of the property like prop.assign(var); or return of a copy of the property, like return prop.duplicate();.

#2 Updated by Constantin Asofiei about 1 year ago

  • Assignee set to Constantin Asofiei
  • Status changed from New to WIP

#3 Updated by Constantin Asofiei about 1 year ago

  • % Done changed from 0 to 80

For default object property getter and setters, emit a plain Java method with a return prop.duplicate(); for a getter, and a prop.assign(var); for the setter. This is currently done only for scalar properties, with types other than object or memptr.

These changes are in 7026a/14816.

#4 Updated by Constantin Asofiei about 1 year ago

  • Related to Bug #7176: cleanup p2j.oo code considering the #7045 and #7122 added

#5 Updated by Constantin Asofiei about 2 months ago

In 8363d, a property getter with only a 'return <literal>.' body will convert to a Java return which will wrap the literal to a BDT, like return new character("literal");. This avoids the overhead of the BlockManager APIs.

Also available in: Atom PDF