SUGGESTED FIX
- #pragma ident "@(#)generateOptoStub.cpp 1.84 04/02/04 17:34:30 JVM"
+ #pragma ident "@(#)generateOptoStub.cpp 1.85 04/06/08 13:02:38 JVM"
#endif
//
// Copyright 2004 Sun Microsystems, Inc. All rights reserved.
// SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
//
#include "incls/_precompiled.incl"
#include "incls/_generateOptoStub.cpp.incl"
//-----------------------plus_adr----------------------------------------------
*** 93,112 ****
--- 93,119 ----
static_klass = method->holder();
ciInstance* mirror = static_klass->java_mirror();
mirror_node = makecon(TypeInstPtr::make(mirror));
assert(jni_sig, "sanity");
// Static JNI calls pass the static_klass mirror. They need it
// boxed. The box has to update the stack prior to setting
// thread_in_native in order to be GC safe.
mirror_box = _gvn.transform( new (2) BoxNode(mirror_node) );
}
+ // Call jvmpi before we wrap incoming arguments so we can
+ // pass the receiver as an oop and not a handle.
+
+ if (C->need_jvmpi_method_event()) {
+ make_jvmpi_method_entry();
+ }
+
// Do we need to wrap incoming arguments in handles?
// Generate code to put the oop on the stack and return its address.
Node *unwrapped_this = map()->in(TypeFunc::Parms+0);
Node** parm_boxes = NULL;
uint num_parm_boxes = 0;
if( wrap_oops ) {
parm_boxes = NEW_RESOURCE_ARRAY(Node*, parm_cnt); // generous, OK!
for( i = TypeFunc::Parms; i < parm_cnt; i++ ) {
if (jdomain->field_at(i)->isa_oop_ptr()) {
// Replace parameter with handle
*** 129,151 ****
--- 136,155 ----
// with a conditional-move, the c-mov represents a normal use
// along the main path and so unavoidably hoists the BoxNode.
Node* cmp = _gvn.transform( new (3) CmpPNode(map()->in(i), null()) );
Node* b = _gvn.transform( new (2) BoolNode(cmp, BoolTest::eq) );
Node* cmov = _gvn.transform( CMoveNode::make(NULL, b, box, map()->in(i), TypeRawPtr::BOTTOM) );
map()->set_req( i, cmov );
}
}
}
if (C->need_jvmpi_method_event()) {
make_jvmpi_method_entry();
}
Node* flock_obj = NULL;
Node* flock_obj_box = NULL;
FastLockNode* flock = NULL;
// Do we need to lock argument 0? Is this a synchronized native call?
if (method != NULL && method->flags().is_synchronized()) {
// Lock either the class-mirror or the regular 'this' pointer
flock_obj = static_klass ? mirror_node : unwrapped_this;
flock_obj_box = static_klass ? mirror_box : parm_boxes[0];
flock = shared_lock(flock_obj);
|