5999 } else {
6000 Label L;
6001 jccb(negate_condition(cc), L);
6002 movl(dst, src);
6003 bind(L);
6004 }
6005 }
6006
6007 void MacroAssembler::cmov32(Condition cc, Register dst, Register src) {
6008 if (VM_Version::supports_cmov()) {
6009 cmovl(cc, dst, src);
6010 } else {
6011 Label L;
6012 jccb(negate_condition(cc), L);
6013 movl(dst, src);
6014 bind(L);
6015 }
6016 }
6017
6018 void MacroAssembler::verify_oop(Register reg, const char* s) {
6019 if (!VerifyOops) return;
6020
6021 // Pass register number to verify_oop_subroutine
6022 const char* b = NULL;
6023 {
6024 ResourceMark rm;
6025 stringStream ss;
6026 ss.print("verify_oop: %s: %s", reg->name(), s);
6027 b = code_string(ss.as_string());
6028 }
6029 BLOCK_COMMENT("verify_oop {");
6030 #ifdef _LP64
6031 push(rscratch1); // save r10, trashed by movptr()
6032 #endif
6033 push(rax); // save rax,
6034 push(reg); // pass register argument
6035 ExternalAddress buffer((address) b);
6036 // avoid using pushptr, as it modifies scratch registers
6037 // and our contract is not to modify anything
6038 movptr(rax, buffer.addr());
6039 push(rax);
6089 int stackElementSize = Interpreter::stackElementSize;
6090 int offset = Interpreter::expr_offset_in_bytes(extra_slot_offset+0);
6091 #ifdef ASSERT
6092 int offset1 = Interpreter::expr_offset_in_bytes(extra_slot_offset+1);
6093 assert(offset1 - offset == stackElementSize, "correct arithmetic");
6094 #endif
6095 Register scale_reg = noreg;
6096 Address::ScaleFactor scale_factor = Address::no_scale;
6097 if (arg_slot.is_constant()) {
6098 offset += arg_slot.as_constant() * stackElementSize;
6099 } else {
6100 scale_reg = arg_slot.as_register();
6101 scale_factor = Address::times(stackElementSize);
6102 }
6103 offset += wordSize; // return PC is on stack
6104 return Address(rsp, scale_reg, scale_factor, offset);
6105 }
6106
6107
6108 void MacroAssembler::verify_oop_addr(Address addr, const char* s) {
6109 if (!VerifyOops) return;
6110
6111 // Address adjust(addr.base(), addr.index(), addr.scale(), addr.disp() + BytesPerWord);
6112 // Pass register number to verify_oop_subroutine
6113 const char* b = NULL;
6114 {
6115 ResourceMark rm;
6116 stringStream ss;
6117 ss.print("verify_oop_addr: %s", s);
6118 b = code_string(ss.as_string());
6119 }
6120 #ifdef _LP64
6121 push(rscratch1); // save r10, trashed by movptr()
6122 #endif
6123 push(rax); // save rax,
6124 // addr may contain rsp so we will have to adjust it based on the push
6125 // we just did (and on 64 bit we do two pushes)
6126 // NOTE: 64bit seemed to have had a bug in that it did movq(addr, rax); which
6127 // stores rax into addr which is backwards of what was intended.
6128 if (addr.uses(rsp)) {
6129 lea(rax, addr);
|
5999 } else {
6000 Label L;
6001 jccb(negate_condition(cc), L);
6002 movl(dst, src);
6003 bind(L);
6004 }
6005 }
6006
6007 void MacroAssembler::cmov32(Condition cc, Register dst, Register src) {
6008 if (VM_Version::supports_cmov()) {
6009 cmovl(cc, dst, src);
6010 } else {
6011 Label L;
6012 jccb(negate_condition(cc), L);
6013 movl(dst, src);
6014 bind(L);
6015 }
6016 }
6017
6018 void MacroAssembler::verify_oop(Register reg, const char* s) {
6019 if (!VerifyOops || VerifyAdapterSharing) {
6020 // Below address of the code string confuses VerifyAdapterSharing
6021 // because it may differ between otherwise equivalent adapters.
6022 return;
6023 }
6024
6025 // Pass register number to verify_oop_subroutine
6026 const char* b = NULL;
6027 {
6028 ResourceMark rm;
6029 stringStream ss;
6030 ss.print("verify_oop: %s: %s", reg->name(), s);
6031 b = code_string(ss.as_string());
6032 }
6033 BLOCK_COMMENT("verify_oop {");
6034 #ifdef _LP64
6035 push(rscratch1); // save r10, trashed by movptr()
6036 #endif
6037 push(rax); // save rax,
6038 push(reg); // pass register argument
6039 ExternalAddress buffer((address) b);
6040 // avoid using pushptr, as it modifies scratch registers
6041 // and our contract is not to modify anything
6042 movptr(rax, buffer.addr());
6043 push(rax);
6093 int stackElementSize = Interpreter::stackElementSize;
6094 int offset = Interpreter::expr_offset_in_bytes(extra_slot_offset+0);
6095 #ifdef ASSERT
6096 int offset1 = Interpreter::expr_offset_in_bytes(extra_slot_offset+1);
6097 assert(offset1 - offset == stackElementSize, "correct arithmetic");
6098 #endif
6099 Register scale_reg = noreg;
6100 Address::ScaleFactor scale_factor = Address::no_scale;
6101 if (arg_slot.is_constant()) {
6102 offset += arg_slot.as_constant() * stackElementSize;
6103 } else {
6104 scale_reg = arg_slot.as_register();
6105 scale_factor = Address::times(stackElementSize);
6106 }
6107 offset += wordSize; // return PC is on stack
6108 return Address(rsp, scale_reg, scale_factor, offset);
6109 }
6110
6111
6112 void MacroAssembler::verify_oop_addr(Address addr, const char* s) {
6113 if (!VerifyOops || VerifyAdapterSharing) {
6114 // Below address of the code string confuses VerifyAdapterSharing
6115 // because it may differ between otherwise equivalent adapters.
6116 return;
6117 }
6118
6119 // Address adjust(addr.base(), addr.index(), addr.scale(), addr.disp() + BytesPerWord);
6120 // Pass register number to verify_oop_subroutine
6121 const char* b = NULL;
6122 {
6123 ResourceMark rm;
6124 stringStream ss;
6125 ss.print("verify_oop_addr: %s", s);
6126 b = code_string(ss.as_string());
6127 }
6128 #ifdef _LP64
6129 push(rscratch1); // save r10, trashed by movptr()
6130 #endif
6131 push(rax); // save rax,
6132 // addr may contain rsp so we will have to adjust it based on the push
6133 // we just did (and on 64 bit we do two pushes)
6134 // NOTE: 64bit seemed to have had a bug in that it did movq(addr, rax); which
6135 // stores rax into addr which is backwards of what was intended.
6136 if (addr.uses(rsp)) {
6137 lea(rax, addr);
|