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
Reviewed-by: dholmes
  • Loading branch information
tstuefe committed Feb 8, 2022
1 parent f5d8ceb commit 83d6745
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<mtInternal> {

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

3 comments on commit 83d6745

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@tstuefe
Copy link
Member Author

@tstuefe tstuefe commented on 83d6745 Apr 1, 2022

Choose a reason for hiding this comment

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

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 83d6745 Apr 1, 2022

Choose a reason for hiding this comment

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

@tstuefe the backport was successfully created on the branch tstuefe-backport-83d67452 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 83d67452 from the openjdk/jdk repository.

The commit being backported was authored by Thomas Stuefe on 8 Feb 2022 and was reviewed by David Holmes.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev tstuefe-backport-83d67452:tstuefe-backport-83d67452
$ git checkout tstuefe-backport-83d67452
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev tstuefe-backport-83d67452

Please sign in to comment.