< prev index next >

src/cpu/x86/vm/jniFastGetField_x86_64.cpp

Print this page
rev 9067 : 8139040: Fix initializations before ShouldNotReachHere()


  34 #define BUFFER_SIZE 30*wordSize
  35 
  36 // Instead of issuing lfence for LoadLoad barrier, we create data dependency
  37 // between loads, which is more efficient than lfence.
  38 
  39 // Common register usage:
  40 // rax/xmm0: result
  41 // c_rarg0:    jni env
  42 // c_rarg1:    obj
  43 // c_rarg2:    jfield id
  44 
  45 static const Register robj          = r9;
  46 static const Register rcounter      = r10;
  47 static const Register roffset       = r11;
  48 static const Register rcounter_addr = r11;
  49 
  50 // Warning: do not use rip relative addressing after the first counter load
  51 // since that may scratch r10!
  52 
  53 address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
  54   const char *name;
  55   switch (type) {
  56     case T_BOOLEAN: name = "jni_fast_GetBooleanField"; break;
  57     case T_BYTE:    name = "jni_fast_GetByteField";    break;
  58     case T_CHAR:    name = "jni_fast_GetCharField";    break;
  59     case T_SHORT:   name = "jni_fast_GetShortField";   break;
  60     case T_INT:     name = "jni_fast_GetIntField";     break;
  61     case T_LONG:    name = "jni_fast_GetLongField";    break;
  62     default:        ShouldNotReachHere();
  63   }
  64   ResourceMark rm;
  65   BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE);
  66   CodeBuffer cbuf(blob);
  67   MacroAssembler* masm = new MacroAssembler(&cbuf);
  68   address fast_entry = __ pc();
  69 
  70   Label slow;
  71 
  72   ExternalAddress counter(SafepointSynchronize::safepoint_counter_addr());
  73   __ mov32 (rcounter, counter);
  74   __ mov   (robj, c_rarg1);


 136   return generate_fast_get_int_field0(T_BYTE);
 137 }
 138 
 139 address JNI_FastGetField::generate_fast_get_char_field() {
 140   return generate_fast_get_int_field0(T_CHAR);
 141 }
 142 
 143 address JNI_FastGetField::generate_fast_get_short_field() {
 144   return generate_fast_get_int_field0(T_SHORT);
 145 }
 146 
 147 address JNI_FastGetField::generate_fast_get_int_field() {
 148   return generate_fast_get_int_field0(T_INT);
 149 }
 150 
 151 address JNI_FastGetField::generate_fast_get_long_field() {
 152   return generate_fast_get_int_field0(T_LONG);
 153 }
 154 
 155 address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
 156   const char *name;
 157   switch (type) {
 158     case T_FLOAT:     name = "jni_fast_GetFloatField";     break;
 159     case T_DOUBLE:    name = "jni_fast_GetDoubleField";    break;
 160     default:          ShouldNotReachHere();
 161   }
 162   ResourceMark rm;
 163   BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE);
 164   CodeBuffer cbuf(blob);
 165   MacroAssembler* masm = new MacroAssembler(&cbuf);
 166   address fast_entry = __ pc();
 167 
 168   Label slow;
 169 
 170   ExternalAddress counter(SafepointSynchronize::safepoint_counter_addr());
 171   __ mov32 (rcounter, counter);
 172   __ mov   (robj, c_rarg1);
 173   __ testb (rcounter, 1);
 174   __ jcc (Assembler::notZero, slow);
 175   if (os::is_MP()) {
 176     __ xorptr(robj, rcounter);




  34 #define BUFFER_SIZE 30*wordSize
  35 
  36 // Instead of issuing lfence for LoadLoad barrier, we create data dependency
  37 // between loads, which is more efficient than lfence.
  38 
  39 // Common register usage:
  40 // rax/xmm0: result
  41 // c_rarg0:    jni env
  42 // c_rarg1:    obj
  43 // c_rarg2:    jfield id
  44 
  45 static const Register robj          = r9;
  46 static const Register rcounter      = r10;
  47 static const Register roffset       = r11;
  48 static const Register rcounter_addr = r11;
  49 
  50 // Warning: do not use rip relative addressing after the first counter load
  51 // since that may scratch r10!
  52 
  53 address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
  54   const char *name = NULL;
  55   switch (type) {
  56     case T_BOOLEAN: name = "jni_fast_GetBooleanField"; break;
  57     case T_BYTE:    name = "jni_fast_GetByteField";    break;
  58     case T_CHAR:    name = "jni_fast_GetCharField";    break;
  59     case T_SHORT:   name = "jni_fast_GetShortField";   break;
  60     case T_INT:     name = "jni_fast_GetIntField";     break;
  61     case T_LONG:    name = "jni_fast_GetLongField";    break;
  62     default:        ShouldNotReachHere();
  63   }
  64   ResourceMark rm;
  65   BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE);
  66   CodeBuffer cbuf(blob);
  67   MacroAssembler* masm = new MacroAssembler(&cbuf);
  68   address fast_entry = __ pc();
  69 
  70   Label slow;
  71 
  72   ExternalAddress counter(SafepointSynchronize::safepoint_counter_addr());
  73   __ mov32 (rcounter, counter);
  74   __ mov   (robj, c_rarg1);


 136   return generate_fast_get_int_field0(T_BYTE);
 137 }
 138 
 139 address JNI_FastGetField::generate_fast_get_char_field() {
 140   return generate_fast_get_int_field0(T_CHAR);
 141 }
 142 
 143 address JNI_FastGetField::generate_fast_get_short_field() {
 144   return generate_fast_get_int_field0(T_SHORT);
 145 }
 146 
 147 address JNI_FastGetField::generate_fast_get_int_field() {
 148   return generate_fast_get_int_field0(T_INT);
 149 }
 150 
 151 address JNI_FastGetField::generate_fast_get_long_field() {
 152   return generate_fast_get_int_field0(T_LONG);
 153 }
 154 
 155 address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
 156   const char *name = NULL;
 157   switch (type) {
 158     case T_FLOAT:     name = "jni_fast_GetFloatField";     break;
 159     case T_DOUBLE:    name = "jni_fast_GetDoubleField";    break;
 160     default:          ShouldNotReachHere();
 161   }
 162   ResourceMark rm;
 163   BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE);
 164   CodeBuffer cbuf(blob);
 165   MacroAssembler* masm = new MacroAssembler(&cbuf);
 166   address fast_entry = __ pc();
 167 
 168   Label slow;
 169 
 170   ExternalAddress counter(SafepointSynchronize::safepoint_counter_addr());
 171   __ mov32 (rcounter, counter);
 172   __ mov   (robj, c_rarg1);
 173   __ testb (rcounter, 1);
 174   __ jcc (Assembler::notZero, slow);
 175   if (os::is_MP()) {
 176     __ xorptr(robj, rcounter);


< prev index next >