Mercurial > hg > graal-compiler
annotate graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/NeverValidAssumption.java @ 21550:f48a6cea31eb
fixed canonicalizeprojects issues
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 26 May 2015 12:27:05 +0200 |
parents | e9c8742148c1 |
children |
rev | line source |
---|---|
17057
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
1 /* |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
4 * |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. Oracle designates this |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
8 * particular file as subject to the "Classpath" exception as provided |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
9 * by Oracle in the LICENSE file that accompanied this code. |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
10 * |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
15 * accompanied this code). |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
16 * |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License version |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
20 * |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
22 * or visit www.oracle.com if you need additional information or have any |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
23 * questions. |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
24 */ |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
25 package com.oracle.truffle.api.utilities; |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
26 |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
27 import com.oracle.truffle.api.*; |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
28 import com.oracle.truffle.api.nodes.*; |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
29 |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
30 /** |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
31 * An assumption that is never valid. Used as a placeholder where an assumption is needed that |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
32 * should be invalid from the start. |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
33 */ |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
34 public final class NeverValidAssumption implements Assumption { |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
35 |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
36 public static final NeverValidAssumption INSTANCE = new NeverValidAssumption(); |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
37 |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
38 private NeverValidAssumption() { |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
39 } |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
40 |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
41 @Override |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
42 public void check() throws InvalidAssumptionException { |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
43 throw new InvalidAssumptionException(); |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
44 } |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
45 |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
46 @Override |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
47 public void invalidate() { |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
48 } |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
49 |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
50 @Override |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
51 public String getName() { |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
52 return getClass().getName(); |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
53 } |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
54 |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
55 @Override |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
56 public boolean isValid() { |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
57 return false; |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
58 } |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
59 |
d51c097cca37
Truffle: Add NeverValidAssumption.
Chris Seaton <chris.seaton@oracle.com>
parents:
diff
changeset
|
60 } |