comparison src/cpu/x86/vm/sharedRuntime_x86_64.cpp @ 6517:2dfab5607b3d

fix hashCode changes: port to x64
author Lukas Stadler <lukas.stadler@jku.at>
date Fri, 05 Oct 2012 13:44:26 +0200
parents 957c266d8bc5
children ea845fd3c820
comparison
equal deleted inserted replaced
6516:174805dea3fc 6517:2dfab5607b3d
1967 1967
1968 __ bind(hit); 1968 __ bind(hit);
1969 1969
1970 int vep_offset = ((intptr_t)__ pc()) - start; 1970 int vep_offset = ((intptr_t)__ pc()) - start;
1971 1971
1972 #ifdef GRAAL
1973 if (InlineObjectHash && method->intrinsic_id() == vmIntrinsics::_hashCode) {
1974 // Object.hashCode can pull the hashCode from the header word
1975 // instead of doing a full VM transition once it's been computed.
1976 // Since hashCode is usually polymorphic at call sites we can't do
1977 // this optimization at the call site without a lot of work.
1978 Label slowCase;
1979 Register result = rax;
1980
1981 __ movptr(result, Address(receiver, oopDesc::mark_offset_in_bytes()));
1982
1983 // check if locked
1984 __ testptr(result, markOopDesc::unlocked_value);
1985 __ jcc (Assembler::zero, slowCase);
1986
1987 if (UseBiasedLocking) {
1988 // Check if biased and fall through to runtime if so
1989 __ testptr(result, markOopDesc::biased_lock_bit_in_place);
1990 __ jcc (Assembler::notZero, slowCase);
1991 }
1992
1993 // get hash
1994 __ shrptr(result, markOopDesc::hash_shift);
1995 __ andptr(result, markOopDesc::hash_mask);
1996 // test if hashCode exists
1997 __ jcc (Assembler::zero, slowCase);
1998 __ ret(0);
1999
2000 __ bind (slowCase);
2001 }
2002 #endif // GRAAL
2003
1972 // The instruction at the verified entry point must be 5 bytes or longer 2004 // The instruction at the verified entry point must be 5 bytes or longer
1973 // because it can be patched on the fly by make_non_entrant. The stack bang 2005 // because it can be patched on the fly by make_non_entrant. The stack bang
1974 // instruction fits that requirement. 2006 // instruction fits that requirement.
1975 2007
1976 // Generate stack overflow check 2008 // Generate stack overflow check