Index: vm/jitrino/src/codegenerator/ia32/Ia32BBPolling.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32BBPolling.cpp (revision 538118) +++ vm/jitrino/src/codegenerator/ia32/Ia32BBPolling.cpp (working copy) @@ -393,14 +393,17 @@ if (!ri) { return false; } else { - if ( ri->getKind() == Opnd::RuntimeInfo::Kind_HelperAddress ) { - return true; - } if ( ri->getKind() == Opnd::RuntimeInfo::Kind_MethodDirectAddr && ((MethodDesc*)ri->getValue(0))->isNative() ) { return true; } + CompilationInterface* ci = CompilationContext::getCurrentContext()->getVMCompilationInterface(); + if ( ri->getKind() == Opnd::RuntimeInfo::Kind_HelperAddress && + ci->isInterruptiblePoint((CompilationInterface::RuntimeHelperId)(POINTER_SIZE_INT)ri->getValue(0)) ) + { + return true; + } } } return false; Index: vm/jitrino/src/vm/drl/DrlVMInterface.cpp =================================================================== --- vm/jitrino/src/vm/drl/DrlVMInterface.cpp (revision 538118) +++ vm/jitrino/src/vm/drl/DrlVMInterface.cpp (working copy) @@ -570,7 +570,13 @@ return vm_helper_is_gc_interruptible(drlHelperId); } +bool +CompilationInterface::isInterruptiblePoint(RuntimeHelperId runtimeHelperId) { + VM_RT_SUPPORT drlHelperId = translateHelperId(runtimeHelperId); + return vm_helper_is_interruptible(drlHelperId); +} + bool CompilationInterface::compileMethod(MethodDesc *method) { if (Log::isEnabled()) { Index: vm/include/jit_runtime_support.h =================================================================== --- vm/include/jit_runtime_support.h (revision 538118) +++ vm/include/jit_runtime_support.h (working copy) @@ -622,6 +622,13 @@ * Checks if helper is a suspension point */ +VMEXPORT Boolean vm_helper_is_interruptible(VM_RT_SUPPORT f); + + +/** + * Checks if helper may be suspended by gc + */ + VMEXPORT Boolean vm_helper_is_gc_interruptible(VM_RT_SUPPORT f); Index: vm/vmcore/src/jit/jit_runtime_support.cpp =================================================================== --- vm/vmcore/src/jit/jit_runtime_support.cpp (revision 538118) +++ vm/vmcore/src/jit/jit_runtime_support.cpp (working copy) @@ -1991,6 +1991,27 @@ * Checks if helper is a suspension point */ +VMEXPORT Boolean vm_helper_is_interruptible(VM_RT_SUPPORT f) +{ +// monitor helpers are NOT suspendable when they executes _fast_path_ +// so suspension can not be guaranteed for these helpers +switch(f) { + case VM_RT_MONITOR_ENTER: + case VM_RT_MONITOR_ENTER_NON_NULL: + case VM_RT_MONITOR_ENTER_STATIC: + case VM_RT_MONITOR_EXIT: + case VM_RT_MONITOR_EXIT_NON_NULL: + case VM_RT_MONITOR_EXIT_STATIC: + return FALSE; + default: + return vm_helper_is_gc_interruptible(f); + } +} + +/** + * Checks if helper may be suspended by gc + */ + VMEXPORT Boolean vm_helper_is_gc_interruptible(VM_RT_SUPPORT f) { switch(f) {