Mercurial > hg > truffle
annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/NullCheckNode.java @ 13277:ce017d1e4234
Merge.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 09 Dec 2013 17:31:12 +0100 |
parents | 24ff15442a09 |
children | 1cf373d2b415 |
rev | line source |
---|---|
8390
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
1 /* |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
4 * |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
8 * |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
13 * accompanied this code). |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
14 * |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
18 * |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
21 * questions. |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
22 */ |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
23 package com.oracle.graal.nodes.extended; |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
24 |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
25 import com.oracle.graal.nodes.*; |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
26 import com.oracle.graal.nodes.spi.*; |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
27 import com.oracle.graal.nodes.type.*; |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
28 |
9646
183d33c76419
Removed ValueNode.dependencies
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8892
diff
changeset
|
29 public class NullCheckNode extends DeoptimizingFixedWithNextNode implements LIRLowerable, GuardingNode { |
8390
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
30 |
9715
badabdca0c53
fix final-ness of @Input node inputs
Lukas Stadler <lukas.stadler@jku.at>
parents:
9646
diff
changeset
|
31 @Input private ValueNode object; |
8390
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
32 |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
33 public NullCheckNode(ValueNode object) { |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
34 super(StampFactory.dependency()); |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
35 this.object = object; |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
36 } |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
37 |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
38 public ValueNode getObject() { |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
39 return object; |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
40 } |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
41 |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
42 @Override |
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
43 public void generate(LIRGeneratorTool generator) { |
8892
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8390
diff
changeset
|
44 generator.emitNullCheck(object, this); |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8390
diff
changeset
|
45 } |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8390
diff
changeset
|
46 |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8390
diff
changeset
|
47 @Override |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8390
diff
changeset
|
48 public boolean canDeoptimize() { |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8390
diff
changeset
|
49 return true; |
2c0c708a0ad6
Introduce DeoptimizingNode interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8390
diff
changeset
|
50 } |
8390
acc24060b64f
Use implicit null checks for all null checks
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
51 } |