changeset 6485:4c246719138e

modified VerifyOopStubCall to use information provided by the (platform independent) backend instead of AMD64 specific nodes for linking the stub call
author Doug Simon <doug.simon@oracle.com>
date Tue, 02 Oct 2012 15:27:00 +0200
parents 90b12b6af72a
children 6237b10b69db
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VerifyOopStubCall.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/AMD64VerifyOopStubCallOp.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java
diffstat 3 files changed, 15 insertions(+), 82 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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;
-    }
-}
--- 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