# HG changeset patch # User Doug Simon # Date 1349184420 -7200 # Node ID 4c246719138e118b867287f316b6512025b870db # Parent 90b12b6af72a97fe632e5ee9b38a608a27af227d modified VerifyOopStubCall to use information provided by the (platform independent) backend instead of AMD64 specific nodes for linking the stub call diff -r 90b12b6af72a -r 4c246719138e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VerifyOopStubCall.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VerifyOopStubCall.java Tue Oct 02 15:20:07 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VerifyOopStubCall.java Tue Oct 02 15:27:00 2012 +0200 @@ -22,21 +22,15 @@ */ package com.oracle.graal.hotspot.nodes; -import static com.oracle.graal.hotspot.target.amd64.AMD64VerifyOopStubCallOp.*; - -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.compiler.target.*; -import com.oracle.graal.hotspot.target.amd64.*; -import com.oracle.graal.lir.*; +import com.oracle.graal.hotspot.*; +import com.oracle.graal.hotspot.target.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.type.*; /** * Node implementing a call to HotSpot's object pointer verification stub. - * - * @see AMD64VerifyOopStubCallOp */ public class VerifyOopStubCall extends FixedWithNextNode implements LIRGenLowerable { @@ -49,10 +43,9 @@ @Override public void generate(LIRGenerator gen) { - RegisterValue objectFixed = OBJECT.asValue(Kind.Object); - gen.emitMove(gen.operand(object), objectFixed); - LIRFrameState info = gen.state(); - gen.append(new AMD64VerifyOopStubCallOp(objectFixed, info)); + HotSpotBackend backend = (HotSpotBackend) HotSpotGraalRuntime.getInstance().getCompiler().backend; + HotSpotStub stub = backend.getStub("verify_oop"); + gen.emitCall(stub.address, stub.cc, true, gen.operand(object)); } @NodeIntrinsic diff -r 90b12b6af72a -r 4c246719138e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64VerifyOopStubCallOp.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64VerifyOopStubCallOp.java Tue Oct 02 15:20:07 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.hotspot.target.amd64; - -import static com.oracle.graal.api.code.ValueUtil.*; - -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.hotspot.*; -import com.oracle.graal.lir.*; -import com.oracle.graal.lir.LIRInstruction.Opcode; -import com.oracle.graal.lir.amd64.*; -import com.oracle.graal.lir.asm.*; -import com.oracle.max.asm.target.amd64.*; - -/** - * A call to HotSpot's object pointer verification stub. - */ -@Opcode("VERIFY_OOP_STUB") -public class AMD64VerifyOopStubCallOp extends AMD64LIRInstruction { - - /** - * The stub expects the object pointer in R13. - */ - public static final Register OBJECT = AMD64.r13; - - @Use protected Value object; - @State protected LIRFrameState state; - - public AMD64VerifyOopStubCallOp(Value object, LIRFrameState state) { - this.object = object; - this.state = state; - } - - @Override - public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) { - AMD64Call.directCall(tasm, masm, HotSpotGraalRuntime.getInstance().getConfig().verifyOopStub, state); - } - - @Override - protected void verify() { - super.verify(); - assert asRegister(object) == OBJECT : "expects object in " + OBJECT; - } -} diff -r 90b12b6af72a -r 4c246719138e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java Tue Oct 02 15:20:07 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java Tue Oct 02 15:27:00 2012 +0200 @@ -91,11 +91,16 @@ /* arg0: hub */ rdx.asValue(Kind.Object)); addStub("new_multi_array", c.newMultiArrayStub, - /* temps */ null, - /* ret */ rax.asValue(Kind.Object), - /* arg0: hub */ rax.asValue(Kind.Object), - /* arg1: rank */ rbx.asValue(Kind.Int), - /* arg2: dims */ rcx.asValue(word)); + /* temps */ null, + /* ret */ rax.asValue(Kind.Object), + /* arg0: hub */ rax.asValue(Kind.Object), + /* arg1: rank */ rbx.asValue(Kind.Int), + /* arg2: dims */ rcx.asValue(word)); + + addStub("verify_oop", c.verifyOopStub, + /* temps */ null, + /* ret */ IllegalValue, + /* arg0: object */ r13.asValue(Kind.Object)); } @Override