Mercurial > hg > graal-compiler
annotate graal/GraalCompiler/src/com/sun/c1x/ir/RegisterFinalizer.java @ 2522:58c05e4c51e2
Removing two more HIR instructions.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 27 Apr 2011 16:43:31 +0200 |
parents | f6125fb5bfbc |
children | c58a301eb2d7 |
rev | line source |
---|---|
2519
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
1 /* |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
2 * Copyright (c) 2011, 2011, Oracle and/or its affiliates. All rights reserved. |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
4 * |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
8 * |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
13 * accompanied this code). |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
14 * |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
18 * |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
21 * questions. |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
22 */ |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
23 package com.sun.c1x.ir; |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
24 |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
25 import com.sun.c1x.debug.*; |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
26 import com.sun.c1x.value.*; |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
27 import com.sun.cri.ci.*; |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
28 |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
29 public class RegisterFinalizer extends StateSplit { |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
30 |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
31 private Value object; |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
32 |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
33 public RegisterFinalizer(Value object, FrameState stateBefore) { |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
34 super(CiKind.Void, stateBefore); |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
35 this.object = object; |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
36 } |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
37 |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
38 public Value object() { |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
39 return object; |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
40 } |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
41 |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
42 @Override |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
43 public void inputValuesDo(ValueClosure closure) { |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
44 object = closure.apply(object); |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
45 super.inputValuesDo(closure); |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
46 } |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
47 |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
48 @Override |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
49 public void accept(ValueVisitor v) { |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
50 v.visitRegisterFinalizer(this); |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
51 } |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
52 |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
53 @Override |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
54 public boolean canTrap() { |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
55 return true; |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
56 } |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
57 |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
58 @Override |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
59 public void print(LogStream out) { |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
60 out.print("register finalizer ").print(object); |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
61 } |
f6125fb5bfbc
Removed intrinsics.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
62 } |