Mercurial > hg > graal-compiler
annotate graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/LocalImpl.java @ 21619:b14a218c5471
Fix in the dominator based conditional elimination for the corner case of a loop exit merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sun, 31 May 2015 22:48:50 +0200 |
parents | 47bebae7454f |
children |
rev | line source |
---|---|
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
1 /* |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
4 * |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
8 * |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
13 * accompanied this code). |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
14 * |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
18 * |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
21 * questions. |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
22 */ |
21556
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21372
diff
changeset
|
23 package com.oracle.jvmci.meta; |
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
24 |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
25 public class LocalImpl implements Local { |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
26 |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
27 private final String name; |
13306
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
28 private final int startBci; |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
29 private final int endBci; |
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
30 private final int slot; |
16426
775660e1acbc
changed return type of Local.getType() to JavaType
Doug Simon <doug.simon@oracle.com>
parents:
13306
diff
changeset
|
31 private final JavaType type; |
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
32 |
18536
1b904c58f27f
removed static accesses to HotSpotGraalRuntime out of LocalImpl
Doug Simon <doug.simon@oracle.com>
parents:
16436
diff
changeset
|
33 public LocalImpl(String name, JavaType type, int startBci, int endBci, int slot) { |
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
34 this.name = name; |
13306
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
35 this.startBci = startBci; |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
36 this.endBci = endBci; |
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
37 this.slot = slot; |
18536
1b904c58f27f
removed static accesses to HotSpotGraalRuntime out of LocalImpl
Doug Simon <doug.simon@oracle.com>
parents:
16436
diff
changeset
|
38 this.type = type; |
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
39 } |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
40 |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
41 @Override |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
42 public int getStartBCI() { |
13306
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
43 return startBci; |
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
44 } |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
45 |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
46 @Override |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
47 public int getEndBCI() { |
13306
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
48 return endBci; |
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
49 } |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
50 |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
51 @Override |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
52 public String getName() { |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
53 return name; |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
54 } |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
55 |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
56 @Override |
16426
775660e1acbc
changed return type of Local.getType() to JavaType
Doug Simon <doug.simon@oracle.com>
parents:
13306
diff
changeset
|
57 public JavaType getType() { |
775660e1acbc
changed return type of Local.getType() to JavaType
Doug Simon <doug.simon@oracle.com>
parents:
13306
diff
changeset
|
58 return type; |
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
59 } |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
60 |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
61 @Override |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
62 public int getSlot() { |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
63 return slot; |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
64 } |
13306
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
65 |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
66 @Override |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
67 public boolean equals(Object obj) { |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
68 if (!(obj instanceof LocalImpl)) { |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
69 return false; |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
70 } |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
71 LocalImpl that = (LocalImpl) obj; |
16426
775660e1acbc
changed return type of Local.getType() to JavaType
Doug Simon <doug.simon@oracle.com>
parents:
13306
diff
changeset
|
72 return this.name.equals(that.name) && this.startBci == that.startBci && this.endBci == that.endBci && this.slot == that.slot && this.type.equals(that.type); |
13306
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
73 } |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
74 |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
75 @Override |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
76 public int hashCode() { |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
77 return super.hashCode(); |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
78 } |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
79 |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
80 @Override |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
81 public String toString() { |
16436
801017cdfd6a
fixed field name in LocalImpl.toString()
Doug Simon <doug.simon@oracle.com>
parents:
16426
diff
changeset
|
82 return "LocalImpl<name=" + name + ", type=" + type + ", startBci=" + startBci + ", endBci=" + endBci + ", slot=" + slot + ">"; |
13306
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
12431
diff
changeset
|
83 } |
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
diff
changeset
|
84 } |