Skip to content

Commit

Permalink
Merge branch 'upstream-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Datadog Syncup Service committed Sep 26, 2024
2 parents 65f2349 + 95d3e9d commit 8f39f42
Show file tree
Hide file tree
Showing 85 changed files with 3,018 additions and 2,536 deletions.
3 changes: 3 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# JDK Vulnerabilities

Please follow the process outlined in the [OpenJDK Vulnerability Policy](https://openjdk.org/groups/vulnerability/report) to disclose vulnerabilities in the JDK.
7 changes: 0 additions & 7 deletions src/hotspot/share/classfile/systemDictionary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,6 @@ class SystemDictionary : AllStatic {
const char* message);
static const char* find_nest_host_error(const constantPoolHandle& pool, int which);

protected:
static InstanceKlass* _well_known_klasses[];

private:
// table of box klasses (int_klass, etc.)
static InstanceKlass* _box_klasses[T_VOID+1];

static OopHandle _java_system_loader;
static OopHandle _java_platform_loader;

Expand Down
10 changes: 0 additions & 10 deletions src/hotspot/share/classfile/vmClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ InstanceKlass* vmClasses::_klasses[static_cast<int>(vmClassID::LIMIT)]
= { nullptr /*, nullptr...*/ };
InstanceKlass* vmClasses::_box_klasses[T_VOID+1] = { nullptr /*, nullptr...*/ };


// CDS: scan and relocate all classes referenced by _klasses[].
void vmClasses::metaspace_pointers_do(MetaspaceClosure* it) {
for (auto id : EnumRange<vmClassID>{}) {
it->push(klass_addr_at(id));
}
}

bool vmClasses::is_loaded(InstanceKlass* klass) {
return klass != nullptr && klass->is_loaded();
}
Expand Down Expand Up @@ -205,8 +197,6 @@ void vmClasses::resolve_all(TRAPS) {
_box_klasses[T_SHORT] = vmClasses::Short_klass();
_box_klasses[T_INT] = vmClasses::Integer_klass();
_box_klasses[T_LONG] = vmClasses::Long_klass();
//_box_klasses[T_OBJECT] = vmClasses::object_klass();
//_box_klasses[T_ARRAY] = vmClasses::object_klass();

#ifdef ASSERT
if (CDSConfig::is_using_archive()) {
Expand Down
4 changes: 1 addition & 3 deletions src/hotspot/share/classfile/vmClasses.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, 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
Expand Down Expand Up @@ -32,7 +32,6 @@

class ClassLoaderData;
class InstanceKlass;
class MetaspaceClosure;

class vmClasses : AllStatic {
friend class VMStructs;
Expand Down Expand Up @@ -95,7 +94,6 @@ class vmClasses : AllStatic {
return &_klasses[as_int(id)];
}

static void metaspace_pointers_do(MetaspaceClosure* it);
static void resolve_all(TRAPS);

static BasicType box_klass_type(Klass* k); // inverse of box_klass
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/logging/logSelection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@

const LogSelection LogSelection::Invalid;

LogSelection::LogSelection() : _ntags(0), _wildcard(false), _level(LogLevel::Invalid), _tag_sets_selected(0) {
LogSelection::LogSelection() : _ntags(0), _tags(), _wildcard(false), _level(LogLevel::Invalid), _tag_sets_selected(0) {
}

LogSelection::LogSelection(const LogTagType tags[LogTag::MaxTags], bool wildcard, LogLevelType level)
: _ntags(0), _wildcard(wildcard), _level(level), _tag_sets_selected(0) {
: _ntags(0), _tags(), _wildcard(wildcard), _level(level), _tag_sets_selected(0) {
while (_ntags < LogTag::MaxTags && tags[_ntags] != LogTag::__NO_TAG) {
_tags[_ntags] = tags[_ntags];
_ntags++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public sealed interface AnnotationValue {

/**
* Models an annotation value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_ANNOTATION}.
* The {@linkplain #tag tag} of this value is {@value TAG_ANNOTATION}.
*
* @since 22
*/
Expand All @@ -73,7 +73,7 @@ sealed interface OfAnnotation extends AnnotationValue

/**
* Models an array value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_ARRAY}.
* The {@linkplain #tag tag} of this value is {@value TAG_ARRAY}.
*
* @since 22
*/
Expand Down Expand Up @@ -131,7 +131,7 @@ sealed interface OfConstant extends AnnotationValue {

/**
* Models a string value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_STRING}.
* The {@linkplain #tag tag} of this value is {@value TAG_STRING}.
*
* @since 22
*/
Expand Down Expand Up @@ -159,7 +159,7 @@ default String resolvedValue() {

/**
* Models a double value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_DOUBLE}.
* The {@linkplain #tag tag} of this value is {@value TAG_DOUBLE}.
*
* @since 22
*/
Expand Down Expand Up @@ -187,7 +187,7 @@ default Double resolvedValue() {

/**
* Models a float value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_FLOAT}.
* The {@linkplain #tag tag} of this value is {@value TAG_FLOAT}.
*
* @since 22
*/
Expand Down Expand Up @@ -215,7 +215,7 @@ default Float resolvedValue() {

/**
* Models a long value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_LONG}.
* The {@linkplain #tag tag} of this value is {@value TAG_LONG}.
*
* @since 22
*/
Expand Down Expand Up @@ -243,7 +243,7 @@ default Long resolvedValue() {

/**
* Models an int value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_INT}.
* The {@linkplain #tag tag} of this value is {@value TAG_INT}.
*
* @since 22
*/
Expand Down Expand Up @@ -271,7 +271,7 @@ default Integer resolvedValue() {

/**
* Models a short value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_SHORT}.
* The {@linkplain #tag tag} of this value is {@value TAG_SHORT}.
*
* @since 22
*/
Expand Down Expand Up @@ -302,7 +302,7 @@ default Short resolvedValue() {

/**
* Models a char value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_CHAR}.
* The {@linkplain #tag tag} of this value is {@value TAG_CHAR}.
*
* @since 22
*/
Expand Down Expand Up @@ -333,7 +333,7 @@ default Character resolvedValue() {

/**
* Models a byte value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_BYTE}.
* The {@linkplain #tag tag} of this value is {@value TAG_BYTE}.
*
* @since 22
*/
Expand Down Expand Up @@ -364,7 +364,7 @@ default Byte resolvedValue() {

/**
* Models a boolean value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_BOOLEAN}.
* The {@linkplain #tag tag} of this value is {@value TAG_BOOLEAN}.
*
* @since 22
*/
Expand Down Expand Up @@ -395,7 +395,7 @@ default Boolean resolvedValue() {

/**
* Models a class value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_CLASS}.
* The {@linkplain #tag tag} of this value is {@value TAG_CLASS}.
*
* @since 22
*/
Expand All @@ -413,7 +413,7 @@ default ClassDesc classSymbol() {

/**
* Models an enum value of an element-value pair.
* The {@linkplain #tag tag} of this value is {@value ClassFile#AEV_ENUM}.
* The {@linkplain #tag tag} of this value is {@value TAG_ENUM}.
*
* @since 22
*/
Expand All @@ -432,9 +432,52 @@ default ClassDesc classSymbol() {
Utf8Entry constantName();
}

/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfByte}. */
int TAG_BYTE = 'B';

/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfChar}. */
int TAG_CHAR = 'C';

/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfDouble}. */
int TAG_DOUBLE = 'D';

/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfFloat}. */
int TAG_FLOAT = 'F';

/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfInt}. */
int TAG_INT = 'I';

/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfLong}. */
int TAG_LONG = 'J';

/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfShort}. */
int TAG_SHORT = 'S';

/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfBoolean}. */
int TAG_BOOLEAN = 'Z';

/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfString}. */
int TAG_STRING = 's';

/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfEnum}. */
int TAG_ENUM = 'e';

/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfClass}. */
int TAG_CLASS = 'c';

/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfAnnotation}. */
int TAG_ANNOTATION = '@';

/** The {@link #tag() tag} indicating the value of an element-value pair is {@link OfArray}. */
int TAG_ARRAY = '[';

/**
* {@return the tag character for this value as per JVMS {@jvms 4.7.16.1}}
* The tag characters have a one-to-one mapping to the types of annotation element values.
*
* @apiNote
* {@code TAG_}-prefixed constants in this class, such as {@link #TAG_INT},
* describe the possible return values of this method.
*/
char tag();

Expand Down
Loading

0 comments on commit 8f39f42

Please sign in to comment.