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

Tom Rodriguez Thomas.Rodriguez at Sun.COM
Wed Nov 11 14:03:21 PST 2009


On Nov 11, 2009, at 1:59 PM, Vladimir Kozlov wrote:

> Tom Rodriguez wrote:
>>> You use fetch_static_field() only to read Integer.sizeTable. Does it need
>>> to be so generalized? But you can keep it as it is.
>> Originally I was going to read some other fields so I needed something general.  It's based on do_get_xxx and I don't see any reason to simplify it.  I could move it over into GraphKit.
> 
> OK.
> 
>>> In int_stringSize(), I think, TypeAryPtr::INTS memory should be used instead of
>>> TypeAryPtr::CHARS (for final_mem) and int_adr_idx (needs to add it) instead
>>> of char_adr_idx.
>> Actually there are no stores so it's not needed at all.  I'd added some debugging code that did a runtime call and needed the phi but I think I can remove it completely now.
> 
> OK.
> 
>>> Why 6 is limit for constant strings? Add some comments.
>> Ok. It's just a number.  6 seems like an ok code space vs. speed tradeoff.
> 
> May be we should have it as flag or definition to be more visible?

A flag seems excessive.  It's not like this is a critical tunable.  I can move it into an enum in PhaseStringOpts if you like.

  enum {
    // max length of constant string copy unrolling in copy_string                                                          
    unroll_string_copy_length = 6
  };

tom

> 
> Thanks,
> Vladimir
> 
>> tom
>>> 
>>> Vladimir
>>> 
>>> Tom Rodriguez wrote:
>>>> http://cr.openjdk.java.net/~never/6892658/



More information about the hotspot-compiler-dev mailing list