SlideShare a Scribd company logo
1 of 85
Download to read offline
Monday, November 29, 2010
JavaScript Engines
                              Under the Hood

                                     ARIYA HIDAYAT
                              ENGINEERING DIRECTOR, SENCHA


Monday, November 29, 2010
JavaScript Engines

                            Get It
                            See It
                            Tweak It


Monday, November 29, 2010
JavaScript Engines




Monday, November 29, 2010
JavaScript Engines
                            SpiderMonkey     Opera Carakan
                            JavaScriptCore   Microsoft JScript
                                 V8          ...


                              Open                 Closed


Monday, November 29, 2010
JavaScript Engines
                            SpiderMonkey
                            JavaScriptCore
                                 V8


                              Open



Monday, November 29, 2010
SpiderMonkey
       First JavaScript engine
       created by Brendan Eich

       Written in C
       Mostly used in Mozilla, Firefox, ...

       License: MPL/LGPL/GPL




Monday, November 29, 2010
JavaScriptCore (JSC)
       Built into WebKit
       Forked from KDEā€™s KJS a long time ago

       License: LGPL




Monday, November 29, 2010
Other Names of JSC
       SquirrelFish
       byte-code interpreter

       SquirrelFish Extreme (SFX)
       native/machine code

       Nitro, Nitro Extreme
       Appleā€™s marketing terms


Monday, November 29, 2010
Google V8
       Written in C++
       License: BSD

       Used in Chromium (Google Chrome)




Monday, November 29, 2010
Qt Script
       Uses JSC as the back-end
       Does not power any web browser

       Powerful bindings, debugger
       Useful to make applications scriptable




Monday, November 29, 2010
Letā€™s Go
        UNDER THE HOOD
Monday, November 29, 2010
Letā€™s Go        Platform +
                             Compiler
        UNDER THE HOOD
Monday, November 29, 2010
Monday, November 29, 2010
Get the real V8
        svn checkout http://v8.googlecode.com/svn/trunk v8
        cd v8

        git clone git://github.com/v8/v8.git v8
        cd v8




Monday, November 29, 2010
Build V8

        scons sample=shell mode=release snapshot=on




Monday, November 29, 2010
Build V8

        scons sample=shell mode=release snapshot=on



                                        --jobs 4




Monday, November 29, 2010
Build V8

        scons sample=shell mode=release snapshot=on



                                        --jobs 4


                                        arch=x64

Monday, November 29, 2010
Run your-favorite-
                               benchmark


      perl sunspider --shell=/path/to/v8/directory/
      shell --args=-expose-gc




Monday, November 29, 2010
Run your-favorite-
                               benchmark


      perl sunspider --shell=/path/to/v8/directory/
      shell --args=-expose-gc


                                        garbage collector


Monday, November 29, 2010
Letā€™s Get DIRTY




Monday, November 29, 2010
Building Blocks

                            Parser
                                                   Runtime



                                     Interpreter


Monday, November 29, 2010
Parser




Monday, November 29, 2010
Tokenize



     var answer = 42;

Monday, November 29, 2010
Tokenize
                            identiļ¬er                number



     var answer = 42;
             keyword                    equal sign
                                                        semicolon


Monday, November 29, 2010
Look Ahead

                            greater than
       >
      >>                      right shift

      >>>                      zero-ļ¬lled right shift


Monday, November 29, 2010
Look Ahead

                            greater than                >=
       >
      >>                      right shift               >>=
      >>>                                               >>>=
                               zero-ļ¬lled right shift


Monday, November 29, 2010
Tokenizer on V8

                               src/scanner.*




Monday, November 29, 2010
Tokenizer on V8

                               src/scanner.*


                                   hand-written
                                   state machine



Monday, November 29, 2010
Keyword vs Identiļ¬er

                  instanceof           instanceComponent

                                           requires checking
                                                9 chars




Monday, November 29, 2010
Keyword vs Identiļ¬er

                  instanceof           instanceComponent

                                           requires checking
                                                9 chars




                            a g h j klmopqxyz
Monday, November 29, 2010
Grammar
        SourceElement :: (Statement)*

        FunctionDeclaration ::
          'function' Identifier '(' FormalParameters ')'
          '{' FunctionBody '}'




