22 * |
22 * |
23 */ |
23 */ |
24 |
24 |
25 #include "precompiled.hpp" |
25 #include "precompiled.hpp" |
26 #include "asm/macroAssembler.hpp" |
26 #include "asm/macroAssembler.hpp" |
|
27 #include "ci/ciUtilities.inline.hpp" |
27 #include "classfile/systemDictionary.hpp" |
28 #include "classfile/systemDictionary.hpp" |
28 #include "classfile/vmSymbols.hpp" |
29 #include "classfile/vmSymbols.hpp" |
29 #include "compiler/compileBroker.hpp" |
30 #include "compiler/compileBroker.hpp" |
30 #include "compiler/compileLog.hpp" |
31 #include "compiler/compileLog.hpp" |
31 #include "memory/resourceArea.hpp" |
32 #include "memory/resourceArea.hpp" |
2406 Node* base = argument(1); // type: oop |
2407 Node* base = argument(1); // type: oop |
2407 // The offset is a value produced by Unsafe.staticFieldOffset or Unsafe.objectFieldOffset |
2408 // The offset is a value produced by Unsafe.staticFieldOffset or Unsafe.objectFieldOffset |
2408 offset = argument(2); // type: long |
2409 offset = argument(2); // type: long |
2409 // We currently rely on the cookies produced by Unsafe.xxxFieldOffset |
2410 // We currently rely on the cookies produced by Unsafe.xxxFieldOffset |
2410 // to be plain byte offsets, which are also the same as those accepted |
2411 // to be plain byte offsets, which are also the same as those accepted |
2411 // by oopDesc::field_base. |
2412 // by oopDesc::field_addr. |
2412 assert(Unsafe_field_offset_to_byte_offset(11) == 11, |
2413 assert(Unsafe_field_offset_to_byte_offset(11) == 11, |
2413 "fieldOffset must be byte-scaled"); |
2414 "fieldOffset must be byte-scaled"); |
2414 // 32-bit machines ignore the high half! |
2415 // 32-bit machines ignore the high half! |
2415 offset = ConvL2X(offset); |
2416 offset = ConvL2X(offset); |
2416 adr = make_unsafe_address(base, offset, type, kind == Relaxed); |
2417 adr = make_unsafe_address(base, offset, type, kind == Relaxed); |
2837 } |
2838 } |
2838 |
2839 |
2839 // Build field offset expression. |
2840 // Build field offset expression. |
2840 // We currently rely on the cookies produced by Unsafe.xxxFieldOffset |
2841 // We currently rely on the cookies produced by Unsafe.xxxFieldOffset |
2841 // to be plain byte offsets, which are also the same as those accepted |
2842 // to be plain byte offsets, which are also the same as those accepted |
2842 // by oopDesc::field_base. |
2843 // by oopDesc::field_addr. |
2843 assert(Unsafe_field_offset_to_byte_offset(11) == 11, "fieldOffset must be byte-scaled"); |
2844 assert(Unsafe_field_offset_to_byte_offset(11) == 11, "fieldOffset must be byte-scaled"); |
2844 // 32-bit machines ignore the high half of long offsets |
2845 // 32-bit machines ignore the high half of long offsets |
2845 offset = ConvL2X(offset); |
2846 offset = ConvL2X(offset); |
2846 Node* adr = make_unsafe_address(base, offset, type, false); |
2847 Node* adr = make_unsafe_address(base, offset, type, false); |
2847 const TypePtr *adr_type = _gvn.type(adr)->isa_ptr(); |
2848 const TypePtr *adr_type = _gvn.type(adr)->isa_ptr(); |