Ignore:
Timestamp:
Jan 27, 2014, 8:04:45 PM (11 years ago)
Author:
Joseph Pecoraro
Message:

JavaScriptCore: Enable -Wimplicit-fallthrough and add FALLTHROUGH annotation where needed
https://bugs.webkit.org/show_bug.cgi?id=127647

Reviewed by Anders Carlsson.

Explicitly annotate switch case fallthroughs in JavaScriptCore and
enable warnings for unannotated fallthroughs.

  • dfg/DFGArithMode.h:

(doesOverflow):
Only insert FALLTHROUGH in release builds. In debug builds, the
FALLTHROUGH would be unreachable (due to the ASSERT_NOT_REACHED)
and would through a warning.

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal):
(JSC::DFG::SpeculativeJIT::fillSpeculateInt52):
Due to the templatized nature of this function, a fallthrough
in one of the template expansions would be unreachable. Disable
the warning for this function.

  • Configurations/Base.xcconfig:
  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):

  • dfg/DFGCFGSimplificationPhase.cpp:

(JSC::DFG::CFGSimplificationPhase::run):

  • dfg/DFGValidate.cpp:

(JSC::DFG::Validate::validateCPS):

  • parser/Lexer.cpp:

(JSC::Lexer<T>::lex):

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parseStatement):
(JSC::Parser<LexerType>::parseProperty):

  • runtime/JSArray.cpp:

(JSC::JSArray::push):

  • runtime/JSONObject.cpp:

(JSC::Walker::walk):

  • runtime/JSObject.cpp:

(JSC::JSObject::putByIndex):
(JSC::JSObject::putByIndexBeyondVectorLength):

  • runtime/JSObject.h:

(JSC::JSObject::setIndexQuickly):
(JSC::JSObject::initializeIndex):

  • runtime/LiteralParser.cpp:

(JSC::LiteralParser<CharType>::parse):

  • yarr/YarrInterpreter.cpp:

(JSC::Yarr::Interpreter::backtrackParenthesesOnceBegin):
(JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):

  • yarr/YarrParser.h:

(JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacter):
(JSC::Yarr::Parser::CharacterClassParserDelegate::atomBuiltInCharacterClass):
(JSC::Yarr::Parser::parseEscape):
(JSC::Yarr::Parser::parseTokens):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/yarr/YarrParser.h

    r140594 r162906  
    120120                }
    121121                // Otherwise just fall through - cached character so treat this as Empty.
     122                FALLTHROUGH;
    122123
    123124            case Empty:
     
    169170                // Flush the currently cached character, then fall through.
    170171                m_delegate.atomCharacterClassAtom(m_character);
    171 
     172                FALLTHROUGH;
    172173            case Empty:
    173174            case AfterCharacterClass:
     
    187188                m_delegate.atomCharacterClassAtom(m_character);
    188189                m_delegate.atomCharacterClassAtom('-');
    189                 // fall through
     190                FALLTHROUGH;
    190191            case AfterCharacterClassHyphen:
    191192                m_delegate.atomCharacterClassBuiltIn(classID, invert);
     
    350351
    351352            // Fall-through to handle this as an octal escape.
     353            FALLTHROUGH;
    352354        }
    353355
     
    657659
    658660                restoreState(state);
    659             } // if we did not find a complete quantifer, fall through to the default case.
     661            }
     662            // if we did not find a complete quantifer, fall through to the default case.
     663            FALLTHROUGH;
    660664
    661665            default:
Note: See TracChangeset for help on using the changeset viewer.