1448 emit_byte(0x0F);
1449 emit_byte(0x80 | cc);
1450 emit_long(offs - long_size);
1451 }
1452 } else {
1453 // Note: could eliminate cond. jumps to this jump if condition
1454 // is the same however, seems to be rather unlikely case.
1455 // Note: use jccb() if label to be bound is very close to get
1456 // an 8-bit displacement
1457 L.add_patch_at(code(), locator());
1458 emit_byte(0x0F);
1459 emit_byte(0x80 | cc);
1460 emit_long(0);
1461 }
1462 }
1463
1464 void Assembler::jccb(Condition cc, Label& L) {
1465 if (L.is_bound()) {
1466 const int short_size = 2;
1467 address entry = target(L);
1468 assert(is8bit((intptr_t)entry - ((intptr_t)_code_pos + short_size)),
1469 "Dispacement too large for a short jmp");
1470 intptr_t offs = (intptr_t)entry - (intptr_t)_code_pos;
1471 // 0111 tttn #8-bit disp
1472 emit_byte(0x70 | cc);
1473 emit_byte((offs - short_size) & 0xFF);
1474 } else {
1475 InstructionMark im(this);
1476 L.add_patch_at(code(), locator());
1477 emit_byte(0x70 | cc);
1478 emit_byte(0);
1479 }
1480 }
1481
1482 void Assembler::jmp(Address adr) {
1483 InstructionMark im(this);
1484 prefix(adr);
1485 emit_byte(0xFF);
1486 emit_operand(rsp, adr);
1487 }
1488
1489 void Assembler::jmp(Label& L, bool maybe_short) {
1515
1516 void Assembler::jmp(Register entry) {
1517 int encode = prefix_and_encode(entry->encoding());
1518 emit_byte(0xFF);
1519 emit_byte(0xE0 | encode);
1520 }
1521
1522 void Assembler::jmp_literal(address dest, RelocationHolder const& rspec) {
1523 InstructionMark im(this);
1524 emit_byte(0xE9);
1525 assert(dest != NULL, "must have a target");
1526 intptr_t disp = dest - (_code_pos + sizeof(int32_t));
1527 assert(is_simm32(disp), "must be 32bit offset (jmp)");
1528 emit_data(disp, rspec.reloc(), call32_operand);
1529 }
1530
1531 void Assembler::jmpb(Label& L) {
1532 if (L.is_bound()) {
1533 const int short_size = 2;
1534 address entry = target(L);
1535 assert(is8bit((entry - _code_pos) + short_size),
1536 "Dispacement too large for a short jmp");
1537 assert(entry != NULL, "jmp most probably wrong");
1538 intptr_t offs = entry - _code_pos;
1539 emit_byte(0xEB);
1540 emit_byte((offs - short_size) & 0xFF);
1541 } else {
1542 InstructionMark im(this);
1543 L.add_patch_at(code(), locator());
1544 emit_byte(0xEB);
1545 emit_byte(0);
1546 }
1547 }
1548
1549 void Assembler::ldmxcsr( Address src) {
1550 NOT_LP64(assert(VM_Version::supports_sse(), ""));
1551 InstructionMark im(this);
1552 prefix(src);
1553 emit_byte(0x0F);
1554 emit_byte(0xAE);
1555 emit_operand(as_Register(2), src);
1556 }
1557
9263 assert (Universe::heap() != NULL, "java heap should be initialized");
9264 assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
9265 int oop_index = oop_recorder()->find_index(obj);
9266 RelocationHolder rspec = oop_Relocation::spec(oop_index);
9267 Assembler::cmp_narrow_oop(dst, oop_index, rspec);
9268 }
9269
9270 void MacroAssembler::reinit_heapbase() {
9271 if (UseCompressedOops) {
9272 movptr(r12_heapbase, ExternalAddress((address)Universe::narrow_oop_base_addr()));
9273 }
9274 }
9275 #endif // _LP64
9276
9277 // IndexOf for constant substrings with size >= 8 chars
9278 // which don't need to be loaded through stack.
9279 void MacroAssembler::string_indexofC8(Register str1, Register str2,
9280 Register cnt1, Register cnt2,
9281 int int_cnt2, Register result,
9282 XMMRegister vec, Register tmp) {
9283 assert(UseSSE42Intrinsics, "SSE4.2 is required");
9284
9285 // This method uses pcmpestri inxtruction with bound registers
9286 // inputs:
9287 // xmm - substring
9288 // rax - substring length (elements count)
9289 // mem - scanned string
9290 // rdx - string length (elements count)
9291 // 0xd - mode: 1100 (substring search) + 01 (unsigned shorts)
9292 // outputs:
9293 // rcx - matched index in string
9294 assert(cnt1 == rdx && cnt2 == rax && tmp == rcx, "pcmpestri");
9295
9296 Label RELOAD_SUBSTR, SCAN_TO_SUBSTR, SCAN_SUBSTR,
9297 RET_FOUND, RET_NOT_FOUND, EXIT, FOUND_SUBSTR,
9298 MATCH_SUBSTR_HEAD, RELOAD_STR, FOUND_CANDIDATE;
9299
9300 // Note, inline_string_indexOf() generates checks:
9301 // if (substr.count > string.count) return -1;
9302 // if (substr.count == 0) return 0;
9392 subl(cnt1, 8);
9393 cmpl(cnt2, -8); // Do not read beyond substring
9394 jccb(Assembler::lessEqual, CONT_SCAN_SUBSTR);
9395 // Back-up strings to avoid reading beyond substring:
9396 // cnt1 = cnt1 - cnt2 + 8
9397 addl(cnt1, cnt2); // cnt2 is negative
9398 addl(cnt1, 8);
9399 movl(cnt2, 8); negptr(cnt2);
9400 bind(CONT_SCAN_SUBSTR);
9401 if (int_cnt2 < (int)G) {
9402 movdqu(vec, Address(str2, cnt2, Address::times_2, int_cnt2*2));
9403 pcmpestri(vec, Address(result, cnt2, Address::times_2, int_cnt2*2), 0x0d);
9404 } else {
9405 // calculate index in register to avoid integer overflow (int_cnt2*2)
9406 movl(tmp, int_cnt2);
9407 addptr(tmp, cnt2);
9408 movdqu(vec, Address(str2, tmp, Address::times_2, 0));
9409 pcmpestri(vec, Address(result, tmp, Address::times_2, 0), 0x0d);
9410 }
9411 // Need to reload strings pointers if not matched whole vector
9412 jccb(Assembler::noOverflow, RELOAD_SUBSTR); // OF == 0
9413 addptr(cnt2, 8);
9414 jccb(Assembler::negative, SCAN_SUBSTR);
9415 // Fall through if found full substring
9416
9417 } // (int_cnt2 > 8)
9418
9419 bind(RET_FOUND);
9420 // Found result if we matched full small substring.
9421 // Compute substr offset
9422 subptr(result, str1);
9423 shrl(result, 1); // index
9424 bind(EXIT);
9425
9426 } // string_indexofC8
9427
9428 // Small strings are loaded through stack if they cross page boundary.
9429 void MacroAssembler::string_indexof(Register str1, Register str2,
9430 Register cnt1, Register cnt2,
9431 int int_cnt2, Register result,
9432 XMMRegister vec, Register tmp) {
9433 assert(UseSSE42Intrinsics, "SSE4.2 is required");
9434 //
9435 // int_cnt2 is length of small (< 8 chars) constant substring
9436 // or (-1) for non constant substring in which case its length
9437 // is in cnt2 register.
9438 //
9439 // Note, inline_string_indexOf() generates checks:
9440 // if (substr.count > string.count) return -1;
9441 // if (substr.count == 0) return 0;
9442 //
9443 assert(int_cnt2 == -1 || (0 < int_cnt2 && int_cnt2 < 8), "should be != 0");
9444
9445 // This method uses pcmpestri inxtruction with bound registers
9446 // inputs:
9447 // xmm - substring
9448 // rax - substring length (elements count)
9449 // mem - scanned string
9450 // rdx - string length (elements count)
9451 // 0xd - mode: 1100 (substring search) + 01 (unsigned shorts)
9452 // outputs:
9674 jmpb(SCAN_SUBSTR);
9675
9676 bind(RET_FOUND_LONG);
9677 movptr(str1, Address(rsp, wordSize));
9678 } // non constant
9679
9680 bind(RET_FOUND);
9681 // Compute substr offset
9682 subptr(result, str1);
9683 shrl(result, 1); // index
9684
9685 bind(CLEANUP);
9686 pop(rsp); // restore SP
9687
9688 } // string_indexof
9689
9690 // Compare strings.
9691 void MacroAssembler::string_compare(Register str1, Register str2,
9692 Register cnt1, Register cnt2, Register result,
9693 XMMRegister vec1) {
9694 Label LENGTH_DIFF_LABEL, POP_LABEL, DONE_LABEL, WHILE_HEAD_LABEL;
9695
9696 // Compute the minimum of the string lengths and the
9697 // difference of the string lengths (stack).
9698 // Do the conditional move stuff
9699 movl(result, cnt1);
9700 subl(cnt1, cnt2);
9701 push(cnt1);
9702 cmov32(Assembler::lessEqual, cnt2, result);
9703
9704 // Is the minimum length zero?
9705 testl(cnt2, cnt2);
9706 jcc(Assembler::zero, LENGTH_DIFF_LABEL);
9707
9708 // Load first characters
9709 load_unsigned_short(result, Address(str1, 0));
9710 load_unsigned_short(cnt1, Address(str2, 0));
9711
9712 // Compare first characters
9713 subl(result, cnt1);
9810 increment(cnt2);
9811 jccb(Assembler::notZero, WHILE_HEAD_LABEL);
9812
9813 // Strings are equal up to min length. Return the length difference.
9814 bind(LENGTH_DIFF_LABEL);
9815 pop(result);
9816 jmpb(DONE_LABEL);
9817
9818 // Discard the stored length difference
9819 bind(POP_LABEL);
9820 pop(cnt1);
9821
9822 // That's it
9823 bind(DONE_LABEL);
9824 }
9825
9826 // Compare char[] arrays aligned to 4 bytes or substrings.
9827 void MacroAssembler::char_arrays_equals(bool is_array_equ, Register ary1, Register ary2,
9828 Register limit, Register result, Register chr,
9829 XMMRegister vec1, XMMRegister vec2) {
9830 Label TRUE_LABEL, FALSE_LABEL, DONE, COMPARE_VECTORS, COMPARE_CHAR;
9831
9832 int length_offset = arrayOopDesc::length_offset_in_bytes();
9833 int base_offset = arrayOopDesc::base_offset_in_bytes(T_CHAR);
9834
9835 // Check the input args
9836 cmpptr(ary1, ary2);
9837 jcc(Assembler::equal, TRUE_LABEL);
9838
9839 if (is_array_equ) {
9840 // Need additional checks for arrays_equals.
9841 testptr(ary1, ary1);
9842 jcc(Assembler::zero, FALSE_LABEL);
9843 testptr(ary2, ary2);
9844 jcc(Assembler::zero, FALSE_LABEL);
9845
9846 // Check the lengths
9847 movl(limit, Address(ary1, length_offset));
9848 cmpl(limit, Address(ary2, length_offset));
9849 jcc(Assembler::notEqual, FALSE_LABEL);
9929 movl(result, 1); // return true
9930 jmpb(DONE);
9931
9932 bind(FALSE_LABEL);
9933 xorl(result, result); // return false
9934
9935 // That's it
9936 bind(DONE);
9937 }
9938
9939 #ifdef PRODUCT
9940 #define BLOCK_COMMENT(str) /* nothing */
9941 #else
9942 #define BLOCK_COMMENT(str) block_comment(str)
9943 #endif
9944
9945 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
9946 void MacroAssembler::generate_fill(BasicType t, bool aligned,
9947 Register to, Register value, Register count,
9948 Register rtmp, XMMRegister xtmp) {
9949 assert_different_registers(to, value, count, rtmp);
9950 Label L_exit, L_skip_align1, L_skip_align2, L_fill_byte;
9951 Label L_fill_2_bytes, L_fill_4_bytes;
9952
9953 int shift = -1;
9954 switch (t) {
9955 case T_BYTE:
9956 shift = 2;
9957 break;
9958 case T_SHORT:
9959 shift = 1;
9960 break;
9961 case T_INT:
9962 shift = 0;
9963 break;
9964 default: ShouldNotReachHere();
9965 }
9966
9967 if (t == T_BYTE) {
9968 andl(value, 0xff);
|
1448 emit_byte(0x0F);
1449 emit_byte(0x80 | cc);
1450 emit_long(offs - long_size);
1451 }
1452 } else {
1453 // Note: could eliminate cond. jumps to this jump if condition
1454 // is the same however, seems to be rather unlikely case.
1455 // Note: use jccb() if label to be bound is very close to get
1456 // an 8-bit displacement
1457 L.add_patch_at(code(), locator());
1458 emit_byte(0x0F);
1459 emit_byte(0x80 | cc);
1460 emit_long(0);
1461 }
1462 }
1463
1464 void Assembler::jccb(Condition cc, Label& L) {
1465 if (L.is_bound()) {
1466 const int short_size = 2;
1467 address entry = target(L);
1468 #ifdef ASSERT
1469 intptr_t dist = (intptr_t)entry - ((intptr_t)_code_pos + short_size);
1470 intptr_t delta = short_branch_delta();
1471 if (delta != 0) {
1472 dist += (dist < 0 ? (-delta) :delta);
1473 }
1474 assert(is8bit(dist), "Dispacement too large for a short jmp");
1475 #endif
1476 intptr_t offs = (intptr_t)entry - (intptr_t)_code_pos;
1477 // 0111 tttn #8-bit disp
1478 emit_byte(0x70 | cc);
1479 emit_byte((offs - short_size) & 0xFF);
1480 } else {
1481 InstructionMark im(this);
1482 L.add_patch_at(code(), locator());
1483 emit_byte(0x70 | cc);
1484 emit_byte(0);
1485 }
1486 }
1487
1488 void Assembler::jmp(Address adr) {
1489 InstructionMark im(this);
1490 prefix(adr);
1491 emit_byte(0xFF);
1492 emit_operand(rsp, adr);
1493 }
1494
1495 void Assembler::jmp(Label& L, bool maybe_short) {
1521
1522 void Assembler::jmp(Register entry) {
1523 int encode = prefix_and_encode(entry->encoding());
1524 emit_byte(0xFF);
1525 emit_byte(0xE0 | encode);
1526 }
1527
1528 void Assembler::jmp_literal(address dest, RelocationHolder const& rspec) {
1529 InstructionMark im(this);
1530 emit_byte(0xE9);
1531 assert(dest != NULL, "must have a target");
1532 intptr_t disp = dest - (_code_pos + sizeof(int32_t));
1533 assert(is_simm32(disp), "must be 32bit offset (jmp)");
1534 emit_data(disp, rspec.reloc(), call32_operand);
1535 }
1536
1537 void Assembler::jmpb(Label& L) {
1538 if (L.is_bound()) {
1539 const int short_size = 2;
1540 address entry = target(L);
1541 assert(entry != NULL, "jmp most probably wrong");
1542 #ifdef ASSERT
1543 intptr_t dist = (intptr_t)entry - ((intptr_t)_code_pos + short_size);
1544 intptr_t delta = short_branch_delta();
1545 if (delta != 0) {
1546 dist += (dist < 0 ? (-delta) :delta);
1547 }
1548 assert(is8bit(dist), "Dispacement too large for a short jmp");
1549 #endif
1550 intptr_t offs = entry - _code_pos;
1551 emit_byte(0xEB);
1552 emit_byte((offs - short_size) & 0xFF);
1553 } else {
1554 InstructionMark im(this);
1555 L.add_patch_at(code(), locator());
1556 emit_byte(0xEB);
1557 emit_byte(0);
1558 }
1559 }
1560
1561 void Assembler::ldmxcsr( Address src) {
1562 NOT_LP64(assert(VM_Version::supports_sse(), ""));
1563 InstructionMark im(this);
1564 prefix(src);
1565 emit_byte(0x0F);
1566 emit_byte(0xAE);
1567 emit_operand(as_Register(2), src);
1568 }
1569
9275 assert (Universe::heap() != NULL, "java heap should be initialized");
9276 assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
9277 int oop_index = oop_recorder()->find_index(obj);
9278 RelocationHolder rspec = oop_Relocation::spec(oop_index);
9279 Assembler::cmp_narrow_oop(dst, oop_index, rspec);
9280 }
9281
9282 void MacroAssembler::reinit_heapbase() {
9283 if (UseCompressedOops) {
9284 movptr(r12_heapbase, ExternalAddress((address)Universe::narrow_oop_base_addr()));
9285 }
9286 }
9287 #endif // _LP64
9288
9289 // IndexOf for constant substrings with size >= 8 chars
9290 // which don't need to be loaded through stack.
9291 void MacroAssembler::string_indexofC8(Register str1, Register str2,
9292 Register cnt1, Register cnt2,
9293 int int_cnt2, Register result,
9294 XMMRegister vec, Register tmp) {
9295 ShortBranchVerifier sbv(this);
9296 assert(UseSSE42Intrinsics, "SSE4.2 is required");
9297
9298 // This method uses pcmpestri inxtruction with bound registers
9299 // inputs:
9300 // xmm - substring
9301 // rax - substring length (elements count)
9302 // mem - scanned string
9303 // rdx - string length (elements count)
9304 // 0xd - mode: 1100 (substring search) + 01 (unsigned shorts)
9305 // outputs:
9306 // rcx - matched index in string
9307 assert(cnt1 == rdx && cnt2 == rax && tmp == rcx, "pcmpestri");
9308
9309 Label RELOAD_SUBSTR, SCAN_TO_SUBSTR, SCAN_SUBSTR,
9310 RET_FOUND, RET_NOT_FOUND, EXIT, FOUND_SUBSTR,
9311 MATCH_SUBSTR_HEAD, RELOAD_STR, FOUND_CANDIDATE;
9312
9313 // Note, inline_string_indexOf() generates checks:
9314 // if (substr.count > string.count) return -1;
9315 // if (substr.count == 0) return 0;
9405 subl(cnt1, 8);
9406 cmpl(cnt2, -8); // Do not read beyond substring
9407 jccb(Assembler::lessEqual, CONT_SCAN_SUBSTR);
9408 // Back-up strings to avoid reading beyond substring:
9409 // cnt1 = cnt1 - cnt2 + 8
9410 addl(cnt1, cnt2); // cnt2 is negative
9411 addl(cnt1, 8);
9412 movl(cnt2, 8); negptr(cnt2);
9413 bind(CONT_SCAN_SUBSTR);
9414 if (int_cnt2 < (int)G) {
9415 movdqu(vec, Address(str2, cnt2, Address::times_2, int_cnt2*2));
9416 pcmpestri(vec, Address(result, cnt2, Address::times_2, int_cnt2*2), 0x0d);
9417 } else {
9418 // calculate index in register to avoid integer overflow (int_cnt2*2)
9419 movl(tmp, int_cnt2);
9420 addptr(tmp, cnt2);
9421 movdqu(vec, Address(str2, tmp, Address::times_2, 0));
9422 pcmpestri(vec, Address(result, tmp, Address::times_2, 0), 0x0d);
9423 }
9424 // Need to reload strings pointers if not matched whole vector
9425 jcc(Assembler::noOverflow, RELOAD_SUBSTR); // OF == 0
9426 addptr(cnt2, 8);
9427 jcc(Assembler::negative, SCAN_SUBSTR);
9428 // Fall through if found full substring
9429
9430 } // (int_cnt2 > 8)
9431
9432 bind(RET_FOUND);
9433 // Found result if we matched full small substring.
9434 // Compute substr offset
9435 subptr(result, str1);
9436 shrl(result, 1); // index
9437 bind(EXIT);
9438
9439 } // string_indexofC8
9440
9441 // Small strings are loaded through stack if they cross page boundary.
9442 void MacroAssembler::string_indexof(Register str1, Register str2,
9443 Register cnt1, Register cnt2,
9444 int int_cnt2, Register result,
9445 XMMRegister vec, Register tmp) {
9446 ShortBranchVerifier sbv(this);
9447 assert(UseSSE42Intrinsics, "SSE4.2 is required");
9448 //
9449 // int_cnt2 is length of small (< 8 chars) constant substring
9450 // or (-1) for non constant substring in which case its length
9451 // is in cnt2 register.
9452 //
9453 // Note, inline_string_indexOf() generates checks:
9454 // if (substr.count > string.count) return -1;
9455 // if (substr.count == 0) return 0;
9456 //
9457 assert(int_cnt2 == -1 || (0 < int_cnt2 && int_cnt2 < 8), "should be != 0");
9458
9459 // This method uses pcmpestri inxtruction with bound registers
9460 // inputs:
9461 // xmm - substring
9462 // rax - substring length (elements count)
9463 // mem - scanned string
9464 // rdx - string length (elements count)
9465 // 0xd - mode: 1100 (substring search) + 01 (unsigned shorts)
9466 // outputs:
9688 jmpb(SCAN_SUBSTR);
9689
9690 bind(RET_FOUND_LONG);
9691 movptr(str1, Address(rsp, wordSize));
9692 } // non constant
9693
9694 bind(RET_FOUND);
9695 // Compute substr offset
9696 subptr(result, str1);
9697 shrl(result, 1); // index
9698
9699 bind(CLEANUP);
9700 pop(rsp); // restore SP
9701
9702 } // string_indexof
9703
9704 // Compare strings.
9705 void MacroAssembler::string_compare(Register str1, Register str2,
9706 Register cnt1, Register cnt2, Register result,
9707 XMMRegister vec1) {
9708 ShortBranchVerifier sbv(this);
9709 Label LENGTH_DIFF_LABEL, POP_LABEL, DONE_LABEL, WHILE_HEAD_LABEL;
9710
9711 // Compute the minimum of the string lengths and the
9712 // difference of the string lengths (stack).
9713 // Do the conditional move stuff
9714 movl(result, cnt1);
9715 subl(cnt1, cnt2);
9716 push(cnt1);
9717 cmov32(Assembler::lessEqual, cnt2, result);
9718
9719 // Is the minimum length zero?
9720 testl(cnt2, cnt2);
9721 jcc(Assembler::zero, LENGTH_DIFF_LABEL);
9722
9723 // Load first characters
9724 load_unsigned_short(result, Address(str1, 0));
9725 load_unsigned_short(cnt1, Address(str2, 0));
9726
9727 // Compare first characters
9728 subl(result, cnt1);
9825 increment(cnt2);
9826 jccb(Assembler::notZero, WHILE_HEAD_LABEL);
9827
9828 // Strings are equal up to min length. Return the length difference.
9829 bind(LENGTH_DIFF_LABEL);
9830 pop(result);
9831 jmpb(DONE_LABEL);
9832
9833 // Discard the stored length difference
9834 bind(POP_LABEL);
9835 pop(cnt1);
9836
9837 // That's it
9838 bind(DONE_LABEL);
9839 }
9840
9841 // Compare char[] arrays aligned to 4 bytes or substrings.
9842 void MacroAssembler::char_arrays_equals(bool is_array_equ, Register ary1, Register ary2,
9843 Register limit, Register result, Register chr,
9844 XMMRegister vec1, XMMRegister vec2) {
9845 ShortBranchVerifier sbv(this);
9846 Label TRUE_LABEL, FALSE_LABEL, DONE, COMPARE_VECTORS, COMPARE_CHAR;
9847
9848 int length_offset = arrayOopDesc::length_offset_in_bytes();
9849 int base_offset = arrayOopDesc::base_offset_in_bytes(T_CHAR);
9850
9851 // Check the input args
9852 cmpptr(ary1, ary2);
9853 jcc(Assembler::equal, TRUE_LABEL);
9854
9855 if (is_array_equ) {
9856 // Need additional checks for arrays_equals.
9857 testptr(ary1, ary1);
9858 jcc(Assembler::zero, FALSE_LABEL);
9859 testptr(ary2, ary2);
9860 jcc(Assembler::zero, FALSE_LABEL);
9861
9862 // Check the lengths
9863 movl(limit, Address(ary1, length_offset));
9864 cmpl(limit, Address(ary2, length_offset));
9865 jcc(Assembler::notEqual, FALSE_LABEL);
9945 movl(result, 1); // return true
9946 jmpb(DONE);
9947
9948 bind(FALSE_LABEL);
9949 xorl(result, result); // return false
9950
9951 // That's it
9952 bind(DONE);
9953 }
9954
9955 #ifdef PRODUCT
9956 #define BLOCK_COMMENT(str) /* nothing */
9957 #else
9958 #define BLOCK_COMMENT(str) block_comment(str)
9959 #endif
9960
9961 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
9962 void MacroAssembler::generate_fill(BasicType t, bool aligned,
9963 Register to, Register value, Register count,
9964 Register rtmp, XMMRegister xtmp) {
9965 ShortBranchVerifier sbv(this);
9966 assert_different_registers(to, value, count, rtmp);
9967 Label L_exit, L_skip_align1, L_skip_align2, L_fill_byte;
9968 Label L_fill_2_bytes, L_fill_4_bytes;
9969
9970 int shift = -1;
9971 switch (t) {
9972 case T_BYTE:
9973 shift = 2;
9974 break;
9975 case T_SHORT:
9976 shift = 1;
9977 break;
9978 case T_INT:
9979 shift = 0;
9980 break;
9981 default: ShouldNotReachHere();
9982 }
9983
9984 if (t == T_BYTE) {
9985 andl(value, 0xff);
|