Don't assign methodInfo to the function object, which has resolve hooks.

This commit is contained in:
Shu-yu Guo 2014-12-19 17:49:15 -08:00
Родитель 110ae2c13e
Коммит 2cf6126bd9
1 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -31,6 +31,7 @@ module J2ME {
export var timeline; export var timeline;
export var nativeCounter = new Metrics.Counter(true); export var nativeCounter = new Metrics.Counter(true);
export var runtimeCounter = new Metrics.Counter(true); export var runtimeCounter = new Metrics.Counter(true);
export var jitMethodInfos = {};
if (typeof Shumway !== "undefined") { if (typeof Shumway !== "undefined") {
timeline = new Shumway.Tools.Profiler.TimelineBuffer("Runtime"); timeline = new Shumway.Tools.Profiler.TimelineBuffer("Runtime");
@ -450,7 +451,9 @@ module J2ME {
* Bailout callback whenever a JIT frame is unwound. * Bailout callback whenever a JIT frame is unwound.
*/ */
B(bci: number, local: any [], stack: any []) { B(bci: number, local: any [], stack: any []) {
$.ctx.bailout((<any>arguments.callee.caller).methodInfo, bci, local, stack); var methodInfo = jitMethodInfos[(<any>arguments.callee.caller).name];
release || assert(methodInfo !== undefined);
$.ctx.bailout(methodInfo, bci, local, stack);
} }
yield() { yield() {
@ -1047,6 +1050,9 @@ module J2ME {
if (!traceWriter) { if (!traceWriter) {
linkWriter && linkWriter.outdent(); linkWriter && linkWriter.outdent();
} }
// Save method info so that we can figure out where we are bailing
// out from.
jitMethodInfos[fn.name] = methodInfo;
updateGlobalObject = false; updateGlobalObject = false;
} else { } else {
linkWriter && linkWriter.warnLn("Method: " + methodDescription + " -> Interpreter"); 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) { if (false && timeline) {
fn = profilingWrapper(fn, methodInfo, methodType); fn = profilingWrapper(fn, methodInfo, methodType);
updateGlobalObject = true; updateGlobalObject = true;
@ -1385,4 +1387,4 @@ var $ME = function monitorEnter(object: J2ME.java.lang.Object) {
var $MX = function monitorExit(object: J2ME.java.lang.Object) { var $MX = function monitorExit(object: J2ME.java.lang.Object) {
console.info("EXIT " + J2ME.toDebugString(object)); console.info("EXIT " + J2ME.toDebugString(object));
$.ctx.monitorExit(object); $.ctx.monitorExit(object);
}; };