8264223: CodeHeap::verify fails extra_hops assertion in fastdebug test

Reviewed-by: lucy, shade
This commit is contained in:
Hui Shi 2021-04-01 10:43:45 +00:00 committed by Lutz Schmidt
parent 0696fd0e81
commit 011f6d13ab
2 changed files with 13 additions and 2 deletions
src/hotspot/share/memory
test/hotspot/jtreg/compiler/codegen

@ -835,7 +835,10 @@ void CodeHeap::verify() {
}
}
assert(nseg == _next_segment, "CodeHeap: segment count mismatch. found %d, expected %d.", (int)nseg, (int)_next_segment);
assert((count == 0) || (extra_hops < (16 + 2*count)), "CodeHeap: many extra hops due to optimization. blocks: %d, extra hops: %d.", count, extra_hops);
assert(extra_hops <= _fragmentation_count, "CodeHeap: extra hops wrong. fragmentation: %d, extra hops: %d.", _fragmentation_count, extra_hops);
if (extra_hops >= (16 + 2 * count)) {
warning("CodeHeap: many extra hops due to optimization. blocks: %d, extra hops: %d.", count, extra_hops);
}
// Verify that the number of free blocks is not out of hand.
static int free_block_threshold = 10000;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2021, 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
@ -29,6 +29,14 @@
* @run main/othervm -Xcomp compiler.codegen.Test6935535
*/
/**
* @test
* @bug 8264223
* @summary add CodeHeap verification
*
* @requires vm.debug
* @run main/othervm -Xcomp -XX:+VerifyCodeCache compiler.codegen.Test6935535
*/
package compiler.codegen;
public class Test6935535 {