This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
On Thu, 14 Aug 2003, Andrew Haley wrote:static int a, b; ... return a + b;
Does this require 2, 3 or 4 memory loads?
(I believe 2 is the answer for non-PIC, 4 for PIC. If we take advantage
of the fact that static fields are at a fixed offset from the class
record, it can be done in three, while preserving position independence.)
Unless a and b are in the exact same class as the 'return a + b' statment, the positions of a and b relative to the class record may change.
load offset of a load offset of b load class pointer load a load b
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |