comparison src/cpu/x86/vm/stubGenerator_x86_32.cpp @ 1763:d6f45b55c972

4809552: Optimize Arrays.fill(...) Reviewed-by: kvn
author never
date Fri, 27 Aug 2010 17:33:49 -0700
parents c18cbe5936b8
children f95d63e2154a
comparison
equal deleted inserted replaced
1731:ee5cc9e78493 1763:d6f45b55c972
1037 __ ret(0); 1037 __ ret(0);
1038 return start; 1038 return start;
1039 } 1039 }
1040 1040
1041 1041
1042 address generate_fill(BasicType t, bool aligned, const char *name) {
1043 __ align(CodeEntryAlignment);
1044 StubCodeMark mark(this, "StubRoutines", name);
1045 address start = __ pc();
1046
1047 BLOCK_COMMENT("Entry:");
1048
1049 const Register to = rdi; // source array address
1050 const Register value = rdx; // value
1051 const Register count = rsi; // elements count
1052
1053 __ enter(); // required for proper stackwalking of RuntimeStub frame
1054 __ push(rsi);
1055 __ push(rdi);
1056 __ movptr(to , Address(rsp, 12+ 4));
1057 __ movl(value, Address(rsp, 12+ 8));
1058 __ movl(count, Address(rsp, 12+ 12));
1059
1060 __ generate_fill(t, aligned, to, value, count, rax, xmm0);
1061
1062 __ pop(rdi);
1063 __ pop(rsi);
1064 __ leave(); // required for proper stackwalking of RuntimeStub frame
1065 __ ret(0);
1066 return start;
1067 }
1068
1042 address generate_conjoint_copy(BasicType t, bool aligned, 1069 address generate_conjoint_copy(BasicType t, bool aligned,
1043 Address::ScaleFactor sf, 1070 Address::ScaleFactor sf,
1044 address nooverlap_target, 1071 address nooverlap_target,
1045 address* entry, const char *name) { 1072 address* entry, const char *name) {
1046 __ align(CodeEntryAlignment); 1073 __ align(CodeEntryAlignment);
1999 generate_disjoint_long_copy(&entry, "jlong_disjoint_arraycopy"); 2026 generate_disjoint_long_copy(&entry, "jlong_disjoint_arraycopy");
2000 StubRoutines::_jlong_arraycopy = 2027 StubRoutines::_jlong_arraycopy =
2001 generate_conjoint_long_copy(entry, &entry_jlong_arraycopy, 2028 generate_conjoint_long_copy(entry, &entry_jlong_arraycopy,
2002 "jlong_arraycopy"); 2029 "jlong_arraycopy");
2003 2030
2031 StubRoutines::_jbyte_fill = generate_fill(T_BYTE, false, "jbyte_fill");
2032 StubRoutines::_jshort_fill = generate_fill(T_SHORT, false, "jshort_fill");
2033 StubRoutines::_jint_fill = generate_fill(T_INT, false, "jint_fill");
2034 StubRoutines::_arrayof_jbyte_fill = generate_fill(T_BYTE, true, "arrayof_jbyte_fill");
2035 StubRoutines::_arrayof_jshort_fill = generate_fill(T_SHORT, true, "arrayof_jshort_fill");
2036 StubRoutines::_arrayof_jint_fill = generate_fill(T_INT, true, "arrayof_jint_fill");
2037
2004 StubRoutines::_arrayof_jint_disjoint_arraycopy = 2038 StubRoutines::_arrayof_jint_disjoint_arraycopy =
2005 StubRoutines::_jint_disjoint_arraycopy; 2039 StubRoutines::_jint_disjoint_arraycopy;
2006 StubRoutines::_arrayof_oop_disjoint_arraycopy = 2040 StubRoutines::_arrayof_oop_disjoint_arraycopy =
2007 StubRoutines::_oop_disjoint_arraycopy; 2041 StubRoutines::_oop_disjoint_arraycopy;
2008 StubRoutines::_arrayof_jlong_disjoint_arraycopy = 2042 StubRoutines::_arrayof_jlong_disjoint_arraycopy =