review (M) for 6892658: C2 should optimize some stringbuilder patterns

Vladimir Kozlov Vladimir.Kozlov at Sun.COM
Tue Nov 10 14:11:21 PST 2009


Tom,

here is review of all files but 2 new, I am looking on them next

the_MIN_VALUE_string may be should be the_MIN_INT_VALUE_string

universe.hpp
static oop _the_MIN_VALUE_string;  // A cache of "" as a Java string
                                                   ^ "-2147483648"

c2_globals.hpp
I thought we will use experimental for OptimizeStringConcat.

callGenerator.cpp
missing _call_node(NULL) in DirectCallGenerator() constructor.

   bool _separate_io_proj; <- add field's descriptor by copying the comment
                              from LateInlineCallGenerator::generate()

do_late_inline()
add checks to not inline when
call_node()->in(0) == NULL || call_node()->in(0)->is_top()

+   for (uint i1 = 0; i1 < call->req(); i1++) {
                            ^ size

callnode.cpp
You copied code from PhaseMacroExpand::extract_call_projections().
Can you use your new method in macro.cpp also? At least for HS17 changes
when you will have more time.

compile.cpp
In gvn_replace_by() why there is no initial_gvn()->hash_insert(use)?

Instead of OptimizeStringConcat && has_stringbuilder() and OptimizeStringConcat
checks may be we can use only has_stringbuilder() (or different name for query method)
and check OptimizeStringConcat in parseHelper.cpp where has_stringbuilder is set?

doCall.cpp
I saw cases when append methods were not inlined because they were
already compiled into "big" compiled method. You call for_late_inline()
after ok_to_inline(), so may be we should relax that condition for
OptimizeStringConcat case.

Should you check that safepoint has > jvms->argoff() inputs?:
Node* receiver = jvms->map()->in(jvms->argoff() + 1);

macro.cpp
Can you print array only when it is array?:
+     log->head("eliminate_allocation %s type='%d'",
+               alloc->is_AllocateArray() ? "array" : "", log->identify(tklass->klass()));

the same with "lock":"unlock"

Vladimir

Tom Rodriguez wrote:
> http://cr.openjdk.java.net/~never/6892658/


More information about the hotspot-compiler-dev mailing list