Request for review (L): 7003454: order constants in constant table by number of references in code

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue Nov 8 12:33:36 PST 2011


Christian,

assembler.hpp:

I don't think we should have separate methods is_simmX() and min_simmX() for 
cases when it is used only one or 2 times. I would leave only frequently used 
one (min_simm13() is used only 3 times so it could be removed also):

   static int min_simm13() { return min_simm(13); }

   static bool is_simm13(intptr_t x) { return is_simm(x, 13); }
   static bool is_simm16(intptr_t x) { return is_simm(x, 16); }
   static bool is_simm32(intptr_t x) { return is_simm(x, 32); }

compile.hpp:

add parenthesis around (++_nof_jump_tables):

+     float next_jump_table_freq() { return -1.0f * ++_nof_jump_tables; }

compile.cpp:

will you hit next assert if you have several jump-tables?:

+     else assert(!found_void, "wrong sorting");

Vladimir

Christian Thalinger wrote:
> http://cr.openjdk.java.net/~twisti/7003454/
> 
> 7003454: order constants in constant table by number of references in code
> Reviewed-by:
> 
> Order constants in constant table by frequencies of references in code
> and set constant table base that offsets to these frequently used
> constants fit into the displacement range of load instructions.
> 
> src/share/vm/adlc/adlparse.cpp
> src/share/vm/adlc/output_c.cpp
> src/share/vm/asm/assembler.hpp
> src/share/vm/opto/compile.cpp
> src/share/vm/opto/compile.hpp
> src/share/vm/opto/machnode.cpp
> src/share/vm/opto/matcher.hpp
> src/cpu/sparc/vm/sparc.ad
> src/cpu/x86/vm/x86_32.ad
> src/cpu/x86/vm/x86_64.ad
> src/cpu/sparc/vm/assembler_sparc.hpp
> src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
> src/cpu/sparc/vm/methodHandles_sparc.cpp
> src/cpu/sparc/vm/sharedRuntime_sparc.cpp
> src/cpu/sparc/vm/vtableStubs_sparc.cpp
> src/cpu/x86/vm/assembler_x86.hpp
> src/cpu/x86/vm/stubGenerator_x86_64.cpp
> 


More information about the hotspot-compiler-dev mailing list