diff options
author | kvn <none@none> | 2013-01-03 15:09:55 -0800 |
---|---|---|
committer | kvn <none@none> | 2013-01-03 15:09:55 -0800 |
commit | ab11b13cb1e7c9b1790e8ffb3d12353c4f96929e (patch) | |
tree | b85462f0f8471403efadfa1ace7cfc7dc846aad7 /src/cpu/x86/vm/macroAssembler_x86.cpp | |
parent | a057528705d880d63b89e4bfa51c360b231eb7ef (diff) | |
download | jdk8u_hotspot-ab11b13cb1e7c9b1790e8ffb3d12353c4f96929e.tar.gz |
8005522: use fast-string instructions on x86 for zeroing
Summary: use 'rep stosb' instead of 'rep stosq' when fast-string operations are available.
Reviewed-by: twisti, roland
Diffstat (limited to 'src/cpu/x86/vm/macroAssembler_x86.cpp')
-rw-r--r-- | src/cpu/x86/vm/macroAssembler_x86.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cpu/x86/vm/macroAssembler_x86.cpp b/src/cpu/x86/vm/macroAssembler_x86.cpp index b9d85636c..d2549472c 100644 --- a/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -5224,6 +5224,22 @@ void MacroAssembler::verified_entry(int framesize, bool stack_bang, bool fp_mode } +void MacroAssembler::clear_mem(Register base, Register cnt, Register tmp) { + // cnt - number of qwords (8-byte words). + // base - start address, qword aligned. + assert(base==rdi, "base register must be edi for rep stos"); + assert(tmp==rax, "tmp register must be eax for rep stos"); + assert(cnt==rcx, "cnt register must be ecx for rep stos"); + + xorptr(tmp, tmp); + if (UseFastStosb) { + shlptr(cnt,3); // convert to number of bytes + rep_stosb(); + } else { + NOT_LP64(shlptr(cnt,1);) // convert to number of dwords for 32-bit VM + rep_stos(); + } +} // IndexOf for constant substrings with size >= 8 chars // which don't need to be loaded through stack. |