Mercurial > hg > icedtea8-forest > hotspot
changeset 10027:d78088224b98 icedtea-3.10.0pre00 icedtea-3.9.0
8207345, PR3626: Trampoline generation code reads from uninitialized memory
Reviewed-by: shade
author | aph |
---|---|
date | Tue, 17 Jul 2018 15:03:25 +0100 |
parents | 16ee3c35fef2 |
children | b3d6f0af9a4d |
files | src/cpu/aarch64/vm/macroAssembler_aarch64.cpp |
diffstat | 1 files changed, 13 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp Wed Sep 05 17:17:43 2018 +0100 +++ b/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp Tue Jul 17 15:03:25 2018 +0100 @@ -683,10 +683,19 @@ unsigned int start_offset = offset(); #ifdef COMPILER2 - if (far_branches() && !Compile::current()->in_scratch_emit_size()) { - address stub = emit_trampoline_stub(start_offset, entry.target()); - if (stub == NULL) { - return NULL; // CodeCache is full + // We need a trampoline if branches are far. + if (far_branches()) { + // We don't want to emit a trampoline if C2 is generating dummy + // code during its branch shortening phase. + CompileTask* task = ciEnv::current()->task(); + bool in_scratch_emit_size = + ((task != NULL) && is_c2_compile(task->comp_level()) + && Compile::current()->in_scratch_emit_size()); + if (! in_scratch_emit_size) { + address stub = emit_trampoline_stub(start_offset, entry.target()); + if (stub == NULL) { + return NULL; // CodeCache is full + } } } #endif