src/hotspot/share/interpreter/bytecodeUtils.hpp
author goetz
Mon, 14 Oct 2019 11:36:17 +0200
changeset 58664 e3618c902d17
permissions -rw-r--r--
8218628: Add detailed message to NullPointerException describing what is null. Summary: This is the implementation of JEP 358: Helpful NullPointerExceptions. Reviewed-by: coleenp, clanger, rschmelter, rriggs, forax, mr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
58664
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
     1
/*
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
     2
 * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
     3
 * Copyright (c) 2019 SAP SE. All rights reserved.
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
     5
 *
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
     8
 * published by the Free Software Foundation.
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
     9
 *
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    14
 * accompanied this code).
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    15
 *
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    19
 *
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    22
 * questions.
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    23
 *
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    24
 */
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    25
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    26
#ifndef SHARE_INTERPRETER_BYTECODEUTILS_HPP
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    27
#define SHARE_INTERPRETER_BYTECODEUTILS_HPP
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    28
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    29
#include "memory/allocation.hpp"
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    30
#include "utilities/globalDefinitions.hpp"
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    31
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    32
class Method;
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    33
class outputStream;
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    34
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    35
class BytecodeUtils : public AllStatic {
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    36
 public:
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    37
  // NPE extended message. Return true if string is printed.
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    38
  static bool get_NPE_message_at(outputStream* ss, Method* method, int bci);
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    39
};
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    40
e3618c902d17 8218628: Add detailed message to NullPointerException describing what is null.
goetz
parents:
diff changeset
    41
#endif // SHARE_INTERPRETER_BYTECODEUTILS_HPP