src/hotspot/share/code/vtableStubs.cpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2017, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 1997, 2018, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 58,68 ****
if (_chunk == NULL || _chunk + real_size > _chunk_end) {
const int bytes = chunk_factor * real_size + pd_code_alignment();
// There is a dependency on the name of the blob in src/share/vm/prims/jvmtiCodeBlobEvents.cpp
// If changing the name, update the other file accordingly.
! BufferBlob* blob = BufferBlob::create("vtable chunks", bytes);
if (blob == NULL) {
return NULL;
}
_chunk = blob->content_begin();
_chunk_end = _chunk + bytes;
--- 58,68 ----
if (_chunk == NULL || _chunk + real_size > _chunk_end) {
const int bytes = chunk_factor * real_size + pd_code_alignment();
// There is a dependency on the name of the blob in src/share/vm/prims/jvmtiCodeBlobEvents.cpp
// If changing the name, update the other file accordingly.
! VtableBlob* blob = VtableBlob::create("vtable chunks", bytes);
if (blob == NULL) {
return NULL;
}
_chunk = blob->content_begin();
_chunk_end = _chunk + bytes;
*** 175,184 ****
--- 175,195 ----
VtableStub* s;
for (s = _table[hash]; s != NULL && s != stub; s = s->next()) {}
return s == stub;
}
+ VtableStub* VtableStubs::entry_point(address pc) {
+ MutexLocker ml(VtableStubs_lock);
+ VtableStub* stub = (VtableStub*)(pc - VtableStub::entry_offset());
+ uint hash = VtableStubs::hash(stub->is_vtable_stub(), stub->index());
+ VtableStub* s;
+ for (s = _table[hash]; s != NULL && s != stub; s = s->next()) {}
+ if (s == stub) {
+ return s;
+ }
+ return NULL;
+ }
bool VtableStubs::contains(address pc) {
// simple solution for now - we may want to use
// a faster way if this function is called often
return stub_containing(pc) != NULL;