This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Test { | |
class MyLock { | |
} | |
final Object lock = new MyLock(); | |
public static void main(String[] args) { | |
new Test().test(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BiasedLocking::Condition BiasedLocking::revoke_and_rebias(Handle obj, bool attempt_rebias, TRAPS) { | |
assert(!SafepointSynchronize::is_at_safepoint(), "must not be called while at safepoint"); | |
// We can revoke the biases of anonymously-biased objects | |
// efficiently enough that we should not cause these revocations to | |
// update the heuristics because doing so may cause unwanted bulk | |
// revocations (which are expensive) to occur. | |
markOop mark = obj->mark(); | |
if (mark->is_biased_anonymously() && !attempt_rebias) { | |
// We are probably trying to revoke the bias of this object due to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* monitorenter and monitorexit for locking/unlocking an object */ | |
CASE(_monitorenter): { | |
oop lockee = STACK_OBJECT(-1); | |
// derefing's lockee ought to provoke implicit null check | |
CHECK_NULL(lockee); | |
// find a free monitor or one already allocated for this object | |
// if we find a matching object then we need a new monitor | |
// since this is recursive enter | |
BasicObjectLock* limit = istate->monitor_base(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dex-method-count() { | |
cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"' | |
} | |
function dex-method-count-by-package() { | |
dir=$(mktemp -d -t dex) | |
baksmali $1 -o $dir | |
for pkg in `find $dir/* -type d`; do | |
smali $pkg -o $pkg/classes.dex | |
count=$(dex-method-count $pkg/classes.dex) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dex-method-count() { | |
cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"' | |
} | |
function dex-method-count-by-package() { | |
dir=$(mktemp -d -t dex) | |
baksmali $1 -o $dir | |
for pkg in `find $dir/* -type d`; do | |
smali $pkg -o $pkg/classes.dex | |
count=$(dex-method-count $pkg/classes.dex) | |
name=$(echo ${pkg:(${#dir} + 1)} | tr '/' '.') |