Bug 1477621 - Part 0: Remove unnecessary note from JSOP_DEFAULT. r=jandem
authorTooru Fujisawa <arai_a@mac.com>
Wed, 25 Jul 2018 17:01:48 +0900
changeset 428282 4f8e23bff248c7500302deb4b68804bbafbc462b
parent 428281 d8f622781168eed6fb5e1245a92af56936b0a7f0
child 428283 5f7b22fe0124b332ea410e44b94afa11d29b254a
push id34327
push userarchaeopteryx@coole-files.de
push dateWed, 25 Jul 2018 14:18:02 +0000
treeherdermozilla-central@fa78cd1a6880 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1477621
milestone63.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 1477621 - Part 0: Remove unnecessary note from JSOP_DEFAULT. r=jandem
js/src/frontend/SwitchEmitter.cpp
--- a/js/src/frontend/SwitchEmitter.cpp
+++ b/js/src/frontend/SwitchEmitter.cpp
@@ -219,29 +219,29 @@ SwitchEmitter::emitTable(const TableGene
     return true;
 }
 
 bool
 SwitchEmitter::emitCaseOrDefaultJump(uint32_t caseIndex, bool isDefault)
 {
     MOZ_ASSERT(kind_ == Kind::Cond);
 
-    if (state_ == State::Case) {
-        // Link the last JSOP_CASE's SRC_NEXTCASE to current JSOP_CASE or
-        // JSOP_DEFAULT for the benefit of IonBuilder.
-        if (!bce_->setSrcNoteOffset(caseNoteIndex_, 0, bce_->offset() - lastCaseOffset_))
-            return false;
-    }
-
     if (isDefault) {
         if (!bce_->emitJump(JSOP_DEFAULT, &condSwitchDefaultOffset_))
             return false;
         return true;
     }
 
+    if (state_ == State::Case) {
+        // Link the last JSOP_CASE's SRC_NEXTCASE to current JSOP_CASE for the
+        // benefit of IonBuilder.
+        if (!bce_->setSrcNoteOffset(caseNoteIndex_, 0, bce_->offset() - lastCaseOffset_))
+            return false;
+    }
+
     if (!bce_->newSrcNote2(SRC_NEXTCASE, 0, &caseNoteIndex_))
         return false;
 
     JumpList caseJump;
     if (!bce_->emitJump(JSOP_CASE, &caseJump))
         return false;
     caseOffsets_[caseIndex] = caseJump.offset;
     lastCaseOffset_ = caseJump.offset;