Merge.
authorAndreas Gal <gal@mozilla.com>
Mon, 29 Dec 2008 15:30:54 -0800
changeset 23229 a2d17feae1836b45d31816e31fd079e1fbdad1d9
parent 23227 714208fb0f2177274251c8a26b650de19ddf765e (current diff)
parent 23228 083a9f80c6cec969735f6154a56048ea999a3819 (diff)
child 23230 d0e8862aa513f3509a176006ef2bf43f6d3120a4
child 23231 8f8a4b924c32be6697d12e3b3cbe527f7beab2ac
push id4405
push userrsayre@mozilla.com
push dateThu, 01 Jan 2009 22:27:02 +0000
treeherdermozilla-central@5a1e6eac685c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.2a1pre
Merge.
js/src/jstracer.cpp
--- a/js/src/jsstr.cpp
+++ b/js/src/jsstr.cpp
@@ -1465,16 +1465,27 @@ String_p_match(JSContext* cx, JSString* 
 {
     /* arbitrary object in vp[0] */
     jsval vp[3] = { OBJECT_TO_JSVAL(regexp), STRING_TO_JSVAL(str), OBJECT_TO_JSVAL(regexp) };
     if (!StringMatchHelper(cx, 1, vp, pc))
         return JSVAL_ERROR_COOKIE;
     JS_ASSERT(JSVAL_IS_OBJECT(vp[0]));
     return vp[0];
 }
+
+static jsval FASTCALL
+String_p_match_obj(JSContext* cx, JSObject* str, jsbytecode *pc, JSObject* regexp)
+{
+    /* arbitrary object in vp[0] */
+    jsval vp[3] = { OBJECT_TO_JSVAL(regexp), OBJECT_TO_JSVAL(str), OBJECT_TO_JSVAL(regexp) };
+    if (!StringMatchHelper(cx, 1, vp, pc))
+        return JSVAL_ERROR_COOKIE;
+    JS_ASSERT(JSVAL_IS_OBJECT(vp[0]));
+    return vp[0];
+}
 #endif
 
 static JSBool
 str_search(JSContext *cx, uintN argc, jsval *vp)
 {
     GlobData data;
 
     data.flags = MODE_SEARCH;
@@ -2491,18 +2502,19 @@ JS_DEFINE_TRCINFO_1(str_charAt,
     (3, (extern, STRING_FAIL,      js_String_getelem, CONTEXT, THIS_STRING, INT32,           1, 1)))
 JS_DEFINE_TRCINFO_1(str_charCodeAt,
     (2, (extern, INT32_FAIL,       js_String_p_charCodeAt, THIS_STRING, INT32,               1, 1)))
 JS_DEFINE_TRCINFO_4(str_concat,
     (3, (static, STRING_FAIL,      String_p_concat_1int, CONTEXT, THIS_STRING, INT32,        1, 1)),
     (3, (extern, STRING_FAIL,      js_ConcatStrings, CONTEXT, THIS_STRING, STRING,           1, 1)),
     (4, (static, STRING_FAIL,      String_p_concat_2str, CONTEXT, THIS_STRING, STRING, STRING, 1, 1)),
     (5, (static, STRING_FAIL,      String_p_concat_3str, CONTEXT, THIS_STRING, STRING, STRING, STRING, 1, 1)))
-JS_DEFINE_TRCINFO_1(str_match,
-    (4, (static, JSVAL_FAIL,       String_p_match, CONTEXT, THIS_STRING, PC, REGEXP,         1, 1)))
+JS_DEFINE_TRCINFO_2(str_match,
+    (4, (static, JSVAL_FAIL,       String_p_match, CONTEXT, THIS_STRING, PC, REGEXP,         1, 1)),
+    (4, (static, JSVAL_FAIL,       String_p_match_obj, CONTEXT, THIS, PC, REGEXP,            1, 1)))
 JS_DEFINE_TRCINFO_3(str_replace,
     (4, (static, STRING_FAIL,      String_p_replace_str, CONTEXT, THIS_STRING, REGEXP, STRING, 1, 1)),
     (4, (static, STRING_FAIL,      String_p_replace_str2, CONTEXT, THIS_STRING, STRING, STRING, 1, 1)),
     (5, (static, STRING_FAIL,      String_p_replace_str3, CONTEXT, THIS_STRING, STRING, STRING, STRING, 1, 1)))
 JS_DEFINE_TRCINFO_1(str_split,
     (3, (static, OBJECT_FAIL_NULL, String_p_split, CONTEXT, THIS_STRING, STRING,             0, 0)))
 JS_DEFINE_TRCINFO_1(str_toLowerCase,
     (2, (extern, STRING_FAIL,      js_toLowerCase, CONTEXT, THIS_STRING,                     1, 1)))
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -6090,27 +6090,19 @@ TraceRecorder::functionCall(bool constru
             argtype = known->prefix[i];
             if (argtype == 'C') {
                 *argp = cx_ins;
             } else if (argtype == 'T') {   /* this, as an object */
                 if (JSVAL_IS_PRIMITIVE(tval))
                     goto next_specialization;
                 *argp = this_ins;
             } else if (argtype == 'S') {   /* this, as a string */
-                if (JSVAL_IS_STRING(tval)) {
-                    *argp = this_ins;
-                } else if (!JSVAL_IS_PRIMITIVE(tval) && 
-                           guardClass(JSVAL_TO_OBJECT(tval), 
-                                      this_ins, 
-                                      &js_StringClass, 
-                                      MISMATCH_EXIT)) {
-                    *argp = stobj_get_fslot(this_ins, JSSLOT_PRIVATE);
-                } else {
+                if (!JSVAL_IS_STRING(tval))
                     goto next_specialization;
-                }
+                *argp = this_ins;
             } else if (argtype == 'f') {
                 *argp = INS_CONSTPTR(JSVAL_TO_OBJECT(fval));
             } else if (argtype == 'p') {
                 if (!getClassPrototype(JSVAL_TO_OBJECT(fval), *argp))
                     return false;
             } else if (argtype == 'R') {
                 *argp = INS_CONSTPTR(cx->runtime);
             } else if (argtype == 'P') {