11/*
2- * Copyright (c) 2012, 2024 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2012, 2025 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -48,9 +48,19 @@ class MetadataHandles;
4848class JVMCINMethodData : public ResourceObj {
4949 friend class JVMCIVMStructs ;
5050
51- // Is HotSpotNmethod.name non-null? If so, the value is
52- // embedded in the end of this object.
53- bool _has_name;
51+ union JVMCINMethodProperties {
52+ uint8_t value;
53+ struct {
54+ // Is HotSpotNmethod.name non-null? If so, the value is
55+ // embedded in the end of this object.
56+ uint8_t _has_name : 1 ,
57+ // HotSpotNmethod.isDefault (e.g., compilation scheduled by CompileBroker)
58+ _is_default : 1 ,
59+ : 6 ;
60+ } bits;
61+ };
62+
63+ JVMCINMethodProperties _properties;
5464
5565 // Index for the HotSpotNmethod mirror in the nmethod's oops table.
5666 // This is -1 if there is no mirror in the oops table.
@@ -76,6 +86,7 @@ class JVMCINMethodData : public ResourceObj {
7686 void initialize (int nmethod_mirror_index,
7787 int nmethod_entry_patch_offset,
7888 const char * nmethod_mirror_name,
89+ bool is_default,
7990 FailedSpeculation** failed_speculations);
8091
8192 void * operator new (size_t size, const char * nmethod_mirror_name) {
@@ -88,11 +99,13 @@ class JVMCINMethodData : public ResourceObj {
8899 static JVMCINMethodData* create (int nmethod_mirror_index,
89100 int nmethod_entry_patch_offset,
90101 const char * nmethod_mirror_name,
102+ bool is_default,
91103 FailedSpeculation** failed_speculations) {
92104 JVMCINMethodData* result = new (nmethod_mirror_name) JVMCINMethodData ();
93105 result->initialize (nmethod_mirror_index,
94106 nmethod_entry_patch_offset,
95107 nmethod_mirror_name,
108+ is_default,
96109 failed_speculations);
97110 return result;
98111 }
@@ -117,7 +130,7 @@ class JVMCINMethodData : public ResourceObj {
117130 void add_failed_speculation (nmethod* nm, jlong speculation);
118131
119132 // Gets the JVMCI name of the nmethod (which may be null).
120- const char * name () { return _has_name ? (char *)(((address) this ) + sizeof (JVMCINMethodData)) : nullptr ; }
133+ const char * name () { return has_name () ? (char *)(((address) this ) + sizeof (JVMCINMethodData)) : nullptr ; }
121134
122135 // Clears the HotSpotNmethod.address field in the mirror. If nm
123136 // is dead, the HotSpotNmethod.entryPoint field is also cleared.
@@ -132,6 +145,14 @@ class JVMCINMethodData : public ResourceObj {
132145 int nmethod_entry_patch_offset () {
133146 return _nmethod_entry_patch_offset;
134147 }
148+
149+ bool has_name () {
150+ return _properties.bits ._has_name ;
151+ }
152+
153+ bool is_default () {
154+ return _properties.bits ._is_default ;
155+ }
135156};
136157
137158// A top level class that represents an initialized JVMCI runtime.
0 commit comments