Bug 538482 - |case null| deoptimizes switch statements to use condswitch. r=jorendorff
authorJeff Walden <jwalden@mit.edu>
Thu, 07 Jan 2010 17:22:22 -0600
changeset 37682 96dc5a825df7a687077d1bc6af608eca9e8b5f8e
parent 37681 fc3bc9875ca79b2b17ecf277859336b340b15340
child 37683 19e5fc57cd35f030f0c6d59016e9b19a611870a9
push idunknown
push userunknown
push dateunknown
reviewersjorendorff
bugs538482
milestone1.9.3a1pre
Bug 538482 - |case null| deoptimizes switch statements to use condswitch. r=jorendorff
js/src/jsemit.cpp
--- a/js/src/jsemit.cpp
+++ b/js/src/jsemit.cpp
@@ -3151,16 +3151,20 @@ EmitSwitch(JSContext *cx, JSCodeGenerato
                 if (pn4->pn_op == JSOP_TRUE) {
                     pn3->pn_val = JSVAL_TRUE;
                     break;
                 }
                 if (pn4->pn_op == JSOP_FALSE) {
                     pn3->pn_val = JSVAL_FALSE;
                     break;
                 }
+                if (pn4->pn_op == JSOP_NULL) {
+                    pn3->pn_val = JSVAL_NULL;
+                    break;
+                }
                 /* FALL THROUGH */
               default:
                 switchOp = JSOP_CONDSWITCH;
                 continue;
             }
 
             JS_ASSERT(JSVAL_IS_PRIMITIVE(pn3->pn_val));