public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/15363] New: Binary Compatibility: need special access control
@ 2004-05-10  5:04 tromey at gcc dot gnu dot org
  2004-05-10 15:21 ` [Bug libgcj/15363] " mckinlay at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: tromey at gcc dot gnu dot org @ 2004-05-10  5:04 UTC (permalink / raw)
  To: java-prs

For the BC ABI, we will either need to generate access$0 methods
like we do when generating .class files, or we will need to
have a special case in the access control checking for this 
situation (these methods are made when an inner class accesses
a private method of a containing class).

I'd prefer we make a special case.  All situations requiring
this occur for code in a single compilation unit, something
we can probably check easily at runtime.
(Note that we probably cannot assume that inner classes from
a given compilation will necessarily be those returned;
a malicious class loader might do something different.)

-- 
           Summary: Binary Compatibility: need special access control
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tromey at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org
OtherBugsDependingO 12725
             nThis:


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15363


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libgcj/15363] Binary Compatibility: need special access control
  2004-05-10  5:04 [Bug libgcj/15363] New: Binary Compatibility: need special access control tromey at gcc dot gnu dot org
@ 2004-05-10 15:21 ` mckinlay at redhat dot com
  2004-05-10 15:23 ` pinskia at gcc dot gnu dot org
  2004-05-10 16:14 ` mckinlay at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: mckinlay at redhat dot com @ 2004-05-10 15:21 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mckinlay at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15363


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libgcj/15363] Binary Compatibility: need special access control
  2004-05-10  5:04 [Bug libgcj/15363] New: Binary Compatibility: need special access control tromey at gcc dot gnu dot org
  2004-05-10 15:21 ` [Bug libgcj/15363] " mckinlay at redhat dot com
@ 2004-05-10 15:23 ` pinskia at gcc dot gnu dot org
  2004-05-10 16:14 ` mckinlay at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-10 15:23 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-10 15:23 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-05-10 15:23:28
               date|                            |
            Version|unknown                     |3.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15363


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libgcj/15363] Binary Compatibility: need special access control
  2004-05-10  5:04 [Bug libgcj/15363] New: Binary Compatibility: need special access control tromey at gcc dot gnu dot org
  2004-05-10 15:21 ` [Bug libgcj/15363] " mckinlay at redhat dot com
  2004-05-10 15:23 ` pinskia at gcc dot gnu dot org
@ 2004-05-10 16:14 ` mckinlay at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: mckinlay at redhat dot com @ 2004-05-10 16:14 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From mckinlay at redhat dot com  2004-05-10 15:57 -------
Note that when field access occurs within a compilation unit, we can optimize
dispatch so that a full otable entry is not required:

- If the field access is to a class that within the same compilation unit and
has no superclasses except Object, or all its superclasses are also within the
same compilation unit, then direct dispatch can be used - no otable entry. This
assumes the size of java.lang.Object doesn't change, but I think thats a
reasonable assumption.

- If the field access is to a class within the same compilation unit but which
extends a class in a different compilation unit, then a shortcut dispatch can be
used. We only need to look up the base offset of the object, ie the size of its
superclass. The fixed offset of the object within the current class would then
be added to this offset to find the address of the object. 

The first case is clearly faster in all cases, but the second case isn't so
clear cut since it involves an extra add. However it would reduce the amount of
otable symbol data required and increase sharing of otable entries - when
multiple fields are loaded from the same class, only a single otable load would
be required.

Assuming these dispatch options are used, special cases would typically not be
required within the runtime as inner class field accesses are usually within the
same complation unit. Its conceivable, however, that an inner class could end up
in a different compilation unit from its parent when compiling from bytecode, so
we'd still need to solve this problem for that case.

The best solution is probably to support class metadata attributes for native
code. Specifically, the "InnerClasses" attribute. The runtime can then check
this attribute when performing field access checks and adjust for inner classes
accordingly.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2004-05-10 15:23:28         |2004-05-10 15:57:22
               date|                            |
            Version|3.5.0                       |unknown


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15363


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-05-10 16:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-10  5:04 [Bug libgcj/15363] New: Binary Compatibility: need special access control tromey at gcc dot gnu dot org
2004-05-10 15:21 ` [Bug libgcj/15363] " mckinlay at redhat dot com
2004-05-10 15:23 ` pinskia at gcc dot gnu dot org
2004-05-10 16:14 ` mckinlay at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).