Bug 849014 - Check type inference before optimizing regexp calls. r=sstangl a=lsblakk
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Thu, 14 Mar 2013 13:19:46 -0700
changeset 132444 bd540c74113639eb059a713e267a400ac323a238
parent 132443 b9e57236174cb08af7dee7c6175219ccdfc30026
child 132445 b01807d9550e5e61d769d2a02b80fefef6e50da9
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssstangl, lsblakk
bugs849014
milestone21.0a2
Bug 849014 - Check type inference before optimizing regexp calls. r=sstangl a=lsblakk
js/src/ion/MCallOptimize.cpp
--- a/js/src/ion/MCallOptimize.cpp
+++ b/js/src/ion/MCallOptimize.cpp
@@ -845,16 +845,19 @@ IonBuilder::inlineRegExpTest(CallInfo &c
         return InliningStatus_NotInlined;
 
     // TI can infer a NULL return type of regexp_test with eager compilation.
     if (CallResultEscapes(pc) && getInlineReturnType() != MIRType_Boolean)
         return InliningStatus_NotInlined;
 
     if (getInlineThisType(callInfo) != MIRType_Object)
         return InliningStatus_NotInlined;
+    Class *clasp = getInlineThisTypeSet(callInfo)->getKnownClass();
+    if (clasp != &RegExpClass)
+        return InliningStatus_NotInlined;
     if (getInlineArgType(callInfo, 0) != MIRType_String)
         return InliningStatus_NotInlined;
 
     callInfo.unwrapArgs();
 
     MInstruction *match = MRegExpTest::New(callInfo.thisArg(), callInfo.getArg(0));
     current->add(match);
     current->push(match);