src/cpu/x86/vm/macroAssembler_x86.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8026775 Sdiff src/cpu/x86/vm

src/cpu/x86/vm/macroAssembler_x86.cpp

Print this page




1364     lock();
1365   incrementl(counter_addr);
1366   popf();
1367 }
1368 
1369 // Writes to stack successive pages until offset reached to check for
1370 // stack overflow + shadow pages.  This clobbers tmp.
1371 void MacroAssembler::bang_stack_size(Register size, Register tmp) {
1372   movptr(tmp, rsp);
1373   // Bang stack for total size given plus shadow page size.
1374   // Bang one page at a time because large size can bang beyond yellow and
1375   // red zones.
1376   Label loop;
1377   bind(loop);
1378   movl(Address(tmp, (-os::vm_page_size())), size );
1379   subptr(tmp, os::vm_page_size());
1380   subl(size, os::vm_page_size());
1381   jcc(Assembler::greater, loop);
1382 
1383   // Bang down shadow pages too.
1384   // The -1 because we already subtracted 1 page.
1385   for (int i = 0; i< StackShadowPages-1; i++) {



1386     // this could be any sized move but this is can be a debugging crumb
1387     // so the bigger the better.
1388     movptr(Address(tmp, (-i*os::vm_page_size())), size );
1389   }
1390 }
1391 
1392 void MacroAssembler::biased_locking_exit(Register obj_reg, Register temp_reg, Label& done) {
1393   assert(UseBiasedLocking, "why call this otherwise?");
1394 
1395   // Check for biased locking unlock case, which is a no-op
1396   // Note: we do not have to check the thread ID for two reasons.
1397   // First, the interpreter checks for IllegalMonitorStateException at
1398   // a higher level. Second, if the bias was revoked while we held the
1399   // lock, the object could not be rebiased toward another thread, so
1400   // the bias bit would be clear.
1401   movptr(temp_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
1402   andptr(temp_reg, markOopDesc::biased_lock_mask_in_place);
1403   cmpptr(temp_reg, markOopDesc::biased_lock_pattern);
1404   jcc(Assembler::equal, done);
1405 }




1364     lock();
1365   incrementl(counter_addr);
1366   popf();
1367 }
1368 
1369 // Writes to stack successive pages until offset reached to check for
1370 // stack overflow + shadow pages.  This clobbers tmp.
1371 void MacroAssembler::bang_stack_size(Register size, Register tmp) {
1372   movptr(tmp, rsp);
1373   // Bang stack for total size given plus shadow page size.
1374   // Bang one page at a time because large size can bang beyond yellow and
1375   // red zones.
1376   Label loop;
1377   bind(loop);
1378   movl(Address(tmp, (-os::vm_page_size())), size );
1379   subptr(tmp, os::vm_page_size());
1380   subl(size, os::vm_page_size());
1381   jcc(Assembler::greater, loop);
1382 
1383   // Bang down shadow pages too.
1384   // At this point, (tmp-0) is the last address touched, so don't touch it again.
1385   // (It was touched as (tmp-pagesize) but then tmp was post-decremented.)
1386   // Skip this address by starting at i=1, and touch a few more pages below.
1387   // N.B.  It is important to touch all the down to and including i=StackShadowPages.
1388   for (int i = 1; i <= StackShadowPages; i++) {
1389     // this could be any sized move but this is can be a debugging crumb
1390     // so the bigger the better.
1391     movptr(Address(tmp, (-i*os::vm_page_size())), size );
1392   }
1393 }
1394 
1395 void MacroAssembler::biased_locking_exit(Register obj_reg, Register temp_reg, Label& done) {
1396   assert(UseBiasedLocking, "why call this otherwise?");
1397 
1398   // Check for biased locking unlock case, which is a no-op
1399   // Note: we do not have to check the thread ID for two reasons.
1400   // First, the interpreter checks for IllegalMonitorStateException at
1401   // a higher level. Second, if the bias was revoked while we held the
1402   // lock, the object could not be rebiased toward another thread, so
1403   // the bias bit would be clear.
1404   movptr(temp_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
1405   andptr(temp_reg, markOopDesc::biased_lock_mask_in_place);
1406   cmpptr(temp_reg, markOopDesc::biased_lock_pattern);
1407   jcc(Assembler::equal, done);
1408 }


src/cpu/x86/vm/macroAssembler_x86.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File