Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8281450: Remove unnecessary operator new and delete from ObjectMonitor
Backport-of: 83d67452da248db17bc72de80247a670d6813cf5
  • Loading branch information
tstuefe committed Apr 1, 2022
1 parent 1007ded commit 25f2a52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
15 changes: 1 addition & 14 deletions src/hotspot/share/runtime/objectMonitor.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2022, 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 @@ -233,19 +233,6 @@ OopStorage* ObjectMonitor::_oop_storage = NULL;
// * See also http://blogs.sun.com/dave


void* ObjectMonitor::operator new (size_t size) throw() {
return AllocateHeap(size, mtInternal);
}
void* ObjectMonitor::operator new[] (size_t size) throw() {
return operator new (size);
}
void ObjectMonitor::operator delete(void* p) {
FreeHeap(p);
}
void ObjectMonitor::operator delete[] (void *p) {
operator delete(p);
}

// Check that object() and set_object() are called from the right context:
static void check_object_context() {
#ifdef ASSERT
Expand Down
7 changes: 1 addition & 6 deletions src/hotspot/share/runtime/objectMonitor.hpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2022, 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 @@ -203,11 +203,6 @@ class ObjectMonitor : public CHeapObj<mtObjectMonitor> {

static int Knob_SpinLimit;

void* operator new (size_t size) throw();
void* operator new[] (size_t size) throw();
void operator delete(void* p);
void operator delete[] (void* p);

// TODO-FIXME: the "offset" routines should return a type of off_t instead of int ...
// ByteSize would also be an appropriate type.
static int header_offset_in_bytes() { return offset_of(ObjectMonitor, _header); }
Expand Down

1 comment on commit 25f2a52

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.