From 9b56ca49843e8de24033bbbb2a77d83c5be641b2 Mon Sep 17 00:00:00 2001 From: Brendan Eich Date: Thu, 21 Aug 2008 00:19:04 -0700 Subject: [PATCH] Tidy up globalShape mismatch reporting. --- js/src/jstracer.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 64daff4e061..1fb5c9d360e 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -1726,9 +1726,11 @@ bool js_RecordTree(JSContext* cx, JSTraceMonitor* tm, Fragment* f) { /* Make sure the global type map didn't change on us. */ - if (OBJ_SCOPE(JS_GetGlobalForObject(cx, cx->fp->scopeChain))->shape != tm->globalShape) { + uint32 globalShape = OBJ_SCOPE(JS_GetGlobalForObject(cx, cx->fp->scopeChain))->shape; + if (tm->globalShape != globalShape) { + debug_only(printf("Global shape mismatch (%u vs. %u) in RecordTree, flushing cache.\n", + globalShape, tm->globalShape);) js_FlushJITCache(cx); - debug_only(printf("Global shape mismatch in RecordTree, flushing cache.\n");) return false; } TypeMap current; @@ -1916,10 +1918,11 @@ js_ExecuteTree(JSContext* cx, Fragment** treep, uintN& inlineCallCount, the global type map must remain applicable at all times (we expect absolute type stability for globals). */ if (ngslots && - ((OBJ_SCOPE(globalObj)->shape != tm->globalShape) || + (OBJ_SCOPE(globalObj)->shape != tm->globalShape || !BuildNativeGlobalFrame(cx, ngslots, gslots, tm->globalTypeMap->data(), global))) { AUDIT(globalShapeMismatchAtEntry); - debug_only_v(printf("global shape mismatch, flushing cache.\n")); + debug_only_v(printf("Global shape mismatch (%u vs. %u), flushing cache.\n", + OBJ_SCOPE(globalObj)->shape, tm->globalShape);) const void* ip = f->ip; js_FlushJITCache(cx); *treep = tm->fragmento->newLoop(ip);