Changeset 61878 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Jun 25, 2010, 12:17:24 PM (15 years ago)
Author:
[email protected]
Message:

2010-06-25 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

Remove old js parser
https://bugs.webkit.org/show_bug.cgi?id=41222

Remove the old yacc parser, this also solves the tiger problem. Which
was a conflict between yacc generated token values and those in the
custom parser

  • Android.mk:
  • CMakeLists.txt:
  • DerivedSources.make:
  • DerivedSources.pro:
  • GNUmakefile.am:
  • JavaScriptCore.pro:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • parser/Grammar.y: Removed.
  • parser/JSParser.cpp:
  • parser/JSParser.h:
  • parser/Lexer.cpp:
  • parser/NodeConstructors.h: (JSC::Node::Node):
  • parser/Parser.cpp: (JSC::Parser::parse):
  • wtf/Platform.h:
Location:
trunk/JavaScriptCore
Files:
1 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/Android.mk

    r59955 r61878  
    188188        yarr/RegexJIT.cpp
    189189
    190 # Rule to build grammar.y with our custom bison.
    191 GEN := $(intermediates)/parser/Grammar.cpp
    192 $(GEN) : PRIVATE_YACCFLAGS := -p jscyy
    193 $(GEN) : $(LOCAL_PATH)/parser/Grammar.y
    194         $(call local-transform-y-to-cpp,.cpp)
    195 $(GEN) : $(LOCAL_BISON)
    196 LOCAL_GENERATED_SOURCES += $(GEN)
    197 
    198190# generated headers
    199191JSC_OBJECTS := $(addprefix $(intermediates)/runtime/, \
  • trunk/JavaScriptCore/CMakeLists.txt

    r61853 r61878  
    204204LIST(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_DIR}/Lexer.lut.h)
    205205
    206 # GENERATOR 2: bison grammar
    207 ADD_CUSTOM_COMMAND(
    208     OUTPUT ${DERIVED_SOURCES_DIR}/Grammar.cpp ${DERIVED_SOURCES_DIR}/Grammar.h
    209     MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/parser/Grammar.y
    210     COMMAND ${BISON_EXECUTABLE} -d -p jscyy ${JAVASCRIPTCORE_DIR}/parser/Grammar.y -o ${DERIVED_SOURCES_DIR}/Grammar.cpp --defines=${DERIVED_SOURCES_DIR}/Grammar.h
    211     COMMENT "[BISON][JSCYY] Building parser with bison"
    212     VERBATIM)
    213 LIST(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_DIR}/Grammar.h)
    214 LIST(APPEND JavaScriptCore_SOURCES ${DERIVED_SOURCES_DIR}/Grammar.cpp)
    215 
    216 
    217206# GENERATOR: "chartables.c": compile and execute the chartables generator (and add it to sources)
    218207IF (MSVC)
  • trunk/JavaScriptCore/ChangeLog

    r61860 r61878  
     12010-06-25  Oliver Hunt  <[email protected]>
     2
     3        Reviewed by Geoffrey Garen.
     4
     5        Remove old js parser
     6        https://bugs.webkit.org/show_bug.cgi?id=41222
     7
     8        Remove the old yacc parser, this also solves the tiger problem.  Which
     9        was a conflict between yacc generated token values and those in the
     10        custom parser
     11
     12        * Android.mk:
     13        * CMakeLists.txt:
     14        * DerivedSources.make:
     15        * DerivedSources.pro:
     16        * GNUmakefile.am:
     17        * JavaScriptCore.pro:
     18        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
     19        * JavaScriptCore.xcodeproj/project.pbxproj:
     20        * parser/Grammar.y: Removed.
     21        * parser/JSParser.cpp:
     22        * parser/JSParser.h:
     23        * parser/Lexer.cpp:
     24        * parser/NodeConstructors.h:
     25        (JSC::Node::Node):
     26        * parser/Parser.cpp:
     27        (JSC::Parser::parse):
     28        * wtf/Platform.h:
     29
    1302010-06-25  Jedrzej Nowacki  <[email protected]>
    231
  • trunk/JavaScriptCore/DerivedSources.make

    r60598 r61878  
    4040    chartables.c \
    4141    DatePrototype.lut.h \
    42     Grammar.cpp \
    4342    JSONObject.lut.h \
    4443    Lexer.lut.h \
     
    6261        $^ > $@
    6362
    64 # JavaScript language grammar
    65 
    66 Grammar.cpp: Grammar.y
    67         bison -d -p jscyy $< -o $@ > bison_out.txt 2>&1
    68         perl -p -e 'END { if ($$conflict) { unlink "Grammar.cpp"; die; } } $$conflict ||= /conflict/' < bison_out.txt
    69         touch Grammar.cpp.h
    70         touch Grammar.hpp
    71         cat Grammar.cpp.h Grammar.hpp > Grammar.h
    72         rm -f Grammar.cpp.h Grammar.hpp bison_out.txt
    73 
    7463# character tables for PCRE
    7564
  • trunk/JavaScriptCore/DerivedSources.pro

    r57925 r61878  
    2626KEYWORDLUT_FILES += \
    2727    parser/Keywords.table
    28 
    29 JSCBISON += \
    30     parser/Grammar.y
    3128
    3229RVCT_STUB_FILES += \
     
    6966addExtraCompiler(keywordlut)
    7067
    71 # GENERATOR 2: bison grammar
    72 jscbison.output = $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.cpp
    73 jscbison.input = JSCBISON
    74 jscbison.commands = bison -d -p jscyy ${QMAKE_FILE_NAME} -o $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.c && $(MOVE) $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.c ${QMAKE_FILE_OUT} && $(MOVE) $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.h $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.h
    75 jscbison.depends = ${QMAKE_FILE_NAME}
    76 addExtraCompiler(jscbison)
    77 
    7868# GENERATOR 3: JIT Stub functions for RVCT
    7969rvctstubs.output = $${JSC_GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}Generated${QMAKE_FILE_BASE}_RVCT.h
  • trunk/JavaScriptCore/GNUmakefile.am

    r61732 r61878  
    557557        JavaScriptCore/wtf/dtoa.h
    558558
    559 javascriptcore_built_sources += \
    560         DerivedSources/Grammar.cpp \
    561         DerivedSources/Grammar.h
    562 
    563 DerivedSources/Grammar.h: DerivedSources/Grammar.cpp;
    564 
    565 DerivedSources/Grammar.cpp: $(srcdir)/JavaScriptCore/parser/Grammar.y
    566         $(BISON) -d -p jscyy $(srcdir)/JavaScriptCore/parser/Grammar.y -o $@ > bison_out.txt 2>&1
    567         $(PERL) -p -e 'END { if ($$conflict) { unlink "Grammar.cpp"; die; } } $$conflict ||= /conflict/' < bison_out.txt
    568         cat $(GENSOURCES)/Grammar.hpp > $(GENSOURCES)/Grammar.h
    569         rm -f $(GENSOURCES)/Grammar.hpp bison_out.txt
    570 
    571559DerivedSources/Lexer.lut.h: $(CREATE_HASH_TABLE) $(srcdir)/JavaScriptCore/parser/Keywords.table
    572560        $(PERL) $^ > $@
     
    649637        JavaScriptCore/pcre/dftables \
    650638        JavaScriptCore/pcre/ucptable.cpp \
    651         JavaScriptCore/parser/Grammar.y \
    652639        JavaScriptCore/parser/Keywords.table
    653640
  • trunk/JavaScriptCore/JavaScriptCore.pro

    r61732 r61878  
    236236
    237237# Generated files, simply list them for JavaScriptCore
    238 SOURCES += \
    239     $${JSC_GENERATED_SOURCES_DIR}/Grammar.cpp
    240238
    241239!contains(DEFINES, USE_SYSTEM_MALLOC) {
  • trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj

    r61732 r61878  
    18821882                        </File>
    18831883                        <File
    1884                                 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\Grammar.cpp"
    1885                                 >
    1886                                 <FileConfiguration
    1887                                         Name="Debug|Win32"
    1888                                         >
    1889                                         <Tool
    1890                                                 Name="VCCLCompilerTool"
    1891                                                 DisableSpecificWarnings="4701"
    1892                                         />
    1893                                 </FileConfiguration>
    1894                                 <FileConfiguration
    1895                                         Name="Release|Win32"
    1896                                         >
    1897                                         <Tool
    1898                                                 Name="VCCLCompilerTool"
    1899                                                 DisableSpecificWarnings="4701"
    1900                                         />
    1901                                 </FileConfiguration>
    1902                                 <FileConfiguration
    1903                                         Name="Debug_Internal|Win32"
    1904                                         >
    1905                                         <Tool
    1906                                                 Name="VCCLCompilerTool"
    1907                                                 DisableSpecificWarnings="4701"
    1908                                         />
    1909                                 </FileConfiguration>
    1910                                 <FileConfiguration
    1911                                         Name="Release_PGOInstrument|Win32"
    1912                                         >
    1913                                         <Tool
    1914                                                 Name="VCCLCompilerTool"
    1915                                                 DisableSpecificWarnings="4701"
    1916                                         />
    1917                                 </FileConfiguration>
    1918                                 <FileConfiguration
    1919                                         Name="Release_PGOOptimize|Win32"
    1920                                         >
    1921                                         <Tool
    1922                                                 Name="VCCLCompilerTool"
    1923                                                 DisableSpecificWarnings="4701"
    1924                                         />
    1925                                 </FileConfiguration>
    1926                                 <FileConfiguration
    1927                                         Name="Debug_CFLite|Win32"
    1928                                         >
    1929                                         <Tool
    1930                                                 Name="VCCLCompilerTool"
    1931                                                 DisableSpecificWarnings="4701"
    1932                                         />
    1933                                 </FileConfiguration>
    1934                                 <FileConfiguration
    1935                                         Name="Release_CFLite|Win32"
    1936                                         >
    1937                                         <Tool
    1938                                                 Name="VCCLCompilerTool"
    1939                                                 DisableSpecificWarnings="4701"
    1940                                         />
    1941                                 </FileConfiguration>
    1942                                 <FileConfiguration
    1943                                         Name="Debug_All|Win32"
    1944                                         >
    1945                                         <Tool
    1946                                                 Name="VCCLCompilerTool"
    1947                                                 DisableSpecificWarnings="4701"
    1948                                         />
    1949                                 </FileConfiguration>
    1950                         </File>
    1951                         <File
    1952                                 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\Grammar.h"
    1953                                 >
    1954                         </File>
    1955                         <File
    19561884                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\lexer.lut.h"
    19571885                                >
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r61732 r61878  
    146146                1482B7E40A43076000517CFC /* JSObjectRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1482B7E20A43076000517CFC /* JSObjectRef.cpp */; };
    147147                148CD1D8108CF902008163C6 /* JSContextRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 148CD1D7108CF902008163C6 /* JSContextRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
    148                 148F21A3107EC5310042EC2C /* Grammar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FB3F4809D11B2400F49DEB /* Grammar.cpp */; };
    149148                148F21AA107EC53A0042EC2C /* BytecodeGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A07200ED1CE3300F1F681 /* BytecodeGenerator.cpp */; };
    150149                148F21B0107EC5410042EC2C /* Lexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8650255597D01FF60F7 /* Lexer.cpp */; };
     
    477476                BC18C52C0E16FCD200B34460 /* RegExpObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C52B0E16FCD200B34460 /* RegExpObject.lut.h */; };
    478477                BC18C52E0E16FCE100B34460 /* Lexer.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C52D0E16FCE100B34460 /* Lexer.lut.h */; };
    479                 BC18C5300E16FCEB00B34460 /* Grammar.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C52F0E16FCEB00B34460 /* Grammar.h */; };
    480478                BC257DE80E1F51C50016B6C9 /* Arguments.h in Headers */ = {isa = PBXBuildFile; fileRef = BC257DE60E1F51C50016B6C9 /* Arguments.h */; };
    481479                BC257DF00E1F52ED0016B6C9 /* GlobalEvalFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = BC257DEE0E1F52ED0016B6C9 /* GlobalEvalFunction.h */; };
     
    759757                65EA73620BAE35D1001BB560 /* CommonIdentifiers.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CommonIdentifiers.cpp; sourceTree = "<group>"; };
    760758                65EA73630BAE35D1001BB560 /* CommonIdentifiers.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CommonIdentifiers.h; sourceTree = "<group>"; };
    761                 65FB3F4809D11B2400F49DEB /* Grammar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Grammar.cpp; sourceTree = "<group>"; };
    762759                704FD35305697E6D003DBED9 /* BooleanObject.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = BooleanObject.h; sourceTree = "<group>"; tabWidth = 8; };
    763760                7E2C6C980D31C6B6002D44E2 /* ScopeChainMark.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScopeChainMark.h; sourceTree = "<group>"; };
     
    844841                93303FE80E6A72B500786E6A /* SmallStrings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SmallStrings.cpp; sourceTree = "<group>"; };
    845842                93303FEA0E6A72C000786E6A /* SmallStrings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmallStrings.h; sourceTree = "<group>"; };
    846                 933A3499038AE7C6008635CE /* Grammar.y */ = {isa = PBXFileReference; explicitFileType = sourcecode.yacc; fileEncoding = 4; indentWidth = 4; path = Grammar.y; sourceTree = "<group>"; tabWidth = 8; };
    847843                933A349A038AE7C6008635CE /* Identifier.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Identifier.h; sourceTree = "<group>"; tabWidth = 8; };
    848844                933A349D038AE80F008635CE /* Identifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Identifier.cpp; sourceTree = "<group>"; tabWidth = 8; };
     
    980976                BC18C52B0E16FCD200B34460 /* RegExpObject.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpObject.lut.h; sourceTree = "<group>"; };
    981977                BC18C52D0E16FCE100B34460 /* Lexer.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Lexer.lut.h; sourceTree = "<group>"; };
    982                 BC18C52F0E16FCEB00B34460 /* Grammar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Grammar.h; sourceTree = "<group>"; };
    983978                BC22A3980E16E14800AF21C8 /* JSObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSObject.cpp; sourceTree = "<group>"; };
    984979                BC22A3990E16E14800AF21C8 /* JSObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSObject.h; sourceTree = "<group>"; };
     
    13821377                                65B174BE09D1000200820339 /* chartables.c */,
    13831378                                BCD203E70E1718F4002C7E82 /* DatePrototype.lut.h */,
    1384                                 65FB3F4809D11B2400F49DEB /* Grammar.cpp */,
    1385                                 BC18C52F0E16FCEB00B34460 /* Grammar.h */,
    13861379                                BC87CDB810712ACA000614CF /* JSONObject.lut.h */,
    13871380                                BC18C52D0E16FCE100B34460 /* Lexer.lut.h */,
     
    15321525                        children = (
    15331526                                A7A7EE7411B98B8D0065A14F /* ASTBuilder.h */,
    1534                                 933A3499038AE7C6008635CE /* Grammar.y */,
    15351527                                A7A7EE7511B98B8D0065A14F /* JSParser.cpp */,
    15361528                                A7A7EE7611B98B8D0065A14F /* JSParser.h */,
     
    19681960                                BC18C4060E16F5CD00B34460 /* GetPtr.h in Headers */,
    19691961                                BC257DF00E1F52ED0016B6C9 /* GlobalEvalFunction.h in Headers */,
    1970                                 BC18C5300E16FCEB00B34460 /* Grammar.h in Headers */,
    19711962                                BC18C4080E16F5CD00B34460 /* HashCountedSet.h in Headers */,
    19721963                                BC18C4090E16F5CD00B34460 /* HashFunctions.h in Headers */,
     
    25062497                                14280855107EC0E70013E7B2 /* GetterSetter.cpp in Sources */,
    25072498                                147F39CD107EC37600427A48 /* GlobalEvalFunction.cpp in Sources */,
    2508                                 148F21A3107EC5310042EC2C /* Grammar.cpp in Sources */,
    25092499                                65DFC93308EA173A00F7300B /* HashTable.cpp in Sources */,
    25102500                                147F39CE107EC37600427A48 /* Identifier.cpp in Sources */,
  • trunk/JavaScriptCore/parser/JSParser.cpp

    r61732 r61878  
    2626#include "config.h"
    2727
    28 #if ENABLE(RECURSIVE_PARSE)
    2928#include "JSParser.h"
    3029
     
    3332#include "JSGlobalData.h"
    3433#include "NodeInfo.h"
    35 #include "Grammar.h"
    3634#include "ASTBuilder.h"
    3735#include <utility>
     
    15001498
    15011499}
    1502 
    1503 #endif
    1504 
  • trunk/JavaScriptCore/parser/JSParser.h

    r61732 r61878  
    2626#ifndef JSParser_h
    2727#define JSParser_h
    28 #if ENABLE(RECURSIVE_PARSE)
    2928
    3029namespace JSC {
     
    122121int jsParse(JSGlobalData*);
    123122}
    124 #endif
    125123#endif // JSParser_h
  • trunk/JavaScriptCore/parser/Lexer.cpp

    r61732 r61878  
    3939using namespace Unicode;
    4040
    41 #if ENABLE(RECURSIVE_PARSE)
    4241#include "JSParser.h"
    43 #else
    44 using namespace JSC;
    45 #include "Grammar.h"
    46 #endif
    47 
    4842#include "Lookup.h"
    4943#include "Lexer.lut.h"
  • trunk/JavaScriptCore/parser/NodeConstructors.h

    r61732 r61878  
    4444
    4545    inline Node::Node(JSGlobalData* globalData)
    46 #if ENABLE(RECURSIVE_PARSE)
    4746        : m_line(globalData->lexer->lastLineNumber())
    48 #else
    49         : m_line(globalData->lexer->lineNumber())
    50 #endif
    5147    {
    5248    }
  • trunk/JavaScriptCore/parser/Parser.cpp

    r61732 r61878  
    5353    Lexer& lexer = *globalData->lexer;
    5454    lexer.setCode(*m_source, m_arena);
    55    
    56 #if ENABLE(RECURSIVE_PARSE)
     55
    5756    int parseError = jsParse(globalData);
    58 #else
    59     int parseError = jscyyparse(globalData);
    60 #endif
    6157    int lineNumber = lexer.lineNumber();
    6258    bool lexError = lexer.sawError();
  • trunk/JavaScriptCore/wtf/Platform.h

    r61817 r61878  
    10901090#define ENABLE_JSC_ZOMBIES 0
    10911091
    1092 #if !defined(BUILDING_ON_TIGER)
    1093 #define ENABLE_RECURSIVE_PARSE 1
    1094 #endif
    1095 
    10961092/* FIXME: Eventually we should enable this for all platforms and get rid of the define. */
    10971093#if PLATFORM(MAC)
Note: See TracChangeset for help on using the changeset viewer.