src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/UnwarrantedOptimismException.java
author hannesw
Tue, 12 Dec 2017 15:38:18 +0100
changeset 48247 fa5a47cad0c9
parent 47216 71c04702a3d5
permissions -rw-r--r--
8069338: Implement sharedScopeCall for optimistic types Reviewed-by: attila, sundar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24719
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     1
/*
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     2
 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     4
 *
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    10
 *
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    15
 * accompanied this code).
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    16
 *
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    20
 *
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    23
 * questions.
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    24
 */
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    25
package jdk.nashorn.internal.runtime;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    26
24776
966226aeee50 8044518: Ensure exceptions related to optimistic recompilation are not serializable
attila
parents: 24751
diff changeset
    27
import java.io.NotSerializableException;
966226aeee50 8044518: Ensure exceptions related to optimistic recompilation are not serializable
attila
parents: 24751
diff changeset
    28
import java.io.ObjectInputStream;
966226aeee50 8044518: Ensure exceptions related to optimistic recompilation are not serializable
attila
parents: 24751
diff changeset
    29
import java.io.ObjectOutputStream;
24719
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    30
import jdk.nashorn.internal.codegen.types.Type;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    31
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    32
/**
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    33
 * This exception is thrown from an optimistic operation, e.g. an integer add,
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    34
 * that was to optimistic for what really took place. Typically things like
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    35
 * trying to get an array element that we want to be an int, and it was a double,
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    36
 * and an int add that actually overflows and needs a double for the representation
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    37
 */
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    38
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    39
@SuppressWarnings("serial")
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    40
public final class UnwarrantedOptimismException extends RuntimeException {
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    41
    /** Denotes an invalid program point */
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    42
    public static final int INVALID_PROGRAM_POINT = -1;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    43
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    44
    /** The value for the first ordinary program point */
24751
ccbd9cd3f720 8042118: Separate types from symbols
attila
parents: 24719
diff changeset
    45
    public static final int FIRST_PROGRAM_POINT = 1;
24719
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    46
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    47
    private Object returnValue;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    48
    private final int    programPoint;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    49
    private final Type   returnType;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    50
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    51
    /**
34732
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
    52
     * Constructor without explicit return type. The return type is determined statically from the class of
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
    53
     * the return value, and only canonical internal number representations are recognized. Use
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
    54
     * {@link #createNarrowest} if you want to handle float and long values as numbers instead of objects.
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
    55
     *
24719
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    56
     * @param returnValue actual return value from the too narrow operation
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    57
     * @param programPoint program point where unwarranted optimism was detected
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    58
     */
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    59
    public UnwarrantedOptimismException(final Object returnValue, final int programPoint) {
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    60
        this(returnValue, programPoint, getReturnType(returnValue));
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    61
    }
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    62
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    63
    /**
34732
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
    64
     * Check if a program point is valid.
24719
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    65
     * @param programPoint the program point
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    66
     * @return true if valid
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    67
     */
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    68
    public static boolean isValid(final int programPoint) {
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    69
        assert programPoint >= INVALID_PROGRAM_POINT;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    70
        return programPoint != INVALID_PROGRAM_POINT;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    71
    }
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    72
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    73
    private static Type getReturnType(final Object v) {
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    74
        if (v instanceof Double) {
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    75
            return Type.NUMBER;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    76
        }
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    77
        assert !(v instanceof Integer) : v + " is an int"; // Can't have an unwarranted optimism exception with int
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    78
        return Type.OBJECT;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    79
    }
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    80
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    81
    /**
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    82
     * Constructor with explicit return value type.
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    83
     * @param returnValue actual return value from the too narrow operation
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    84
     * @param programPoint program point where unwarranted optimism was detected
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    85
     * @param returnType type of the returned value. Used to disambiguate the return type. E.g. an {@code ObjectArrayData}
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    86
     * might return a {@link Double} for a particular element getter, but still throw this exception even if the call
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    87
     * site can accept a double, since the array's type is actually {@code Type#OBJECT}. In this case, it must
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    88
     * explicitly use this constructor to indicate its values are to be considered {@code Type#OBJECT} and not
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    89
     * {@code Type#NUMBER}.
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    90
     */
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    91
    public UnwarrantedOptimismException(final Object returnValue, final int programPoint, final Type returnType) {
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    92
        super("", null, false, Context.DEBUG);
24751
ccbd9cd3f720 8042118: Separate types from symbols
attila
parents: 24719
diff changeset
    93
        assert returnType != Type.OBJECT || returnValue == null || !Type.typeFor(returnValue.getClass()).isNumeric();
ccbd9cd3f720 8042118: Separate types from symbols
attila
parents: 24719
diff changeset
    94
        assert returnType != Type.INT;
24719
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    95
        this.returnValue  = returnValue;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    96
        this.programPoint = programPoint;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    97
        this.returnType   = returnType;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    98
    }
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
    99
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   100
    /**
34732
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   101
     * Create an {@code UnwarrantedOptimismException} with the given return value and program point, narrowing
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   102
     * the type to {@code number} if the value is a float or a long that can be represented as double.
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   103
     *
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   104
     * @param returnValue the return value
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   105
     * @param programPoint the program point
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   106
     * @return the exception
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   107
     */
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   108
    public static UnwarrantedOptimismException createNarrowest(final Object returnValue, final int programPoint) {
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   109
        if (returnValue instanceof Float
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   110
                || (returnValue instanceof Long && JSType.isRepresentableAsDouble((Long) returnValue))) {
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   111
            return new UnwarrantedOptimismException(((Number) returnValue).doubleValue(), programPoint, Type.NUMBER);
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   112
        }
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   113
        return new UnwarrantedOptimismException(returnValue, programPoint);
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   114
    }
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   115
6605efbe8447 8144020: Remove long as an internal numeric type
hannesw
parents: 25865
diff changeset
   116
    /**
24719
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   117
     * Get the return value. This is a destructive readout, after the method is invoked the return value is null'd out.
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   118
     * @return return value
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   119
     */
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   120
    public Object getReturnValueDestructive() {
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   121
        final Object retval = returnValue;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   122
        returnValue = null;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   123
        return retval;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   124
    }
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   125
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   126
    Object getReturnValueNonDestructive() {
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   127
        return returnValue;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   128
    }
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   129
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   130
    /**
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   131
     * Get the return type
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   132
     * @return return type
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   133
     */
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   134
    public Type getReturnType() {
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   135
        return returnType;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   136
    }
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   137
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   138
    /**
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   139
     * Does this exception refer to an invalid program point? This might be OK if
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   140
     * we throw it, e.g. from a parameter guard
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   141
     * @return true if invalid program point specified
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   142
     */
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   143
    public boolean hasInvalidProgramPoint() {
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   144
        return programPoint == INVALID_PROGRAM_POINT;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   145
    }
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   146
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   147
    /**
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   148
     * Get the program point
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   149
     * @return the program point
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   150
     */
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   151
    public int getProgramPoint() {
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   152
        return programPoint;
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   153
    }
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   154
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   155
    /**
48247
fa5a47cad0c9 8069338: Implement sharedScopeCall for optimistic types
hannesw
parents: 47216
diff changeset
   156
     * Return a new {@code UnwarrantedOptimismException} with the same return value and the
fa5a47cad0c9 8069338: Implement sharedScopeCall for optimistic types
hannesw
parents: 47216
diff changeset
   157
     * new program point.
fa5a47cad0c9 8069338: Implement sharedScopeCall for optimistic types
hannesw
parents: 47216
diff changeset
   158
     *
fa5a47cad0c9 8069338: Implement sharedScopeCall for optimistic types
hannesw
parents: 47216
diff changeset
   159
     * @param newProgramPoint new new program point
fa5a47cad0c9 8069338: Implement sharedScopeCall for optimistic types
hannesw
parents: 47216
diff changeset
   160
     * @return the new exception instance
24719
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   161
     */
48247
fa5a47cad0c9 8069338: Implement sharedScopeCall for optimistic types
hannesw
parents: 47216
diff changeset
   162
    public UnwarrantedOptimismException replaceProgramPoint(final int newProgramPoint) {
fa5a47cad0c9 8069338: Implement sharedScopeCall for optimistic types
hannesw
parents: 47216
diff changeset
   163
        assert isValid(newProgramPoint);
fa5a47cad0c9 8069338: Implement sharedScopeCall for optimistic types
hannesw
parents: 47216
diff changeset
   164
        return new UnwarrantedOptimismException(returnValue, newProgramPoint, returnType);
24719
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   165
    }
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   166
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   167
    @Override
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   168
    public String getMessage() {
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   169
        return "UNWARRANTED OPTIMISM: [returnValue=" +
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   170
            returnValue +
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   171
            " (class=" +
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   172
            (returnValue == null ? "null" : returnValue.getClass().getSimpleName()) +
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   173
            (hasInvalidProgramPoint() ?
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   174
                " <invalid program point>" :
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   175
                (" @ program point #" + programPoint)) +
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   176
            ")]";
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   177
    }
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   178
24776
966226aeee50 8044518: Ensure exceptions related to optimistic recompilation are not serializable
attila
parents: 24751
diff changeset
   179
966226aeee50 8044518: Ensure exceptions related to optimistic recompilation are not serializable
attila
parents: 24751
diff changeset
   180
    private void writeObject(final ObjectOutputStream out) throws NotSerializableException {
966226aeee50 8044518: Ensure exceptions related to optimistic recompilation are not serializable
attila
parents: 24751
diff changeset
   181
        throw new NotSerializableException(getClass().getName());
966226aeee50 8044518: Ensure exceptions related to optimistic recompilation are not serializable
attila
parents: 24751
diff changeset
   182
    }
966226aeee50 8044518: Ensure exceptions related to optimistic recompilation are not serializable
attila
parents: 24751
diff changeset
   183
966226aeee50 8044518: Ensure exceptions related to optimistic recompilation are not serializable
attila
parents: 24751
diff changeset
   184
    private void readObject(final ObjectInputStream in) throws NotSerializableException {
966226aeee50 8044518: Ensure exceptions related to optimistic recompilation are not serializable
attila
parents: 24751
diff changeset
   185
        throw new NotSerializableException(getClass().getName());
966226aeee50 8044518: Ensure exceptions related to optimistic recompilation are not serializable
attila
parents: 24751
diff changeset
   186
    }
24719
f726e9d67629 8035820: Optimistic recompilation
attila
parents:
diff changeset
   187
}