< prev index next >

src/cpu/sparc/vm/jniFastGetField_sparc.cpp

Print this page




 135   const char *name = "jni_fast_GetLongField";
 136   ResourceMark rm;
 137   BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE*wordSize);
 138   CodeBuffer cbuf(blob);
 139   MacroAssembler* masm = new MacroAssembler(&cbuf);
 140   address fast_entry = __ pc();
 141 
 142   Label label1, label2;
 143 
 144   AddressLiteral cnt_addrlit(SafepointSynchronize::safepoint_counter_addr());
 145   __ sethi (cnt_addrlit, G3);
 146   Address cnt_addr(G3, cnt_addrlit.low10());
 147   __ ld (cnt_addr, G4);
 148   __ andcc (G4, 1, G0);
 149   __ br (Assembler::notZero, false, Assembler::pn, label1);
 150   __ delayed()->srl (O2, 2, O4);
 151   __ andn (O1, JNIHandles::weak_tag_mask, O1);
 152   __ ld_ptr (O1, 0, O5);
 153   __ add (O5, O4, O5);
 154 
 155 #ifndef _LP64
 156   assert(count < LIST_CAPACITY-1, "LIST_CAPACITY too small");
 157   speculative_load_pclist[count++] = __ pc();
 158   __ ld (O5, 0, G2);
 159 
 160   speculative_load_pclist[count] = __ pc();
 161   __ ld (O5, 4, O3);
 162 #else
 163   assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
 164   speculative_load_pclist[count] = __ pc();
 165   __ ldx (O5, 0, O3);
 166 #endif
 167 
 168   __ ld (cnt_addr, G1);
 169   __ cmp (G1, G4);
 170   __ br (Assembler::notEqual, false, Assembler::pn, label2);
 171   __ delayed()->mov (O7, G1);
 172 
 173 #ifndef _LP64
 174   __ mov (G2, O0);
 175   __ retl ();
 176   __ delayed()->mov (O3, O1);
 177 #else
 178   __ retl ();
 179   __ delayed()->mov (O3, O0);
 180 #endif
 181 
 182 #ifndef _LP64
 183   slowcase_entry_pclist[count-1] = __ pc();
 184   slowcase_entry_pclist[count++] = __ pc() ;
 185 #else
 186   slowcase_entry_pclist[count++] = __ pc();
 187 #endif
 188 
 189   __ bind (label1);
 190   __ mov (O7, G1);
 191 
 192   address slow_case_addr = jni_GetLongField_addr();
 193   __ bind (label2);
 194   __ call (slow_case_addr, relocInfo::none);
 195   __ delayed()->mov (G1, O7);
 196 
 197   __ flush ();
 198 
 199   return fast_entry;
 200 }
 201 
 202 address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
 203   const char *name;
 204   switch (type) {
 205     case T_FLOAT:  name = "jni_fast_GetFloatField";  break;
 206     case T_DOUBLE: name = "jni_fast_GetDoubleField"; break;
 207     default:       ShouldNotReachHere();




 135   const char *name = "jni_fast_GetLongField";
 136   ResourceMark rm;
 137   BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE*wordSize);
 138   CodeBuffer cbuf(blob);
 139   MacroAssembler* masm = new MacroAssembler(&cbuf);
 140   address fast_entry = __ pc();
 141 
 142   Label label1, label2;
 143 
 144   AddressLiteral cnt_addrlit(SafepointSynchronize::safepoint_counter_addr());
 145   __ sethi (cnt_addrlit, G3);
 146   Address cnt_addr(G3, cnt_addrlit.low10());
 147   __ ld (cnt_addr, G4);
 148   __ andcc (G4, 1, G0);
 149   __ br (Assembler::notZero, false, Assembler::pn, label1);
 150   __ delayed()->srl (O2, 2, O4);
 151   __ andn (O1, JNIHandles::weak_tag_mask, O1);
 152   __ ld_ptr (O1, 0, O5);
 153   __ add (O5, O4, O5);
 154 








 155   assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
 156   speculative_load_pclist[count] = __ pc();
 157   __ ldx (O5, 0, O3);

 158 
 159   __ ld (cnt_addr, G1);
 160   __ cmp (G1, G4);
 161   __ br (Assembler::notEqual, false, Assembler::pn, label2);
 162   __ delayed()->mov (O7, G1);
 163 





 164   __ retl ();
 165   __ delayed()->mov (O3, O0);

 166 




 167   slowcase_entry_pclist[count++] = __ pc();

 168 
 169   __ bind (label1);
 170   __ mov (O7, G1);
 171 
 172   address slow_case_addr = jni_GetLongField_addr();
 173   __ bind (label2);
 174   __ call (slow_case_addr, relocInfo::none);
 175   __ delayed()->mov (G1, O7);
 176 
 177   __ flush ();
 178 
 179   return fast_entry;
 180 }
 181 
 182 address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
 183   const char *name;
 184   switch (type) {
 185     case T_FLOAT:  name = "jni_fast_GetFloatField";  break;
 186     case T_DOUBLE: name = "jni_fast_GetDoubleField"; break;
 187     default:       ShouldNotReachHere();


< prev index next >