Skip to content

Commit

Permalink
Make word size agnostic.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Rogers committed Jun 6, 2009
1 parent e06fa29 commit 8ce0270
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions rvm/src/org/jikesrvm/ia32/MultianewarrayHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.jikesrvm.runtime.Magic;
import org.jikesrvm.runtime.RuntimeEntrypoints;
import org.vmmagic.unboxed.Address;
import static org.jikesrvm.SizeConstants.BYTES_IN_WORD;

/**
* Helper routine to pull the parameters to multianewarray off the
Expand Down Expand Up @@ -47,9 +48,9 @@ static Object newArrayArray(int methodId, int numDimensions, int typeId, int arg
// fetch number of elements to be allocated for each array dimension
VM.disableGC();
Address argp = Magic.getFramePointer().plus(argOffset);
argp = argp.minus(4);
argp = argp.minus(BYTES_IN_WORD);
dim0 = argp.loadInt();
argp = argp.minus(4);
argp = argp.minus(BYTES_IN_WORD);
dim1 = argp.loadInt();
VM.enableGC();
// validate arguments
Expand All @@ -64,11 +65,7 @@ static Object newArrayArray(int methodId, int numDimensions, int typeId, int arg
VM.disableGC();
Address argp = Magic.getFramePointer().plus(argOffset);
for (int i = 0; i < numDimensions; ++i) {
if (VM.BuildFor32Addr) {
argp = argp.minus(4);
} else {
argp = argp.minus(8);
}
argp = argp.minus(BYTES_IN_WORD);
numElements[i] = argp.loadInt();
}
VM.enableGC();
Expand Down

0 comments on commit 8ce0270

Please sign in to comment.