Monday, November 29, 2010
Syntax Tree
                                 Variable Declaration




                            Identiļ¬er
                                                   Literal Constant

                            answer                      42
Monday, November 29, 2010
Another Syntax Tree
                                  Branch



         Condition                            Alternate
                                 Consequent
     age < 25                                 ā€œoldā€
                                 ā€œyoungā€
Monday, November 29, 2010
Parser on V8

                             src/parser.*




Monday, November 29, 2010
Parser on V8

                             src/parser.*


                                  hand-written
                                recursive descent



Monday, November 29, 2010
Code Trace
                                 Script::Compile

                                   Script::New

                            internal::Compiler::Compile

                            internal::MakeFunctionInfo

                            internal::ParserApi::Parse


Monday, November 29, 2010
Interpreter




Monday, November 29, 2010
From Code to Execution

      var answer = 42;
                                   Declare a local object
                                      Call it ā€œanswerā€
                            Create a (small integer) number 42
                                  Assign it to ā€œanswerā€
Monday, November 29, 2010
Traverse and Run
                                 Variable Declaration




                            Identiļ¬er
                                                   Literal Constant

                            answer                      42
Monday, November 29, 2010
Bytecode

                            Serialize tree traversal into
                                 a list of ā€œactionsā€




Monday, November 29, 2010
Machine Code

                            Compile the bytecodes into
                              machine instructions




Monday, November 29, 2010
Machine Code

                              Compile the bytecodes into
                                machine instructions



                            JIT (=just-in-time) compile

Monday, November 29, 2010
Machine Code on V8
                               Global

                    shell_g --print-code


                            When needed

       shell_g --expose-debug-as deb


Monday, November 29, 2010
Machine Code on V8
                               Global

                    shell_g --print-code


                            When needed
                                           deb.Debug.disassemble(f)

       shell_g --expose-debug-as deb


Monday, November 29, 2010
ā€œLazyā€ Approach
          foobar = function(x, y, z)
          {
          ....
          }

          foobar(x, y, z);




Monday, November 29, 2010
ā€œLazyā€ Approach
          foobar = function(x, y, z)   Analyze the syntax
          {
          ....
                                       Mark the position of
          }                             function ā€˜foobarā€™
          foobar(x, y, z);




Monday, November 29, 2010
ā€œLazyā€ Approach
          foobar = function(x, y, z)              Analyze the syntax
          {
          ....
                                                  Mark the position of
          }                                        function ā€˜foobarā€™
          foobar(x, y, z);



                            Compile and run the
                             function ā€˜foobarā€™
Monday, November 29, 2010
Runtime




Monday, November 29, 2010
Date.now()


                      ā€œnativeā€            JavaScript
                       world                world



Monday, November 29, 2010
Letā€™s Go
                            OFF ROAD




Monday, November 29, 2010
Bridge




Monday, November 29, 2010
V8 Embedderā€™s Guide




                 http://code.google.com/apis/v8/embed.html
Monday, November 29, 2010
Handle: Local vs Persistent


                        {
                            HandleScope scope;

                            Handle<Value> foobar = ....
                            ....
                            ....
                        }
Monday, November 29, 2010
short lived

                 Handle: Local vs Persistent
                                                  long lived


                        {
                             HandleScope scope;

                             Handle<Value> foobar = ....
                             ....
                             ....
                        }
Monday, November 29, 2010
C++-side of Objects
                Value         Primitive   Boolean
                              Date        String
                              Object      Number

                              Array
                              Function
                              External
Monday, November 29, 2010
Expose a Variable

        Handle<ObjectTemplate> global = ObjectTemplate::New();
        global->Set("foobar", String::New(ā€œHelloā€));




Monday, November 29, 2010
Expose a Function
      Handle<FunctionTemplate> systemObject = FunctionTemplate::New();
      systemObject->Set(String::New("exit"),
          FunctionTemplate::New(system_exit)->GetFunction());




                            static Handle<Value> system_exit(const Arguments& args)
                            {
                                int status = args[0]->Int32Value();
                                ::exit(status);
                                return Undefined();
                            }

