[aarch64-port-dev ] [12] RFR(S): 8207247 AARCH64: Enable Minimal and Client VM builds
Andrew Dinn
adinn at redhat.com
Wed Aug 29 15:47:52 UTC 2018
On 29/08/18 16:34, Andrew Haley wrote:
> On 08/29/2018 03:19 PM, Aleksei Voitylov wrote:
>> here is an updated webrev:
>> http://cr.openjdk.java.net/~avoitylov/webrev.8207247.02
>>
>> I'm not sure it looks cleaner since in_scratch_emit_size is a C2-only
>> concept, though. This was the reason I changed it.
>
> Yeah, I get that, but I want to keep the code history as clean as
> possible.
One minimal change which would clarify the code would be to rename
in_scratch_emit_size to a name that does not drag in the C2-specific
details:
// We need a trampoline if branches are far.
if (far_branches()) {
+ bool avoid_emit = false;
+#ifdef COMPILER2
// 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 =
+ avoid_emit =
(task != NULL && is_c2_compile(task->comp_level()) &&
Compile::current()->in_scratch_emit_size());
+#endif
if (!avoid_emit) {
address stub = emit_trampoline_stub(offset(), entry.target());
if (stub == NULL) {
return NULL; // CodeCache is full
}
Even better would be to use do_emit and reverse the logic but that
requires a slightly larger (but not much more complex) change:
// We need a trampoline if branches are far.
if (far_branches()) {
+ bool so_emit = true;
+#ifdef COMPILER2
// 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());
+ do_emit =
+ !(task != NULL && is_c2_compile(task->comp_level()) &&
+ Compile::current()->in_scratch_emit_size());
+#endif
if (do_emit) {
address stub = emit_trampoline_stub(offset(), entry.target());
if (stub == NULL) {
return NULL; // CodeCache is full
}
regards,
Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander
More information about the hotspot-dev
mailing list