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

4809552: Optimize Arrays.fill(...) Reviewed-by: kvn
author never
date Fri, 27 Aug 2010 17:33:49 -0700
parents 02e771df338e
children f95d63e2154a
comparison
equal deleted inserted replaced
1731:ee5cc9e78493 1763:d6f45b55c972
1623 __ jmp(L_copy_4_bytes); 1623 __ jmp(L_copy_4_bytes);
1624 1624
1625 return start; 1625 return start;
1626 } 1626 }
1627 1627
1628 address generate_fill(BasicType t, bool aligned, const char *name) {
1629 __ align(CodeEntryAlignment);
1630 StubCodeMark mark(this, "StubRoutines", name);
1631 address start = __ pc();
1632
1633 BLOCK_COMMENT("Entry:");
1634
1635 const Register to = c_rarg0; // source array address
1636 const Register value = c_rarg1; // value
1637 const Register count = c_rarg2; // elements count
1638
1639 __ enter(); // required for proper stackwalking of RuntimeStub frame
1640
1641 __ generate_fill(t, aligned, to, value, count, rax, xmm0);
1642
1643 __ leave(); // required for proper stackwalking of RuntimeStub frame
1644 __ ret(0);
1645 return start;
1646 }
1647
1628 // Arguments: 1648 // Arguments:
1629 // aligned - true => Input and output aligned on a HeapWord == 8-byte boundary 1649 // aligned - true => Input and output aligned on a HeapWord == 8-byte boundary
1630 // ignored 1650 // ignored
1631 // name - stub name string 1651 // name - stub name string
1632 // 1652 //
2709 } 2729 }
2710 2730
2711 StubRoutines::_checkcast_arraycopy = generate_checkcast_copy("checkcast_arraycopy"); 2731 StubRoutines::_checkcast_arraycopy = generate_checkcast_copy("checkcast_arraycopy");
2712 StubRoutines::_unsafe_arraycopy = generate_unsafe_copy("unsafe_arraycopy"); 2732 StubRoutines::_unsafe_arraycopy = generate_unsafe_copy("unsafe_arraycopy");
2713 StubRoutines::_generic_arraycopy = generate_generic_copy("generic_arraycopy"); 2733 StubRoutines::_generic_arraycopy = generate_generic_copy("generic_arraycopy");
2734
2735 StubRoutines::_jbyte_fill = generate_fill(T_BYTE, false, "jbyte_fill");
2736 StubRoutines::_jshort_fill = generate_fill(T_SHORT, false, "jshort_fill");
2737 StubRoutines::_jint_fill = generate_fill(T_INT, false, "jint_fill");
2738 StubRoutines::_arrayof_jbyte_fill = generate_fill(T_BYTE, true, "arrayof_jbyte_fill");
2739 StubRoutines::_arrayof_jshort_fill = generate_fill(T_SHORT, true, "arrayof_jshort_fill");
2740 StubRoutines::_arrayof_jint_fill = generate_fill(T_INT, true, "arrayof_jint_fill");
2714 2741
2715 // We don't generate specialized code for HeapWord-aligned source 2742 // We don't generate specialized code for HeapWord-aligned source
2716 // arrays, so just use the code we've already generated 2743 // arrays, so just use the code we've already generated
2717 StubRoutines::_arrayof_jbyte_disjoint_arraycopy = StubRoutines::_jbyte_disjoint_arraycopy; 2744 StubRoutines::_arrayof_jbyte_disjoint_arraycopy = StubRoutines::_jbyte_disjoint_arraycopy;
2718 StubRoutines::_arrayof_jbyte_arraycopy = StubRoutines::_jbyte_arraycopy; 2745 StubRoutines::_arrayof_jbyte_arraycopy = StubRoutines::_jbyte_arraycopy;