Monday, November 29, 2010
Demo
                            Code Formatter



Monday, November 29, 2010
Demo
                            Syntax Checker



Monday, November 29, 2010
Demo
                            Canvas-based Game



Monday, November 29, 2010
http://10k.aneventapart.com/Entry/392
Monday, November 29, 2010
Demo
                            Syntax Parser



Monday, November 29, 2010
Ext.extend

                            declare

         Ext.ComponentFoo = Ext.extend(Ext.ComponentBar, ....


                                              depend



Monday, November 29, 2010
Demo
                            Code Analyzer



Monday, November 29, 2010
"type": "IfStatement",
                            "test": {
                                        "type": "BinaryExpression",
                                        "operator": "==",
                                        "left": {
                                            "type": "Identifier",
                                            "name": "x"
                                        },
                                        "right": {
                                            "type": "Identifier",
                                            "name": "y"
                                        }
     if (x == y) foo();             },
                                    "consequent": {
                                        "type": "ExpressionStatement",
                                        "expression": {
                                            "type": "CallExpression",
                                            "callee": {
                                                "type": "Identifier",
                                                "name": "foo"
                                            },
                                            "arguments": []
                                        }
                                    },
                                    "alternate": null




Monday, November 29, 2010
"type": "IfStatement",
                            "test": {
                                        "type": "BinaryExpression",
                                        "operator": "==",
                                        "left": {
                                            "type": "Identifier",
                                            "name": "x"
                                        },
                                        "right": {
                                            "type": "Identifier",
                                            "name": "y"
                                        }
     if (x == y) foo();             },
                                    "consequent": {
                                        "type": "ExpressionStatement",
                                        "expression": {
                                            "type": "CallExpression",
                                            "callee": {
                                                "type": "Identifier",
                                                "name": "foo"
                                            },
                                            "arguments": []
                                        }
                                    },
                                    "alternate": null




Monday, November 29, 2010
"type": "IfStatement",
                                      "test": {
                                                  "type": "BinaryExpression",
                                                  "operator": "==",
                                                  "left": {
                                                      "type": "Identifier",
                                                      "name": "x"
                                                  },
                                                  "right": {
                                                      "type": "Identifier",
                                                      "name": "y"
                                                  }
     if (x == y) foo();                       },
                                              "consequent": {
                                                  "type": "ExpressionStatement",
                                                  "expression": {
                            Danger!                   "type": "CallExpression",
                                                      "callee": {
                                                          "type": "Identifier",
                                                          "name": "foo"
                                                      },
                                                      "arguments": []
                                                  }
                                              },
                                              "alternate": null




Monday, November 29, 2010
Debugging




Monday, November 29, 2010
http://code.google.com/p/chromedevtools
Monday, November 29, 2010
(Remote) Debugging


                            v8::Debug::EnableAgent("foobar", 5858);




Monday, November 29, 2010
(Remote) Debugging
                                        application name

                            v8::Debug::EnableAgent("foobar", 5858);


                                                listening port



Monday, November 29, 2010
Proļ¬ling




Monday, November 29, 2010
Activate Proļ¬ler

                                   scons prof=on ...

                                   shell --prof ....

                            tools/mac-tick-processor v8.log




Monday, November 29, 2010
Function-Level Proļ¬le
      [JavaScript]:
        ticks total          nonlib    name
        3125    5.9%           5.9%   LazyCompile: am3 crypto.js:108
        1036    2.0%           2.0%   KeyedLoadIC: A keyed load IC from the snapshot
         386    0.7%           0.7%   LazyCompile: StringReplaceRegExp native string.js:243
         362    0.7%           0.7%   LazyCompile: Scheduler.schedule richards.js:188
         326    0.6%           0.6%   LazyCompile: one_way_unify1_nboyer earley-boyer.js:3635
         301    0.6%           0.6%   LazyCompile: exec native regexp.js:156
         280    0.5%           0.5%   LazyCompile: TaskControlBlock.isHeldOrSuspended richards.js:309
         279    0.5%           0.5%   KeyedStoreIC: A keyed store IC from the snapshot
         278    0.5%           0.5%   LazyCompile: rewrite_nboyer earley-boyer.js:3604
         259    0.5%           0.5%   LazyCompile: BuildResultFromMatchInfo native regexp.js:121
         244    0.5%           0.5%   LazyCompile: TaskControlBlock.run richards.js:324
         186    0.4%           0.4%   Stub: Instanceof




Monday, November 29, 2010
THANK YOU!




Monday, November 29, 2010
QUESTIONS?

                            ariya @ sencha.com


                            ariya.blogspot.com


                            ariyahidayat

Monday, November 29, 2010
ADDENDUM




Monday, November 29, 2010
Get SpiderMonkey

        hg clone http://hg.mozilla.org/mozilla-central/
        cd mozilla-central/js/src




Monday, November 29, 2010
Get JavaScriptCore
          svn checkout http://svn.webkit.org/repository/
          webkit/trunk webkit
          cd webkit/JavaScriptCore

          git clone git://git.webkit.org/WebKit.git
          cd WebKit/JavaScriptCore




Monday, November 29, 2010
Build SpiderMonkey
        autoconf213
        ./configure --disable-debug --enable-optimize
        make




Monday, November 29, 2010
Build JavaScriptCore

        JavaScriptCore/JavaScriptCore.xcodeproj



                      JavaScriptCore

                               jsc

Monday, November 29, 2010
Run your-favorite-
                               benchmark
      perl sunspider --shell=/path/to/mozilla-
      central/js/src/build-release/js --args=-j

      perl sunspider --shell=/path/to/webkit/
      JavaScriptCore/jsc

      perl sunspider --shell=/path/to/v8/directory/
      shell --args=-expose-gc


Monday, November 29, 2010
Run your-favorite-
                               benchmark
      perl sunspider --shell=/path/to/mozilla-
      central/js/src/build-release/js --args=-j

      perl sunspider --shell=/path/to/webkit/
      JavaScriptCore/jsc

      perl sunspider --shell=/path/to/v8/directory/
      shell --args=-expose-gc
                                          garbage collector
Monday, November 29, 2010
Build JavaScriptCore
        qmake -r DerivedSources.pro
        cd JavaScriptCore
        make -f Makefile.DerivedSources
        qmake && make
        qmake jsc.pro && make




Monday, November 29, 2010

More Related Content

More from Sencha

Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha
Ā 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha
Ā 
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha
Ā 
Sencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha
Ā 
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha
Ā 
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridLeveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridSencha
Ā 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportSencha
Ā 
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsIntroducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsSencha
Ā 
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSencha
Ā 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...Sencha
Ā 
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...Sencha
Ā 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSencha
Ā 
Ext JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsExt JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsSencha
Ā 
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...Sencha
Ā 
Building Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoBuilding Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoSencha
Ā 
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...Sencha
Ā 
SenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil Manvar
SenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil ManvarSenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil Manvar
SenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil ManvarSencha
Ā 
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...Sencha
Ā 
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory HardySenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory HardySencha
Ā 
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...Sencha
Ā 

More from Sencha (20)

Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Ā 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Ā 
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Ā 
Sencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop First
Ā 
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Ā 
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridLeveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
Ā 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research Report
Ā 
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsIntroducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Ā 
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
Ā 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
Ā 
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
Ā 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
Ā 
Ext JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsExt JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell Simeons
Ā 
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
Ā 
Building Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoBuilding Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff Stano
Ā 
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
Ā 
SenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil Manvar
SenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil ManvarSenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil Manvar
SenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil Manvar
Ā 
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
Ā 
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory HardySenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
Ā 
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
Ā 

Recently uploaded

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
Ā 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
Ā 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
Ā 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
Ā 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
Ā 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
Ā 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
Ā 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
Ā 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
Ā 
Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...
Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...
Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...Patryk Bandurski
Ā 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
Ā 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
Ā 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
Ā 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
Ā 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
Ā 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
Ā 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
Ā 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
Ā 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
Ā 

Recently uploaded (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
Ā 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Ā 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Ā 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
Ā 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
Ā 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
Ā 
Hot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort Service
Hot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort ServiceHot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort Service
Hot Sexy call girls in Panjabi Bagh šŸ” 9953056974 šŸ” Delhi escort Service
Ā 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Ā 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Ā 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
Ā 
Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...
Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...
Integration and Automation in Practice: CI/CD in MuleĀ Integration and Automat...
Ā 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
Ā 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Ā 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
Ā 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
Ā 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
Ā 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
Ā 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
Ā 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
Ā 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
Ā 

JavaScript Engines: Under the Hood

  • 2. JavaScript Engines Under the Hood ARIYA HIDAYAT ENGINEERING DIRECTOR, SENCHA Monday, November 29, 2010
  • 3. JavaScript Engines Get It See It Tweak It Monday, November 29, 2010
  • 5. JavaScript Engines SpiderMonkey Opera Carakan JavaScriptCore Microsoft JScript V8 ... Open Closed Monday, November 29, 2010
  • 6. JavaScript Engines SpiderMonkey JavaScriptCore V8 Open Monday, November 29, 2010
  • 7. SpiderMonkey First JavaScript engine created by Brendan Eich Written in C Mostly used in Mozilla, Firefox, ... License: MPL/LGPL/GPL Monday, November 29, 2010
  • 8. JavaScriptCore (JSC) Built into WebKit Forked from KDEā€™s KJS a long time ago License: LGPL Monday, November 29, 2010
  • 9. Other Names of JSC SquirrelFish byte-code interpreter SquirrelFish Extreme (SFX) native/machine code Nitro, Nitro Extreme Appleā€™s marketing terms Monday, November 29, 2010
  • 10. Google V8 Written in C++ License: BSD Used in Chromium (Google Chrome) Monday, November 29, 2010
  • 11. Qt Script Uses JSC as the back-end Does not power any web browser Powerful bindings, debugger Useful to make applications scriptable Monday, November 29, 2010
  • 12. Letā€™s Go UNDER THE HOOD Monday, November 29, 2010
  • 13. Letā€™s Go Platform + Compiler UNDER THE HOOD Monday, November 29, 2010
  • 15. Get the real V8 svn checkout http://v8.googlecode.com/svn/trunk v8 cd v8 git clone git://github.com/v8/v8.git v8 cd v8 Monday, November 29, 2010
  • 16. Build V8 scons sample=shell mode=release snapshot=on Monday, November 29, 2010
  • 17. Build V8 scons sample=shell mode=release snapshot=on --jobs 4 Monday, November 29, 2010
  • 18. Build V8 scons sample=shell mode=release snapshot=on --jobs 4 arch=x64 Monday, November 29, 2010
  • 19. Run your-favorite- benchmark perl sunspider --shell=/path/to/v8/directory/ shell --args=-expose-gc Monday, November 29, 2010
  • 20. Run your-favorite- benchmark perl sunspider --shell=/path/to/v8/directory/ shell --args=-expose-gc garbage collector Monday, November 29, 2010
  • 21. Letā€™s Get DIRTY Monday, November 29, 2010
  • 22. Building Blocks Parser Runtime Interpreter Monday, November 29, 2010
  • 24. Tokenize var answer = 42; Monday, November 29, 2010
  • 25. Tokenize identiļ¬er number var answer = 42; keyword equal sign semicolon Monday, November 29, 2010
  • 26. Look Ahead greater than > >> right shift >>> zero-ļ¬lled right shift Monday, November 29, 2010
  • 27. Look Ahead greater than >= > >> right shift >>= >>> >>>= zero-ļ¬lled right shift Monday, November 29, 2010
  • 28. Tokenizer on V8 src/scanner.* Monday, November 29, 2010
  • 29. Tokenizer on V8 src/scanner.* hand-written state machine Monday, November 29, 2010
  • 30. Keyword vs Identiļ¬er instanceof instanceComponent requires checking 9 chars Monday, November 29, 2010
  • 31. Keyword vs Identiļ¬er instanceof instanceComponent requires checking 9 chars a g h j klmopqxyz Monday, November 29, 2010
  • 32. Grammar SourceElement :: (Statement)* FunctionDeclaration :: 'function' Identifier '(' FormalParameters ')' '{' FunctionBody '}' Monday, November 29, 2010
  • 33. Syntax Tree Variable Declaration Identiļ¬er Literal Constant answer 42 Monday, November 29, 2010
  • 34. Another Syntax Tree Branch Condition Alternate Consequent age < 25 ā€œoldā€ ā€œyoungā€ Monday, November 29, 2010
  • 35. Parser on V8 src/parser.* Monday, November 29, 2010
  • 36. Parser on V8 src/parser.* hand-written recursive descent Monday, November 29, 2010
  • 37. Code Trace Script::Compile Script::New internal::Compiler::Compile internal::MakeFunctionInfo internal::ParserApi::Parse Monday, November 29, 2010
  • 39. From Code to Execution var answer = 42; Declare a local object Call it ā€œanswerā€ Create a (small integer) number 42 Assign it to ā€œanswerā€ Monday, November 29, 2010
  • 40. Traverse and Run Variable Declaration Identiļ¬er Literal Constant answer 42 Monday, November 29, 2010
  • 41. Bytecode Serialize tree traversal into a list of ā€œactionsā€ Monday, November 29, 2010
  • 42. Machine Code Compile the bytecodes into machine instructions Monday, November 29, 2010
  • 43. Machine Code Compile the bytecodes into machine instructions JIT (=just-in-time) compile Monday, November 29, 2010
  • 44. Machine Code on V8 Global shell_g --print-code When needed shell_g --expose-debug-as deb Monday, November 29, 2010
  • 45. Machine Code on V8 Global shell_g --print-code When needed deb.Debug.disassemble(f) shell_g --expose-debug-as deb Monday, November 29, 2010
  • 46. ā€œLazyā€ Approach foobar = function(x, y, z) { .... } foobar(x, y, z); Monday, November 29, 2010
  • 47. ā€œLazyā€ Approach foobar = function(x, y, z) Analyze the syntax { .... Mark the position of } function ā€˜foobarā€™ foobar(x, y, z); Monday, November 29, 2010
  • 48. ā€œLazyā€ Approach foobar = function(x, y, z) Analyze the syntax { .... Mark the position of } function ā€˜foobarā€™ foobar(x, y, z); Compile and run the function ā€˜foobarā€™ Monday, November 29, 2010
  • 50. Date.now() ā€œnativeā€ JavaScript world world Monday, November 29, 2010
  • 51. Letā€™s Go OFF ROAD Monday, November 29, 2010
  • 53. V8 Embedderā€™s Guide http://code.google.com/apis/v8/embed.html Monday, November 29, 2010
  • 54. Handle: Local vs Persistent { HandleScope scope; Handle<Value> foobar = .... .... .... } Monday, November 29, 2010
  • 55. short lived Handle: Local vs Persistent long lived { HandleScope scope; Handle<Value> foobar = .... .... .... } Monday, November 29, 2010
  • 56. C++-side of Objects Value Primitive Boolean Date String Object Number Array Function External Monday, November 29, 2010
  • 57. Expose a Variable Handle<ObjectTemplate> global = ObjectTemplate::New(); global->Set("foobar", String::New(ā€œHelloā€)); Monday, November 29, 2010
  • 58. Expose a Function Handle<FunctionTemplate> systemObject = FunctionTemplate::New(); systemObject->Set(String::New("exit"), FunctionTemplate::New(system_exit)->GetFunction()); static Handle<Value> system_exit(const Arguments& args) { int status = args[0]->Int32Value(); ::exit(status); return Undefined(); } Monday, November 29, 2010
  • 59. Demo Code Formatter Monday, November 29, 2010
  • 60. Demo Syntax Checker Monday, November 29, 2010
  • 61. Demo Canvas-based Game Monday, November 29, 2010
  • 63. Demo Syntax Parser Monday, November 29, 2010
  • 64. Ext.extend declare Ext.ComponentFoo = Ext.extend(Ext.ComponentBar, .... depend Monday, November 29, 2010
  • 65. Demo Code Analyzer Monday, November 29, 2010
  • 66. "type": "IfStatement", "test": { "type": "BinaryExpression", "operator": "==", "left": { "type": "Identifier", "name": "x" }, "right": { "type": "Identifier", "name": "y" } if (x == y) foo(); }, "consequent": { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "foo" }, "arguments": [] } }, "alternate": null Monday, November 29, 2010
  • 67. "type": "IfStatement", "test": { "type": "BinaryExpression", "operator": "==", "left": { "type": "Identifier", "name": "x" }, "right": { "type": "Identifier", "name": "y" } if (x == y) foo(); }, "consequent": { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "foo" }, "arguments": [] } }, "alternate": null Monday, November 29, 2010
  • 68. "type": "IfStatement", "test": { "type": "BinaryExpression", "operator": "==", "left": { "type": "Identifier", "name": "x" }, "right": { "type": "Identifier", "name": "y" } if (x == y) foo(); }, "consequent": { "type": "ExpressionStatement", "expression": { Danger! "type": "CallExpression", "callee": { "type": "Identifier", "name": "foo" }, "arguments": [] } }, "alternate": null Monday, November 29, 2010
  • 71. (Remote) Debugging v8::Debug::EnableAgent("foobar", 5858); Monday, November 29, 2010
  • 72. (Remote) Debugging application name v8::Debug::EnableAgent("foobar", 5858); listening port Monday, November 29, 2010
  • 74. Activate Proļ¬ler scons prof=on ... shell --prof .... tools/mac-tick-processor v8.log Monday, November 29, 2010
  • 75. Function-Level Proļ¬le [JavaScript]: ticks total nonlib name 3125 5.9% 5.9% LazyCompile: am3 crypto.js:108 1036 2.0% 2.0% KeyedLoadIC: A keyed load IC from the snapshot 386 0.7% 0.7% LazyCompile: StringReplaceRegExp native string.js:243 362 0.7% 0.7% LazyCompile: Scheduler.schedule richards.js:188 326 0.6% 0.6% LazyCompile: one_way_unify1_nboyer earley-boyer.js:3635 301 0.6% 0.6% LazyCompile: exec native regexp.js:156 280 0.5% 0.5% LazyCompile: TaskControlBlock.isHeldOrSuspended richards.js:309 279 0.5% 0.5% KeyedStoreIC: A keyed store IC from the snapshot 278 0.5% 0.5% LazyCompile: rewrite_nboyer earley-boyer.js:3604 259 0.5% 0.5% LazyCompile: BuildResultFromMatchInfo native regexp.js:121 244 0.5% 0.5% LazyCompile: TaskControlBlock.run richards.js:324 186 0.4% 0.4% Stub: Instanceof Monday, November 29, 2010
  • 77. QUESTIONS? ariya @ sencha.com ariya.blogspot.com ariyahidayat Monday, November 29, 2010
  • 79. Get SpiderMonkey hg clone http://hg.mozilla.org/mozilla-central/ cd mozilla-central/js/src Monday, November 29, 2010
  • 80. Get JavaScriptCore svn checkout http://svn.webkit.org/repository/ webkit/trunk webkit cd webkit/JavaScriptCore git clone git://git.webkit.org/WebKit.git cd WebKit/JavaScriptCore Monday, November 29, 2010
  • 81. Build SpiderMonkey autoconf213 ./configure --disable-debug --enable-optimize make Monday, November 29, 2010
  • 82. Build JavaScriptCore JavaScriptCore/JavaScriptCore.xcodeproj JavaScriptCore jsc Monday, November 29, 2010
  • 83. Run your-favorite- benchmark perl sunspider --shell=/path/to/mozilla- central/js/src/build-release/js --args=-j perl sunspider --shell=/path/to/webkit/ JavaScriptCore/jsc perl sunspider --shell=/path/to/v8/directory/ shell --args=-expose-gc Monday, November 29, 2010
  • 84. Run your-favorite- benchmark perl sunspider --shell=/path/to/mozilla- central/js/src/build-release/js --args=-j perl sunspider --shell=/path/to/webkit/ JavaScriptCore/jsc perl sunspider --shell=/path/to/v8/directory/ shell --args=-expose-gc garbage collector Monday, November 29, 2010
  • 85. Build JavaScriptCore qmake -r DerivedSources.pro cd JavaScriptCore make -f Makefile.DerivedSources qmake && make qmake jsc.pro && make Monday, November 29, 2010