annotate graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/SourceStackTrace.java @ 21556:48c1ebd24120

renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
author Doug Simon <doug.simon@oracle.com>
date Wed, 27 May 2015 00:36:16 +0200
parents graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/SourceStackTrace.java@2bad5984e4fe
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19745
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved.
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
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: 19745
diff changeset
23 package com.oracle.jvmci.code;
19745
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
25 /**
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
26 * Class representing a exception with a stack trace of the currently processed position in the
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
27 * compiled Java program instead of the stack trace of the compiler. The exception of the compiler
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
28 * is saved as the cause of this exception.
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
29 */
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
30 public abstract class SourceStackTrace extends BailoutException {
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
31 private static final long serialVersionUID = 2144811793442316776L;
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
32
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
33 public static SourceStackTrace create(Throwable cause, String format, StackTraceElement[] elements) {
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
34 return new SourceStackTrace(cause, format) {
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
35
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
36 private static final long serialVersionUID = 6279381376051787907L;
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
37
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
38 @Override
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39 public final synchronized Throwable fillInStackTrace() {
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
40 assert elements != null;
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41 setStackTrace(elements);
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
42 return this;
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
43 }
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
44 };
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
45 }
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
46
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47 private SourceStackTrace(Throwable cause, String format) {
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
48 super(cause, format);
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49 }
2bad5984e4fe Evaluate neverPartOfCompilation assertion only after partial escape analysis and conditional elimination. Create explicit SourceStackTrace exception. Add neverPartOfCompilation unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
50 }