From 2cf6126bd9f8af945a1e1922c79e020ef14873e9 Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Fri, 19 Dec 2014 17:49:15 -0800 Subject: [PATCH] Don't assign methodInfo to the function object, which has resolve hooks. --- runtime.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/runtime.ts b/runtime.ts index be12d1ed..0d43a774 100644 --- a/runtime.ts +++ b/runtime.ts @@ -31,6 +31,7 @@ module J2ME { export var timeline; export var nativeCounter = new Metrics.Counter(true); export var runtimeCounter = new Metrics.Counter(true); + export var jitMethodInfos = {}; if (typeof Shumway !== "undefined") { timeline = new Shumway.Tools.Profiler.TimelineBuffer("Runtime"); @@ -450,7 +451,9 @@ module J2ME { * Bailout callback whenever a JIT frame is unwound. */ B(bci: number, local: any [], stack: any []) { - $.ctx.bailout((arguments.callee.caller).methodInfo, bci, local, stack); + var methodInfo = jitMethodInfos[(arguments.callee.caller).name]; + release || assert(methodInfo !== undefined); + $.ctx.bailout(methodInfo, bci, local, stack); } yield() { @@ -1047,6 +1050,9 @@ module J2ME { if (!traceWriter) { linkWriter && linkWriter.outdent(); } + // Save method info so that we can figure out where we are bailing + // out from. + jitMethodInfos[fn.name] = methodInfo; updateGlobalObject = false; } else { linkWriter && linkWriter.warnLn("Method: " + methodDescription + " -> Interpreter"); @@ -1055,10 +1061,6 @@ module J2ME { } } - // Save method info on the function object so that we can figure out where we are - // bailing out from. - fn.methodInfo = methodInfo; - if (false && timeline) { fn = profilingWrapper(fn, methodInfo, methodType); updateGlobalObject = true; @@ -1385,4 +1387,4 @@ var $ME = function monitorEnter(object: J2ME.java.lang.Object) { var $MX = function monitorExit(object: J2ME.java.lang.Object) { console.info("EXIT " + J2ME.toDebugString(object)); $.ctx.monitorExit(object); -}; \ No newline at end of file +};