5414 // The size of the blocks erased by the zero_blocks stub. We must
5415 // handle anything smaller than this ourselves in zero_words().
5416 const int MacroAssembler::zero_words_block_size = 8;
5417
5418 // zero_words() is used by C2 ClearArray patterns. It is as small as
5419 // possible, handling small word counts locally and delegating
5420 // anything larger to the zero_blocks stub. It is expanded many times
5421 // in compiled code, so it is important to keep it short.
5422
5423 // ptr: Address of a buffer to be zeroed.
5424 // cnt: Count in HeapWords.
5425 //
5426 // ptr, cnt, rscratch1, and rscratch2 are clobbered.
5427 void MacroAssembler::zero_words(Register ptr, Register cnt)
5428 {
5429 assert(is_power_of_2(zero_words_block_size), "adjust this");
5430 assert(ptr == r10 && cnt == r11, "mismatch in register usage");
5431
5432 BLOCK_COMMENT("zero_words {");
5433 cmp(cnt, (u1)zero_words_block_size);
5434 Label around, done, done16;
5435 br(LO, around);
5436 {
5437 RuntimeAddress zero_blocks = RuntimeAddress(StubRoutines::aarch64::zero_blocks());
5438 assert(zero_blocks.target() != NULL, "zero_blocks stub has not been generated");
5439 if (StubRoutines::aarch64::complete()) {
5440 trampoline_call(zero_blocks);
5441 } else {
5442 bl(zero_blocks);
5443 }
5444 }
5445 bind(around);
5446 for (int i = zero_words_block_size >> 1; i > 1; i >>= 1) {
5447 Label l;
5448 tbz(cnt, exact_log2(i), l);
5449 for (int j = 0; j < i; j += 2) {
5450 stp(zr, zr, post(ptr, 16));
5451 }
5452 bind(l);
5453 }
5454 {
|
5414 // The size of the blocks erased by the zero_blocks stub. We must
5415 // handle anything smaller than this ourselves in zero_words().
5416 const int MacroAssembler::zero_words_block_size = 8;
5417
5418 // zero_words() is used by C2 ClearArray patterns. It is as small as
5419 // possible, handling small word counts locally and delegating
5420 // anything larger to the zero_blocks stub. It is expanded many times
5421 // in compiled code, so it is important to keep it short.
5422
5423 // ptr: Address of a buffer to be zeroed.
5424 // cnt: Count in HeapWords.
5425 //
5426 // ptr, cnt, rscratch1, and rscratch2 are clobbered.
5427 void MacroAssembler::zero_words(Register ptr, Register cnt)
5428 {
5429 assert(is_power_of_2(zero_words_block_size), "adjust this");
5430 assert(ptr == r10 && cnt == r11, "mismatch in register usage");
5431
5432 BLOCK_COMMENT("zero_words {");
5433 cmp(cnt, (u1)zero_words_block_size);
5434 Label around;
5435 br(LO, around);
5436 {
5437 RuntimeAddress zero_blocks = RuntimeAddress(StubRoutines::aarch64::zero_blocks());
5438 assert(zero_blocks.target() != NULL, "zero_blocks stub has not been generated");
5439 if (StubRoutines::aarch64::complete()) {
5440 trampoline_call(zero_blocks);
5441 } else {
5442 bl(zero_blocks);
5443 }
5444 }
5445 bind(around);
5446 for (int i = zero_words_block_size >> 1; i > 1; i >>= 1) {
5447 Label l;
5448 tbz(cnt, exact_log2(i), l);
5449 for (int j = 0; j < i; j += 2) {
5450 stp(zr, zr, post(ptr, 16));
5451 }
5452 bind(l);
5453 }
5454 {
|