3813 push(newcopy);
3814 }
3815
3816 C->set_has_split_ifs(true); // Has chance for split-if optimization
3817
3818 return true;
3819 }
3820
3821
3822 //----------------------generate_virtual_guard---------------------------
3823 // Helper for hashCode and clone. Peeks inside the vtable to avoid a call.
3824 Node* LibraryCallKit::generate_virtual_guard(Node* obj_klass,
3825 RegionNode* slow_region) {
3826 ciMethod* method = callee();
3827 int vtable_index = method->vtable_index();
3828 // Get the Method* out of the appropriate vtable entry.
3829 int entry_offset = (InstanceKlass::vtable_start_offset() +
3830 vtable_index*vtableEntry::size()) * wordSize +
3831 vtableEntry::method_offset_in_bytes();
3832 Node* entry_addr = basic_plus_adr(obj_klass, entry_offset);
3833 Node* target_call = make_load(NULL, entry_addr, TypeInstPtr::NOTNULL, T_OBJECT);
3834
3835 // Compare the target method with the expected method (e.g., Object.hashCode).
3836 const TypePtr* native_call_addr = TypeMetadataPtr::make(method);
3837
3838 Node* native_call = makecon(native_call_addr);
3839 Node* chk_native = _gvn.transform( new(C) CmpPNode(target_call, native_call) );
3840 Node* test_native = _gvn.transform( new(C) BoolNode(chk_native, BoolTest::ne) );
3841
3842 return generate_slow_guard(test_native, slow_region);
3843 }
3844
3845 //-----------------------generate_method_call----------------------------
3846 // Use generate_method_call to make a slow-call to the real
3847 // method if the fast path fails. An alternative would be to
3848 // use a stub like OptoRuntime::slow_arraycopy_Java.
3849 // This only works for expanding the current library call,
3850 // not another intrinsic. (E.g., don't use this for making an
3851 // arraycopy call inside of the copyOf intrinsic.)
3852 CallJavaNode*
3853 LibraryCallKit::generate_method_call(vmIntrinsics::ID method_id, bool is_virtual, bool is_static) {
|
3813 push(newcopy);
3814 }
3815
3816 C->set_has_split_ifs(true); // Has chance for split-if optimization
3817
3818 return true;
3819 }
3820
3821
3822 //----------------------generate_virtual_guard---------------------------
3823 // Helper for hashCode and clone. Peeks inside the vtable to avoid a call.
3824 Node* LibraryCallKit::generate_virtual_guard(Node* obj_klass,
3825 RegionNode* slow_region) {
3826 ciMethod* method = callee();
3827 int vtable_index = method->vtable_index();
3828 // Get the Method* out of the appropriate vtable entry.
3829 int entry_offset = (InstanceKlass::vtable_start_offset() +
3830 vtable_index*vtableEntry::size()) * wordSize +
3831 vtableEntry::method_offset_in_bytes();
3832 Node* entry_addr = basic_plus_adr(obj_klass, entry_offset);
3833 Node* target_call = make_load(NULL, entry_addr, TypePtr::NOTNULL, T_ADDRESS);
3834
3835 // Compare the target method with the expected method (e.g., Object.hashCode).
3836 const TypePtr* native_call_addr = TypeMetadataPtr::make(method);
3837
3838 Node* native_call = makecon(native_call_addr);
3839 Node* chk_native = _gvn.transform( new(C) CmpPNode(target_call, native_call) );
3840 Node* test_native = _gvn.transform( new(C) BoolNode(chk_native, BoolTest::ne) );
3841
3842 return generate_slow_guard(test_native, slow_region);
3843 }
3844
3845 //-----------------------generate_method_call----------------------------
3846 // Use generate_method_call to make a slow-call to the real
3847 // method if the fast path fails. An alternative would be to
3848 // use a stub like OptoRuntime::slow_arraycopy_Java.
3849 // This only works for expanding the current library call,
3850 // not another intrinsic. (E.g., don't use this for making an
3851 // arraycopy call inside of the copyOf intrinsic.)
3852 CallJavaNode*
3853 LibraryCallKit::generate_method_call(vmIntrinsics::ID method_id, bool is_virtual, bool is_static) {
|