From: Jeff Walden <jwalden@mit.edu>
Date: Tue, 13 Apr 2010 13:34:31 -0700
Subject: Bug 558541 - Simplify some code in js_SetPropertyHelper to make it more understandable. r=jorendorff, a=blocking1.9.1.17

---
 js/src/jsobj.cpp |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp
index 857ba8a..78a577a 100644
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -4468,6 +4468,12 @@ js_SetPropertyHelper(JSContext *cx, JSObject *obj, jsid id, JSBool cacheResult,
             (SCOPE_IS_SEALED(scope) && (attrs & JSPROP_SHARED))) {
             JS_UNLOCK_SCOPE(cx, scope);
 
+            PCMETER(cacheResult && JS_PROPERTY_CACHE(cx).rofills++);
+            if (cacheResult) {
+                JS_ASSERT_NOT_ON_TRACE(cx);
+                TRACE_2(SetPropHit, JS_NO_PROP_CACHE_FILL, sprop);
+            }
+
             /*
              * Here, we'll either return true or goto read_only_error, which
              * reports a strict warning or throws an error.  So we redefine
@@ -4480,18 +4486,18 @@ js_SetPropertyHelper(JSContext *cx, JSObject *obj, jsid id, JSBool cacheResult,
             if (attrs & JSPROP_READONLY) {
                 if (!JS_HAS_STRICT_OPTION(cx)) {
                     /* Just return true per ECMA if not in strict mode. */
-                    PCMETER(cacheResult && JS_PROPERTY_CACHE(cx).rofills++);
-                    if (cacheResult)
-                        TRACE_2(SetPropHit, JS_NO_PROP_CACHE_FILL, sprop);
                     return JS_TRUE;
-                error: // TRACE_2 jumps here in case of error.
-                    return JS_FALSE;
                 }
 
                 /* Strict mode: report a read-only strict warning. */
                 flags = JSREPORT_STRICT | JSREPORT_WARNING;
             }
             goto read_only_error;
+
+#ifdef JS_TRACER
+          error: // TRACE_2 jumps here in case of error.
+            return JS_FALSE;
+#endif
         }
 
         if (pobj != obj) {
