changeset 7666:31540ca73e81

Remove ControlFlowException in SimpleLanguage.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 01 Feb 2013 19:53:52 +0100
parents 386b00821c66
children 10a72efd23bc
files graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/ControlFlowException.java graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/BreakException.java graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/ContinueException.java graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/ControlFlowException.java graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/ReturnException.java
diffstat 5 files changed, 16 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/ControlFlowException.java	Fri Feb 01 19:50:04 2013 +0100
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/ControlFlowException.java	Fri Feb 01 19:53:52 2013 +0100
@@ -26,14 +26,21 @@
  * An exception thrown to model control flow in a Truffle interpreter. The Truffle optimizer has
  * special knowledge of this exception class for performance optimizations.
  */
-public class ControlFlowException extends Exception {
+public class ControlFlowException extends RuntimeException {
 
     private static final long serialVersionUID = 3676602078425211386L;
 
     /**
      * Creates an exception thrown to model control flow.
      */
-    public ControlFlowException(String message, Throwable cause) {
-        super(message, cause);
+    public ControlFlowException() {
+    }
+
+    /**
+     * For performance reasons, this exception does not record any stack trace information.
+     */
+    @Override
+    public synchronized Throwable fillInStackTrace() {
+        return null;
     }
 }
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/BreakException.java	Fri Feb 01 19:50:04 2013 +0100
+++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/BreakException.java	Fri Feb 01 19:53:52 2013 +0100
@@ -22,6 +22,8 @@
  */
 package com.oracle.truffle.sl.nodes;
 
+import com.oracle.truffle.api.nodes.*;
+
 public final class BreakException extends ControlFlowException {
 
     private static final long serialVersionUID = -91013036379258890L;
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/ContinueException.java	Fri Feb 01 19:50:04 2013 +0100
+++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/ContinueException.java	Fri Feb 01 19:53:52 2013 +0100
@@ -22,6 +22,8 @@
  */
 package com.oracle.truffle.sl.nodes;
 
+import com.oracle.truffle.api.nodes.*;
+
 public final class ContinueException extends ControlFlowException {
 
     private static final long serialVersionUID = 5329687983726237188L;
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/ControlFlowException.java	Fri Feb 01 19:50:04 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.truffle.sl.nodes;
-
-/**
- * Common base class for exceptions that are used to implement control flow.
- */
-public abstract class ControlFlowException extends RuntimeException {
-
-    private static final long serialVersionUID = 4924673852577649008L;
-
-    @SuppressWarnings("all")
-    @Override
-    public final Throwable fillInStackTrace() {
-        return null;
-    }
-}
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/ReturnException.java	Fri Feb 01 19:50:04 2013 +0100
+++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/ReturnException.java	Fri Feb 01 19:53:52 2013 +0100
@@ -22,6 +22,8 @@
  */
 package com.oracle.truffle.sl.nodes;
 
+import com.oracle.truffle.api.nodes.*;
+
 public final class ReturnException extends ControlFlowException {
 
     private static final long serialVersionUID = 4073191346281369231L;