Mercurial > hg > graal-compiler
comparison src/cpu/sparc/vm/copy_sparc.hpp @ 3892:baf763f388e6
7059037: Use BIS for zeroing on T4
Summary: Use BIS for zeroing new allocated big (2Kb and more) objects and arrays.
Reviewed-by: never, twisti, ysr
author | kvn |
---|---|
date | Fri, 26 Aug 2011 08:52:22 -0700 |
parents | f95d63e2154a |
children | 16f9fa2bf76c |
comparison
equal
deleted
inserted
replaced
3891:ac8738449b6f | 3892:baf763f388e6 |
---|---|
154 *to++ = value; | 154 *to++ = value; |
155 } | 155 } |
156 #endif // _LP64 | 156 #endif // _LP64 |
157 } | 157 } |
158 | 158 |
159 typedef void (*_zero_Fn)(HeapWord* to, size_t count); | |
160 | |
159 static void pd_fill_to_aligned_words(HeapWord* tohw, size_t count, juint value) { | 161 static void pd_fill_to_aligned_words(HeapWord* tohw, size_t count, juint value) { |
160 assert(MinObjAlignmentInBytes >= BytesPerLong, "need alternate implementation"); | 162 assert(MinObjAlignmentInBytes >= BytesPerLong, "need alternate implementation"); |
161 | 163 |
164 if (value == 0 && UseBlockZeroing && | |
165 (count > (BlockZeroingLowLimit >> LogHeapWordSize))) { | |
166 // Call it only when block zeroing is used | |
167 ((_zero_Fn)StubRoutines::zero_aligned_words())(tohw, count); | |
168 } else { | |
162 julong* to = (julong*)tohw; | 169 julong* to = (julong*)tohw; |
163 julong v = ((julong)value << 32) | value; | 170 julong v = ((julong)value << 32) | value; |
164 // If count is odd, odd will be equal to 1 on 32-bit platform | 171 // If count is odd, odd will be equal to 1 on 32-bit platform |
165 // and be equal to 0 on 64-bit platform. | 172 // and be equal to 0 on 64-bit platform. |
166 size_t odd = count % (BytesPerLong / HeapWordSize) ; | 173 size_t odd = count % (BytesPerLong / HeapWordSize) ; |
174 assert(count == odd, "bad bounds on loop filling to aligned words"); | 181 assert(count == odd, "bad bounds on loop filling to aligned words"); |
175 if (odd) { | 182 if (odd) { |
176 *((juint*)to) = value; | 183 *((juint*)to) = value; |
177 | 184 |
178 } | 185 } |
186 } | |
179 } | 187 } |
180 | 188 |
181 static void pd_fill_to_bytes(void* to, size_t count, jubyte value) { | 189 static void pd_fill_to_bytes(void* to, size_t count, jubyte value) { |
182 (void)memset(to, value, count); | 190 (void)memset(to, value, count); |
183 } | 191 } |