src/share/vm/opto/library_call.cpp

changeset 9703
2fdf635bcf28
parent 9572
624a0741915c
parent 9649
b2000ea410b0
child 9756
2be326848943
equal deleted inserted replaced
9647:42d198677884 9703:2fdf635bcf28
2606 Node* adr; 2606 Node* adr;
2607 Node* heap_base_oop = top(); 2607 Node* heap_base_oop = top();
2608 Node* offset = top(); 2608 Node* offset = top();
2609 Node* val; 2609 Node* val;
2610 2610
2611 // The base is either a Java object or a value produced by Unsafe.staticFieldBase
2612 Node* base = argument(1); // type: oop
2613
2611 if (!is_native_ptr) { 2614 if (!is_native_ptr) {
2612 // The base is either a Java object or a value produced by Unsafe.staticFieldBase
2613 Node* base = argument(1); // type: oop
2614 // The offset is a value produced by Unsafe.staticFieldOffset or Unsafe.objectFieldOffset 2615 // The offset is a value produced by Unsafe.staticFieldOffset or Unsafe.objectFieldOffset
2615 offset = argument(2); // type: long 2616 offset = argument(2); // type: long
2616 // We currently rely on the cookies produced by Unsafe.xxxFieldOffset 2617 // We currently rely on the cookies produced by Unsafe.xxxFieldOffset
2617 // to be plain byte offsets, which are also the same as those accepted 2618 // to be plain byte offsets, which are also the same as those accepted
2618 // by oopDesc::field_base. 2619 // by oopDesc::field_base.
2628 ptr = ConvL2X(ptr); // adjust Java long to machine word 2629 ptr = ConvL2X(ptr); // adjust Java long to machine word
2629 adr = make_unsafe_address(NULL, ptr); 2630 adr = make_unsafe_address(NULL, ptr);
2630 val = is_store ? argument(3) : NULL; 2631 val = is_store ? argument(3) : NULL;
2631 } 2632 }
2632 2633
2633 // Can base be NULL? Otherwise, always on-heap access. 2634 if ((_gvn.type(base)->isa_ptr() == TypePtr::NULL_PTR) && type == T_OBJECT) {
2634 bool can_access_non_heap = TypePtr::NULL_PTR->higher_equal(_gvn.type(heap_base_oop));
2635 if (can_access_non_heap && type == T_OBJECT) {
2636 return false; // off-heap oop accesses are not supported 2635 return false; // off-heap oop accesses are not supported
2637 } 2636 }
2638 2637
2639 const TypePtr *adr_type = _gvn.type(adr)->isa_ptr(); 2638 const TypePtr *adr_type = _gvn.type(adr)->isa_ptr();
2640 2639

mercurial