annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrierPreStubCall.java @ 9595:db2125285960

replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
author Doug Simon <doug.simon@oracle.com>
date Tue, 07 May 2013 01:53:01 +0200
parents 2c0c708a0ad6
children fb2cf3033ebb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
1 /*
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
4 *
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
8 *
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
13 * accompanied this code).
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
14 *
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
18 *
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
21 * questions.
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
22 */
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
23 package com.oracle.graal.hotspot.nodes;
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
24
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
25 import com.oracle.graal.api.code.*;
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
26 import com.oracle.graal.api.code.RuntimeCallTarget.Descriptor;
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
27 import com.oracle.graal.compiler.gen.*;
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
28 import com.oracle.graal.compiler.target.*;
9595
db2125285960 replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 8892
diff changeset
29 import com.oracle.graal.hotspot.stubs.*;
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
30 import com.oracle.graal.nodes.*;
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
31 import com.oracle.graal.nodes.type.*;
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
32
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
33 /**
9595
db2125285960 replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 8892
diff changeset
34 * Node implementing a call to {@link WriteBarrierPreStub}.
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
35 */
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
36 public class WriteBarrierPreStubCall extends FixedWithNextNode implements LIRGenLowerable {
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
37
8507
c92949b1ec8a -Changes after CR-243
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8501
diff changeset
38 @Input private ValueNode object;
9595
db2125285960 replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 8892
diff changeset
39 public static final Descriptor WRITE_BARRIER_PRE = new Descriptor("writeBarrierPre", true, void.class, Object.class);
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
40
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
41 public WriteBarrierPreStubCall(ValueNode object) {
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
42 super(StampFactory.forVoid());
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
43 this.object = object;
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
44 }
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
45
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
46 @Override
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
47 public void generate(LIRGenerator gen) {
9595
db2125285960 replaced wb_pre_call and wb_post_call assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 8892
diff changeset
48 RuntimeCallTarget stub = gen.getRuntime().lookupRuntimeCall(WriteBarrierPreStubCall.WRITE_BARRIER_PRE);
8892
2c0c708a0ad6 Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8507
diff changeset
49 gen.emitCall(stub, stub.getCallingConvention(), null, gen.operand(object));
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
50 }
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
51
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
52 @NodeIntrinsic
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
53 public static native void call(Object hub);
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
diff changeset
54 }