Mercurial > hg > graal-compiler
changeset 9979:70ffc60dbce7
Refactoring
author | Christos Kotselidis <christos.kotselidis@oracle.com> |
---|---|
date | Mon, 10 Jun 2013 12:40:36 +0200 |
parents | 0a7bae701ad6 |
children | 8369c5780c77 |
files | graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java |
diffstat | 2 files changed, 10 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Mon Jun 10 12:36:10 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Mon Jun 10 12:40:36 2013 +0200 @@ -410,7 +410,6 @@ Variable result = newVariable(kind); assert access == null || access instanceof HeapAccess; if (runtime().config.useCompressedOops && isCompressCandidate(access)) { - assert kind == Kind.Object; Variable scratch = newVariable(Kind.Long); append(new LoadCompressedPointer(kind, result, scratch, loadAddress, access != null ? state(access) : null, runtime().config.narrowOopBase, runtime().config.narrowOopShift, runtime().config.logMinObjAlignment)); @@ -433,7 +432,6 @@ } Variable input = load(inputVal); if (runtime().config.useCompressedOops && isCompressCandidate(access)) { - assert kind == Kind.Object; Variable scratch = newVariable(Kind.Long); append(new StoreCompressedPointer(kind, storeAddress, input, scratch, state, runtime().config.narrowOopBase, runtime().config.narrowOopShift, runtime().config.logMinObjAlignment)); } else {
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java Mon Jun 10 12:36:10 2013 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java Mon Jun 10 12:40:36 2013 +0200 @@ -131,19 +131,14 @@ this.narrowOopShift = narrowOopShift; this.logMinObjAlignment = logMinObjAlignment; this.scratch = scratch; + assert kind == Kind.Object; } @Override public void emitMemAccess(AMD64MacroAssembler masm) { - switch (kind) { - case Object: - Register resRegister = asRegister(result); - masm.movl(resRegister, address.toAddress()); - decodeOop(masm, resRegister, narrowOopBase, narrowOopShift, logMinObjAlignment); - break; - default: - throw GraalInternalError.shouldNotReachHere(); - } + Register resRegister = asRegister(result); + masm.movl(resRegister, address.toAddress()); + decodeOop(masm, resRegister, narrowOopBase, narrowOopShift, logMinObjAlignment); } } @@ -211,22 +206,17 @@ this.address = address; this.state = state; this.input = input; + assert kind == Kind.Object; } @Override public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) { - switch (kind) { - case Object: - masm.movq(asRegister(scratch), asRegister(input)); - encodeOop(masm, asRegister(scratch), narrowOopBase, narrowOopShift, logMinObjAlignment); - if (state != null) { - tasm.recordImplicitException(masm.codeBuffer.position(), state); - } - masm.movl(address.toAddress(), asRegister(scratch)); - break; - default: - throw GraalInternalError.shouldNotReachHere(); + masm.movq(asRegister(scratch), asRegister(input)); + encodeOop(masm, asRegister(scratch), narrowOopBase, narrowOopShift, logMinObjAlignment); + if (state != null) { + tasm.recordImplicitException(masm.codeBuffer.position(), state); } + masm.movl(address.toAddress(), asRegister(scratch)); } }