Skip to content

Commit 5974a92

Browse files
committed
Backport 89dd23f2fab0d98879e68f817923656e113087e3
1 parent a6eaa75 commit 5974a92

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

make/hotspot/lib/JvmFlags.gmk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,12 @@ JVM_CFLAGS_TARGET_DEFINES += \
6767
#
6868

6969
ifeq ($(DEBUG_LEVEL), release)
70+
# release builds disable uses of assert macro from <assert.h>.
71+
JVM_CFLAGS_DEBUGLEVEL := -DNDEBUG
7072
# For hotspot, release builds differ internally between "optimized" and "product"
7173
# in that "optimize" does not define PRODUCT.
7274
ifneq ($(HOTSPOT_DEBUG_LEVEL), optimized)
73-
JVM_CFLAGS_DEBUGLEVEL := -DPRODUCT
75+
JVM_CFLAGS_DEBUGLEVEL += -DPRODUCT
7476
endif
7577
else ifeq ($(DEBUG_LEVEL), fastdebug)
7678
JVM_CFLAGS_DEBUGLEVEL := -DASSERT

test/hotspot/gtest/gc/shared/test_memset_with_concurrent_readers.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2024, 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
@@ -24,10 +24,13 @@
2424
#include "precompiled.hpp"
2525
#include "gc/shared/memset_with_concurrent_readers.hpp"
2626
#include "utilities/globalDefinitions.hpp"
27-
#include "unittest.hpp"
2827

28+
#include "utilities/vmassert_uninstall.hpp"
2929
#include <string.h>
3030
#include <sstream>
31+
#include "utilities/vmassert_reinstall.hpp"
32+
33+
#include "unittest.hpp"
3134

3235
static unsigned line_byte(const char* line, size_t i) {
3336
return unsigned(line[i]) & 0xFF;

test/hotspot/gtest/jfr/test_networkUtilization.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2024, 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
@@ -42,11 +42,13 @@
4242
#include "utilities/globalDefinitions.hpp"
4343
#include "utilities/growableArray.hpp"
4444

45-
#include "unittest.hpp"
46-
45+
#include "utilities/vmassert_uninstall.hpp"
4746
#include <vector>
4847
#include <list>
4948
#include <map>
49+
#include "utilities/vmassert_reinstall.hpp"
50+
51+
#include "unittest.hpp"
5052

5153
namespace {
5254

test/hotspot/gtest/unittest.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2024, 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
@@ -28,7 +28,10 @@
2828
#include <stdio.h>
2929

3030
#define GTEST_DONT_DEFINE_TEST 1
31+
32+
#include "utilities/vmassert_uninstall.hpp"
3133
#include "gtest/gtest.h"
34+
#include "utilities/vmassert_reinstall.hpp"
3235

3336
// gtest/gtest.h includes assert.h which will define the assert macro, but hotspot has its
3437
// own standards incompatible assert macro that takes two parameters.

0 commit comments

Comments
 (0)