mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 22:04:51 +02:00
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
Reviewed-by: kvn, jrose, twisti
This commit is contained in:
parent
0bc2963b7d
commit
051c64ad4d
9 changed files with 74 additions and 32 deletions
|
@ -362,10 +362,8 @@ class CodeBuffer: public StackObj {
|
|||
// helper for CodeBuffer::expand()
|
||||
void take_over_code_from(CodeBuffer* cs);
|
||||
|
||||
#ifdef ASSERT
|
||||
// ensure sections are disjoint, ordered, and contained in the blob
|
||||
bool verify_section_allocation();
|
||||
#endif
|
||||
void verify_section_allocation();
|
||||
|
||||
// copies combined relocations to the blob, returns bytes copied
|
||||
// (if target is null, it is a dry run only, just for sizing)
|
||||
|
@ -393,7 +391,7 @@ class CodeBuffer: public StackObj {
|
|||
assert(code_start != NULL, "sanity");
|
||||
initialize_misc("static buffer");
|
||||
initialize(code_start, code_size);
|
||||
assert(verify_section_allocation(), "initial use of buffer OK");
|
||||
verify_section_allocation();
|
||||
}
|
||||
|
||||
// (2) CodeBuffer referring to pre-allocated CodeBlob.
|
||||
|
@ -545,6 +543,9 @@ class CodeBuffer: public StackObj {
|
|||
|
||||
void block_comment(intptr_t offset, const char * comment) PRODUCT_RETURN;
|
||||
|
||||
// Log a little info about section usage in the CodeBuffer
|
||||
void log_section_sizes(const char* name);
|
||||
|
||||
#ifndef PRODUCT
|
||||
public:
|
||||
// Printing / Decoding
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue