DynamicMethod.NativeCall nativeCall = method.getNativeCall();
try {
Object scriptObject;
StaticScope scope = null;
if (method instanceof CompiledMethod) {
scriptObject = ((CompiledMethod)method).getScriptObject();
scope = ((CompiledMethod)method).getStaticScope();
} else if (method instanceof JittedMethod) {
scriptObject = ((JittedMethod)method).getScriptObject();