Bug 692911: Delete useless call to target->addType in js::types::TypeConstraintSubsetBarrier::newType. r=bhackett
authorJim Blandy <jimb@mozilla.com>
Fri, 07 Oct 2011 15:08:56 -0700
changeset 78363 6576946586f4c7cdcf5627b75bc5b544f5994db1
parent 78362 e27c6941c34059b13b555c2cf3903ff74e0eb27b
child 78364 f1f27d2354dad13aab16d0291ecee08fce3ba765
push id2505
push userjblandy@mozilla.com
push dateFri, 07 Oct 2011 22:09:27 +0000
treeherdermozilla-inbound@6576946586f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs692911
milestone10.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 692911: Delete useless call to target->addType in js::types::TypeConstraintSubsetBarrier::newType. r=bhackett js::types::TypeConstraintSubsetBarrier::newType calls 'target->hasType(type)', and if that returns true, calls 'target->addType(cx, type)'. That second call should have no effect: it just adds to target a type that it already has. This patch deletes the call to target->addType.
js/src/jsinfer.cpp
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -869,22 +869,18 @@ public:
     TypeSet *target;
 
     TypeConstraintSubsetBarrier(JSScript *script, jsbytecode *pc, TypeSet *target)
         : TypeConstraint("subsetBarrier"), script(script), pc(pc), target(target)
     {}
 
     void newType(JSContext *cx, TypeSet *source, Type type)
     {
-        if (!target->hasType(type)) {
+        if (!target->hasType(type))
             script->analysis()->addTypeBarrier(cx, pc, target, type);
-            return;
-        }
-
-        target->addType(cx, type);
     }
 };
 
 void
 TypeSet::addSubsetBarrier(JSContext *cx, JSScript *script, jsbytecode *pc, TypeSet *target)
 {
     add(cx, cx->typeLifoAlloc().new_<TypeConstraintSubsetBarrier>(script, pc, target));
 }