# HG changeset patch # User Christian Wimmer # Date 1354303370 28800 # Node ID 4aa99b5b158b68baef3804e2a124b74ff75c25d7 # Parent 3b91556bd51839e54daa54773fb69f0d3ba1f888 LIR generation for BreakpointNode is not HotSpot specific and generally useful, so it should not be in HotSpot project diff -r 3b91556bd518 -r 4aa99b5b158b graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java --- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Fri Nov 30 11:21:54 2012 -0800 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Fri Nov 30 11:22:50 2012 -0800 @@ -699,4 +699,16 @@ append(new CondMoveOp(result, Condition.EQ, load(Constant.TRUE), Constant.FALSE)); setResult(node, result); } + + @Override + public void visitBreakpointNode(BreakpointNode node) { + Kind[] sig = new Kind[node.arguments.size()]; + for (int i = 0; i < sig.length; i++) { + sig[i] = node.arguments.get(i).kind(); + } + + CallingConvention cc = frameMap.registerConfig.getCallingConvention(CallingConvention.Type.JavaCall, Kind.Void, sig, target(), false); + Value[] parameters = visitInvokeArguments(cc, node.arguments); + append(new AMD64BreakpointOp(parameters)); + } } diff -r 3b91556bd518 -r 4aa99b5b158b graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64BreakpointOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64BreakpointOp.java Fri Nov 30 11:21:54 2012 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2011, 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.amd64; - -import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; - -import com.oracle.graal.api.meta.*; -import com.oracle.graal.asm.amd64.*; -import com.oracle.graal.lir.LIRInstruction.Opcode; -import com.oracle.graal.lir.amd64.*; -import com.oracle.graal.lir.asm.*; - -/** - * Emits a breakpoint. - */ -@Opcode("BREAKPOINT") -public class AMD64BreakpointOp extends AMD64LIRInstruction { - - /** - * A set of values loaded into the Java ABI parameter locations (for inspection by a debugger). - */ - @Use({REG, STACK}) protected Value[] parameters; - - public AMD64BreakpointOp(Value[] parameters) { - this.parameters = parameters; - } - - @Override - public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler asm) { - asm.int3(); - } -} diff -r 3b91556bd518 -r 4aa99b5b158b graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Fri Nov 30 11:21:54 2012 -0800 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Fri Nov 30 11:22:50 2012 -0800 @@ -88,19 +88,6 @@ } @Override - public void visitBreakpointNode(BreakpointNode i) { - Kind[] sig = new Kind[i.arguments.size()]; - int pos = 0; - for (ValueNode arg : i.arguments) { - sig[pos++] = arg.kind(); - } - - CallingConvention cc = frameMap.registerConfig.getCallingConvention(CallingConvention.Type.JavaCall, Kind.Void, sig, target(), false); - Value[] parameters = visitInvokeArguments(cc, i.arguments); - append(new AMD64BreakpointOp(parameters)); - } - - @Override public void visitExceptionObject(ExceptionObjectNode x) { HotSpotVMConfig config = runtime().config; RegisterValue thread = runtime().threadRegister().asValue(); diff -r 3b91556bd518 -r 4aa99b5b158b graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64BreakpointOp.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64BreakpointOp.java Fri Nov 30 11:22:50 2012 -0800 @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2011, 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.lir.amd64; + +import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; + +import com.oracle.graal.api.meta.*; +import com.oracle.graal.asm.amd64.*; +import com.oracle.graal.lir.LIRInstruction.Opcode; +import com.oracle.graal.lir.asm.*; + +/** + * Emits a breakpoint. + */ +@Opcode("BREAKPOINT") +public class AMD64BreakpointOp extends AMD64LIRInstruction { + + /** + * A set of values loaded into the Java ABI parameter locations (for inspection by a debugger). + */ + @Use({REG, STACK}) protected Value[] parameters; + + public AMD64BreakpointOp(Value[] parameters) { + this.parameters = parameters; + } + + @Override + public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler asm) { + asm.int3(); + } +}