Mercurial > hg > truffle
annotate test/compiler/dependencies/MonomorphicObjectCall/java/lang/Object.java @ 21172:8c0413281551
Fixed keybinding for open and save actions in IGV
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Fri, 01 May 2015 15:58:57 -0700 |
parents | bee8095780db |
children |
rev | line source |
---|---|
20666
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
1 /* |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
2 * Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved. |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
4 * |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
7 * published by the Free Software Foundation. Oracle designates this |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
8 * particular file as subject to the "Classpath" exception as provided |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
9 * by Oracle in the LICENSE file that accompanied this code. |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
10 * |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
15 * accompanied this code). |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
16 * |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
17 * You should have received a copy of the GNU General Public License version |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
20 * |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
22 * or visit www.oracle.com if you need additional information or have any |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
23 * questions. |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
24 */ |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
25 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
26 package java.lang; |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
27 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
28 /** |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
29 * Slightly modified version of java.lang.Object that replaces |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
30 * finalize() by finalizeObject() to avoid overriding in subclasses. |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
31 */ |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
32 public class Object { |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
33 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
34 private static native void registerNatives(); |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
35 static { |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
36 registerNatives(); |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
37 } |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
38 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
39 public final native Class<?> getClass(); |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
40 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
41 public native int hashCode(); |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
42 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
43 public boolean equals(Object obj) { |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
44 return (this == obj); |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
45 } |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
46 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
47 protected native Object clone() throws CloneNotSupportedException; |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
48 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
49 public String toString() { |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
50 return getClass().getName() + "@" + Integer.toHexString(hashCode()); |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
51 } |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
52 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
53 public final native void notify(); |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
54 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
55 public final native void notifyAll(); |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
56 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
57 public final native void wait(long timeout) throws InterruptedException; |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
58 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
59 public final void wait(long timeout, int nanos) throws InterruptedException { |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
60 if (timeout < 0) { |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
61 throw new IllegalArgumentException("timeout value is negative"); |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
62 } |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
63 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
64 if (nanos < 0 || nanos > 999999) { |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
65 throw new IllegalArgumentException( |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
66 "nanosecond timeout value out of range"); |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
67 } |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
68 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
69 if (nanos >= 500000 || (nanos != 0 && timeout == 0)) { |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
70 timeout++; |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
71 } |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
72 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
73 wait(timeout); |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
74 } |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
75 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
76 public final void wait() throws InterruptedException { |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
77 wait(0); |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
78 } |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
79 |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
80 /** |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
81 * Replaces original finalize() method and is therefore not |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
82 * overridden by any subclasses of Object. |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
83 * @throws Throwable |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
84 */ |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
85 // protected void finalize() throws Throwable { } |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
86 public void finalizeObject() throws Throwable { } |
bee8095780db
8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer
thartmann
parents:
diff
changeset
|
87 } |