316 // Make sure method is native and not abstract
317 assert(method->is_native() && !method->is_abstract(), "should be");
318
319 JavaThread *thread = THREAD;
320 ZeroStack *stack = thread->zero_stack();
321
322 // Allocate and initialize our frame
323 InterpreterFrame *frame = InterpreterFrame::build(method, CHECK_0);
324 thread->push_zero_frame(frame);
325 interpreterState istate = frame->interpreter_state();
326 intptr_t *locals = istate->locals();
327
328 // Lock if necessary
329 BasicObjectLock *monitor;
330 monitor = NULL;
331 if (method->is_synchronized()) {
332 monitor = (BasicObjectLock*) istate->stack_base();
333 oop lockee = monitor->obj();
334 markWord disp = lockee->mark().set_unlocked();
335 monitor->lock()->set_displaced_header(disp);
336 bool call_vm = UseHeavyMonitors;
337 if (call_vm || lockee->cas_set_mark(markWord::from_pointer(monitor), disp) != disp) {
338 // Is it simple recursive case?
339 if (!call_vm && thread->is_lock_owned((address) disp.clear_lock_bits().to_pointer())) {
340 monitor->lock()->set_displaced_header(markWord::from_pointer(NULL));
341 } else {
342 CALL_VM_NOCHECK(InterpreterRuntime::monitorenter(thread, monitor));
343 if (HAS_PENDING_EXCEPTION)
344 goto unwind_and_return;
345 }
346 }
347 }
348
349 // Get the signature handler
350 InterpreterRuntime::SignatureHandler *handler; {
351 address handlerAddr = method->signature_handler();
352 if (handlerAddr == NULL) {
353 CALL_VM_NOCHECK(InterpreterRuntime::prepare_native_call(thread, method));
354 if (HAS_PENDING_EXCEPTION)
355 goto unlock_unwind_and_return;
356
|
316 // Make sure method is native and not abstract
317 assert(method->is_native() && !method->is_abstract(), "should be");
318
319 JavaThread *thread = THREAD;
320 ZeroStack *stack = thread->zero_stack();
321
322 // Allocate and initialize our frame
323 InterpreterFrame *frame = InterpreterFrame::build(method, CHECK_0);
324 thread->push_zero_frame(frame);
325 interpreterState istate = frame->interpreter_state();
326 intptr_t *locals = istate->locals();
327
328 // Lock if necessary
329 BasicObjectLock *monitor;
330 monitor = NULL;
331 if (method->is_synchronized()) {
332 monitor = (BasicObjectLock*) istate->stack_base();
333 oop lockee = monitor->obj();
334 markWord disp = lockee->mark().set_unlocked();
335 monitor->lock()->set_displaced_header(disp);
336 bool call_vm = (LockingMode == LM_MONITOR);
337 if (call_vm || lockee->cas_set_mark(markWord::from_pointer(monitor), disp) != disp) {
338 // Is it simple recursive case?
339 if (!call_vm && thread->is_lock_owned((address) disp.clear_lock_bits().to_pointer())) {
340 monitor->lock()->set_displaced_header(markWord::from_pointer(NULL));
341 } else {
342 CALL_VM_NOCHECK(InterpreterRuntime::monitorenter(thread, monitor));
343 if (HAS_PENDING_EXCEPTION)
344 goto unwind_and_return;
345 }
346 }
347 }
348
349 // Get the signature handler
350 InterpreterRuntime::SignatureHandler *handler; {
351 address handlerAddr = method->signature_handler();
352 if (handlerAddr == NULL) {
353 CALL_VM_NOCHECK(InterpreterRuntime::prepare_native_call(thread, method));
354 if (HAS_PENDING_EXCEPTION)
355 goto unlock_unwind_and_return;
356
|