CINXE.COM

SpiderMonkey — Firefox Source Docs documentation

<!doctype html> <html class="writer-html5" lang="en" data-content_root="../"> <head> <base href="https://firefox-source-docs.mozilla.org/js/index.html"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>SpiderMonkey — Firefox Source Docs documentation</title> <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50"> <link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=19f00094"> <link rel="stylesheet" type="text/css" href="../_static/graphviz.css?v=fd3f3429"> <link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b"> <link rel="stylesheet" type="text/css" href="../_static/custom_theme.css?v=a7d3e023"> <link rel="stylesheet" type="text/css" href="../_static/design-style.1e8bd061cd6da7fc9cf755528e8ffc24.min.css?v=0a3b3ea7"> <link rel="shortcut icon" href="../_static/firefox.ico"><!--[if lt IE 9]> <script src="../_static/js/html5shiv.min.js"></script> <![endif]--> <script src="../_static/jquery.js?v=5d32c60e"></script> <script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script> <script src="../_static/documentation_options.js?v=5929fcd5"></script> <script src="../_static/doctools.js?v=9a2dae69"></script> <script src="../_static/sphinx_highlight.js?v=dc90522c"></script> <script src="../_static/clipboard.min.js?v=a7894cd8"></script> <script src="../_static/copybutton.js?v=30646c52"></script> <script src="../_static/design-tabs.js?v=36754332"></script> <script src="../_static/js/theme.js"></script> <link rel="index" title="Index" href="../genindex.html"> <link rel="search" title="Search" href="../search.html"> <link rel="next" title="Building and testing SpiderMonkey" href="build.html"> <link rel="prev" title="The Bergamot Translator" href="../toolkit/components/translations/resources/03_bergamot.html"> <meta http-equiv="X-Translated-By" content="Google"> <meta http-equiv="X-Translated-To" content="tr"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.omlEigW4xY8.O/am=DgY/d=1/rs=AN8SPfpjsL9kUWY0h-sp7Ilu7hZWGwEmeg/m=corsproxy" data-sourceurl="https://firefox-source-docs.mozilla.org/js/index.html"></script> <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.omlEigW4xY8.O/am=DgY/d=1/exm=corsproxy/ed=1/rs=AN8SPfpjsL9kUWY0h-sp7Ilu7hZWGwEmeg/m=phishing_protection" data-phishing-protection-enabled="false" data-forms-warning-enabled="true" data-source-url="https://firefox-source-docs.mozilla.org/js/index.html"></script> <meta name="robots" content="none"> </head> <body class="wy-body-for-nav"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.omlEigW4xY8.O/am=DgY/d=1/exm=corsproxy,phishing_protection/ed=1/rs=AN8SPfpjsL9kUWY0h-sp7Ilu7hZWGwEmeg/m=navigationui" data-environment="prod" data-proxy-url="https://firefox--source--docs-mozilla-org.translate.goog" data-proxy-full-url="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB" data-source-url="https://firefox-source-docs.mozilla.org/js/index.html" data-source-language="pl" data-target-language="tr" data-display-language="en-GB" data-detected-source-language="" data-is-source-untranslated="false" data-source-untranslated-url="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://firefox-source-docs.mozilla.org/js/index.html&amp;anno=2" data-client="tr"></script> <div class="wy-grid-for-nav"> <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search"><a href="https://firefox--source--docs-mozilla-org.translate.goog/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB" class="icon icon-home"> Firefox Source Docs <img src="../_static/firefox-wordmark.svg" class="logo" alt="Logo"> </a><!-- -- This code is governed by the BSD license ----> <div> <h3>Quick search</h3> <script> (function () { var cx = "dd12886298f75dbef"; var gcse = document.createElement("script"); gcse.async = true; gcse.src = "https://cse.google.com/cse.js?cx=" + cx; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(gcse, s); })(); </script><gcse:search></gcse:search> </div> </div> <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> <p class="caption" role="heading"><span class="caption-text">Overview</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/glossary/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">A Glossary of Common Terms</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/overview/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">A Quick Guide to Mozilla Applications</a></li> </ul> <p class="caption" role="heading"><span class="caption-text">Getting Started</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/setup/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Getting Set Up To Work On The Firefox Codebase</a></li> </ul> <p class="caption" role="heading"><span class="caption-text">Working On Firefox</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/contributing/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Working on Firefox</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/bug-mgmt/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Bug Handling</a></li> </ul> <p class="caption" role="heading"><span class="caption-text">Firefox User Guide</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/devtools-user/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Firefox DevTools User Docs</a></li> </ul> <p class="caption" role="heading"><span class="caption-text">Source Code Documentation</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/mots/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Governance</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/browser/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Firefox Front-end</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/dom/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">DOM</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/editor/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Editor</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/layout/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Style system (CSS) &amp; Layout</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/gfx/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Graphics</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/ipc/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Processes, Threads and IPC</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/devtools/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Firefox DevTools Contributor Docs</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/toolkit/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Toolkit</a></li> <li class="toctree-l1 current"><a class="current reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#">SpiderMonkey</a> <ul> <li class="toctree-l2"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/build.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Building and testing SpiderMonkey</a></li> <li class="toctree-l2"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/test.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Running Automated JavaScript Tests</a></li> <li class="toctree-l2"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/hacking_tips.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Hacking Tips</a></li> <li class="toctree-l2"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/Debugger/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Debugger API</a></li> <li class="toctree-l2"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/SavedFrame/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">SavedFrame</a></li> <li class="toctree-l2"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/feature_checklist.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">JavaScript Language Feature Checklist</a></li> <li class="toctree-l2"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/bytecode_checklist.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">So You Want to Add a Bytecode Op</a></li> <li class="toctree-l2"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#components-of-spidermonkey">Components of SpiderMonkey</a> <ul> <li class="toctree-l3"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#garbage-collector">🧹 Garbage Collector</a> <ul> <li class="toctree-l4"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/gc.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Overview</a></li> <li class="toctree-l4"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/HazardAnalysis/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Rooting Hazard Analysis</a></li> <li class="toctree-l4"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/HazardAnalysis/running.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Running the Analysis</a></li> </ul></li> <li class="toctree-l3"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#js-value-and-jsobject">📦 JS::Value and JSObject</a></li> <li class="toctree-l3"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#javascript-parser">🗃️ JavaScript Parser</a></li> <li class="toctree-l3"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#javascript-interpreter">⚙️ JavaScript Interpreter</a></li> <li class="toctree-l3"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#javascript-jits">⚡ JavaScript JITs</a> <ul> <li class="toctree-l4"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/MIR-optimizations/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">MIR optimizations from a thousand feet</a></li> <li class="toctree-l4"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#baseline-interpreter">Baseline Interpreter</a></li> <li class="toctree-l4"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#baseline-compiler">Baseline Compiler</a></li> <li class="toctree-l4"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#warpmonkey">WarpMonkey</a></li> </ul></li> <li class="toctree-l3"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#id1">🟪 WebAssembly</a> <ul> <li class="toctree-l4"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#wasm-baseline-rabaldrmonkey">WASM-Baseline (RabaldrMonkey)</a></li> <li class="toctree-l4"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#wasm-ion-baldrmonkey">WASM-Ion (BaldrMonkey)</a></li> </ul></li> </ul></li> </ul></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/mobile/android/geckoview/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">GeckoView</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/mobile/android/fenix/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Fenix</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/mobile/android/focus-android/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Focus for Android</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/dom/bindings/webidl/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">WebIDL</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/modules/libpref/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">libpref</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/networking/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Networking</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/remote/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Remote Protocols</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/services/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Services</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/uriloader/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">File Handling</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/widget/cocoa/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Firefox on macOS</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/widget/windows/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Firefox on Windows</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/toolkit/components/ml/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Firefox AI Platform</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/accessible/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Accessibility</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/code-quality/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Code quality</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/writing-rust-code/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Writing Rust Code</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/rust-components/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Rust Components</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/tools/profiler/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Gecko Profiler</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/performance/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Performance</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/storage/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Database bindings (SQLite, KV, …)</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/xpcom/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">XPCOM</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/nspr/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">NSPR</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/security/nss/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Network Security Services (NSS)</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/content-security/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Web Security Checks in Gecko</a></li> </ul> <p class="caption" role="heading"><span class="caption-text">The Firefox Build System</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/mach/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Mach</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/tools/try/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Pushing to Try</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/build/buildsystem/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Build System</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/taskcluster/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Firefox CI and Taskgraph</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/tools/moztreedocs/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Managing Documentation</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/mozbuild/vendor/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Vendoring Third Party Components</a></li> </ul> <p class="caption" role="heading"><span class="caption-text">Testing &amp; Test Infrastructure</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/automated-testing/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Automated Testing</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/treeherder-try/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Understanding Treeherder Results</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/sheriffed-intermittents/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Sheriffed intermittent failures</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/tests-for-new-config/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Turning on Firefox tests for a new configuration</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/intermittent/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Avoiding intermittent tests</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/testing-policy/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Testing Policy</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/ci-configs/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Configuration Changes</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/browser-chrome/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Browser chrome mochitests</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/chrome-tests/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Chrome Tests</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/marionette/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Marionette</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/geckodriver/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">geckodriver</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/test-verification/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Test Verification</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/webrender/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">WebRender Tests</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/mochitest-plain/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Mochitest</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/xpcshell/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">XPCShell tests</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/tps/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">TPS</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/web-platform/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">web-platform-tests</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/gtest/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">GTest</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/tools/fuzzing/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Fuzzing</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/tools/sanitizer/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Sanitizer</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing/perfdocs/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Performance Testing</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/tools/code-coverage/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Code coverage</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/testing-rust-code/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Testing &amp; Debugging Rust Code</a></li> </ul> <p class="caption" role="heading"><span class="caption-text">Releases &amp; Updates</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/update-infrastructure/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Mozilla Update Infrastructure</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/update-infrastructure/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#watershed-updates">Watershed Updates</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/update-infrastructure/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#desupport-updates">Desupport Updates</a></li> </ul> <p class="caption" role="heading"><span class="caption-text">Localization &amp; Internationalization</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/intl/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Internationalization</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/l10n/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Localization</a></li> </ul> <p class="caption" role="heading"><span class="caption-text">Firefox and Python</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/mozbase/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">mozbase</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/python/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Using third-party Python packages</a></li> </ul> <p class="caption" role="heading"><span class="caption-text">Metrics Collected in Firefox</span></p> <ul> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/metrics/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Metrics</a></li> </ul> </div> </div> </nav> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <nav class="wy-nav-top" aria-label="Mobile navigation menu"><i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="https://firefox--source--docs-mozilla-org.translate.goog/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Firefox Source Docs</a> </nav> <div class="wy-nav-content"> <div class="rst-content"><!-- This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this file, - You can obtain one at http://mozilla.org/MPL/2.0/. --> <div role="navigation" aria-label="Page navigation"> <ul class="wy-breadcrumbs"> <li><a href="https://firefox--source--docs-mozilla-org.translate.goog/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB" class="icon icon-home" aria-label="Home"></a></li> <li class="breadcrumb-item active">SpiderMonkey</li> <li class="wy-breadcrumbs-aside"><a href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://bugzilla.mozilla.org/enter_bug.cgi?product%3DDeveloper%2BInfrastructure%26component%3DFirefox%2BSource%2BDocs%253A%2BContent%26short_desc%3DDocumentation%2Bissue%2Bon%2Bjs/index%26comment%3DURL%2B%3D%2Bhttps://firefox-source-docs.mozilla.org/js/index.html%26bug_file_loc%3Dhttps://firefox-source-docs.mozilla.org/js/index.html" rel="nofollow">Report an issue</a> / <a href="https://firefox--source--docs-mozilla-org.translate.goog/_sources/js/index.rst.txt?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB" rel="nofollow"> View page source</a></li> </ul> <hr> </div> <div role="main" class="document" itemscope itemtype="http://schema.org/Article"> <div itemprop="articleBody"> <section id="spidermonkey"> <h1>SpiderMonkey<a class="headerlink" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#spidermonkey" title="Link to this heading">¶</a></h1> <p><em>SpiderMonkey</em> is the <em>JavaScript</em> and <em>WebAssembly</em> implementation library of the <em>Mozilla Firefox</em> web browser. The implementation behaviour is defined by the <a class="reference external" href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://tc39.es/ecma262/">ECMAScript</a> and <a class="reference external" href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://webassembly.org/">WebAssembly</a> specifications.</p> <p>Much of the internal technical documentation of the engine can be found throughout the source files themselves by looking for comments labelled with <a class="reference external" href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://searchfox.org/mozilla-central/search?q%3D%5BSMDOC%5D%26path%3Djs%252F">[SMDOC]</a>. Information about the team, our processes, and about embedding <em>SpiderMonkey</em> in your own projects can be found at <a class="reference external" href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://spidermonkey.dev">https://spidermonkey.dev</a>.</p> <p>Specific documentation on a few topics is available at:</p> <div class="toctree-wrapper compound"> <ul> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/build.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Building and testing SpiderMonkey</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/test.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Running Automated JavaScript Tests</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/hacking_tips.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Hacking Tips</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/Debugger/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">Debugger API</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/SavedFrame/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">SavedFrame</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/feature_checklist.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">JavaScript Language Feature Checklist</a></li> <li class="toctree-l1"><a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/bytecode_checklist.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">So You Want to Add a Bytecode Op</a></li> </ul> </div> <section id="components-of-spidermonkey"> <h2>Components of SpiderMonkey<a class="headerlink" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#components-of-spidermonkey" title="Link to this heading">¶</a></h2> <section id="garbage-collector"> <h3>🧹 Garbage Collector<a class="headerlink" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#garbage-collector" title="Link to this heading">¶</a></h3> <div class="toctree-wrapper compound"> </div> <p><em>JavaScript</em> is a garbage collected language and at the core of <em>SpiderMonkey</em> we manage a garbage-collected memory heap. Elements of this heap have a base C++ type of <a class="reference external" href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://searchfox.org/mozilla-central/search?q%3D%5BSMDOC%5D%2BGC%2BCell">gc::Cell</a>. Each round of garbage collection will free up any <em>Cell</em> that is not referenced by a <em>root</em> or another live <em>Cell</em> in turn.</p> <p>See <a class="reference internal" href="https://firefox--source--docs-mozilla-org.translate.goog/js/gc.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB"><span class="doc">GC overview</span></a> for more details.</p> </section> <section id="js-value-and-jsobject"> <h3>📦 JS::Value and JSObject<a class="headerlink" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#js-value-and-jsobject" title="Link to this heading">¶</a></h3> <p><em>JavaScript</em> values are divided into either objects or primitives (<em>Undefined</em>, <em>Null</em>, <em>Boolean</em>, <em>Number</em>, <em>BigInt</em>, <em>String</em>, or <em>Symbol</em>). Values are represented with the <a class="reference external" href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://searchfox.org/mozilla-central/search?q%3D%5BSMDOC%5D%2BJS%253A%253AValue%2Btype%26path%3Djs%252F">JS::Value</a> type which may in turn point to an object that extends from the <a class="reference external" href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://searchfox.org/mozilla-central/search?q%3D%5BSMDOC%5D%2BJSObject%2Blayout">JSObject</a> type. Objects include both plain <em>JavaScript</em> objects and exotic objects representing various things from functions to <em>ArrayBuffers</em> to <em>HTML Elements</em> and more.</p> <p>Most objects extend <code class="docutils literal notranslate"><span class="pre">NativeObject</span></code> (which is a subtype of <code class="docutils literal notranslate"><span class="pre">JSObject</span></code>) which provides a way to store properties as key-value pairs similar to a hash table. These objects hold their <em>values</em> and point to a <em>Shape</em> that represents the set of <em>keys</em>. Similar objects point to the same <em>Shape</em> which saves memory and allows the JITs to quickly work with objects similar to ones it has seen before. See the <a class="reference external" href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://searchfox.org/mozilla-central/search?q%3D%5BSMDOC%5D%2BShapes">[SMDOC] Shapes</a> comment for more details.</p> <p>C++ (and Rust) code may create and manipulate these objects using the collection of interfaces we traditionally call the <strong>JSAPI</strong>.</p> </section> <section id="javascript-parser"> <h3>🗃️ JavaScript Parser<a class="headerlink" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#javascript-parser" title="Link to this heading">¶</a></h3> <p>In order to evaluate script text, we parse it using the <em>Parser</em> into an <a class="reference external" href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://en.wikipedia.org/wiki/Abstract_syntax_tree">Abstract Syntax Tree</a> (AST) temporarily and then run the <em>BytecodeEmitter</em> (BCE) to generate <a class="reference external" href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://en.wikipedia.org/wiki/Bytecode">Bytecode</a> and associated metadata. We refer to this resulting format as <a class="reference external" href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://searchfox.org/mozilla-central/search?q%3D%5BSMDOC%5D%2BScript%2BStencil">Stencil</a> and it has the helpful characteristic that it does not utilize the Garbage Collector. The <em>Stencil</em> can then be instantiated into a series of GC <em>Cells</em> that can be mutated and understood by the execution engines described below.</p> <p>Each function as well as the top-level itself generates a distinct script. This is the unit of execution granularity since functions may be set as callbacks that the host runs at a later time. There are both <code class="docutils literal notranslate"><span class="pre">ScriptStencil</span></code> and <code class="docutils literal notranslate"><span class="pre">js::BaseScript</span></code> forms of scripts.</p> <p>By default, the parser runs in a mode called <em>syntax</em> or <em>lazy</em> parsing where we avoid generating full bytecode for functions within the source that we are parsing. This lazy parsing is still required to check for all <em>early errors</em> that the specification describes. When such a lazily compiled inner function is first executed, we recompile just that function in a process called <em>delazification</em>. Lazy parsing avoids allocating the AST and bytecode which saves both CPU time and memory. In practice, many functions are never executed during a given load of a webpage so this delayed parsing can be quite beneficial.</p> </section> <section id="javascript-interpreter"> <h3>⚙️ JavaScript Interpreter<a class="headerlink" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#javascript-interpreter" title="Link to this heading">¶</a></h3> <p>The <em>bytecode</em> generated by the parser may be executed by an interpreter written in C++ that manipulates objects in the GC heap and invokes native code of the host (eg. web browser). See <a class="reference external" href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://searchfox.org/mozilla-central/search?q%3D%5BSMDOC%5D%2BBytecode%2BDefinitions%26path%3Djs%252F">[SMDOC] Bytecode Definitions</a> for descriptions of each bytecode opcode and <code class="docutils literal notranslate"><span class="pre">js/src/vm/Interpreter.cpp</span></code> for their implementation.</p> </section> <section id="javascript-jits"> <h3>⚡ JavaScript JITs<a class="headerlink" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#javascript-jits" title="Link to this heading">¶</a></h3> <div class="toctree-wrapper compound"> </div> <p>In order to speed up execution of <em>bytecode</em>, we use a series of Just-In-Time (JIT) compilers to generate specialized machine code (eg. x86, ARM, etc) tailored to the <em>JavaScript</em> that is run and the data that is processed.</p> <p>As an individual script runs more times (or has a loop that runs many times) we describe it as getting <em>hotter</em> and at certain thresholds we <em>tier-up</em> by JIT-compiling it. Each subsequent JIT tier spends more time compiling but aims for better execution performance.</p> <section id="baseline-interpreter"> <h4>Baseline Interpreter<a class="headerlink" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#baseline-interpreter" title="Link to this heading">¶</a></h4> <p>The <em>Baseline Interpreter</em> is a hybrid interpreter/JIT that interprets the <em>bytecode</em> one opcode at a time, but attaches small fragments of code called <em>Inline Caches</em> (ICs) that rapidly speed-up executing the same opcode the next time (if the data is similar enough). See the <a class="reference external" href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://searchfox.org/mozilla-central/search?q%3D%5BSMDOC%5D%2BJIT%2BInline%2BCaches">[SMDOC] JIT Inline Caches</a> comment for more details.</p> </section> <section id="baseline-compiler"> <h4>Baseline Compiler<a class="headerlink" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#baseline-compiler" title="Link to this heading">¶</a></h4> <p>The <em>Baseline Compiler</em> use the same <em>Inline Caches</em> mechanism from the <em>Baseline Interpreter</em> but additionally translates the entire bytecode to native machine code. This removes dispatch overhead and does minor local optimizations. This machine code still calls back into C++ for complex operations. The translation is very fast but the <code class="docutils literal notranslate"><span class="pre">BaselineScript</span></code> uses memory and requires <code class="docutils literal notranslate"><span class="pre">mprotect</span></code> and flushing CPU caches.</p> </section> <section id="warpmonkey"> <h4>WarpMonkey<a class="headerlink" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#warpmonkey" title="Link to this heading">¶</a></h4> <p>The <em>WarpMonkey</em> JIT replaces the former <em>IonMonkey</em> engine and is the highest level of optimization for the most frequently run scripts. It is able to inline other scripts and specialize code based on the data and arguments being processed.</p> <p>We translate the <em>bytecode</em> and <em>Inline Cache</em> data into a Mid-level <a class="reference external" href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://en.wikipedia.org/wiki/Intermediate_representation">Intermediate Representation</a> (Ion MIR) representation. This graph is transformed and optimized before being <em>lowered</em> to a Low-level Intermediate Representation (Ion LIR). This <em>LIR</em> performs register allocation and then generates native machine code in a process called <em>Code Generation</em>.</p> <p>See <a class="reference external" href="https://firefox--source--docs-mozilla-org.translate.goog/js/MIR-optimizations/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB">MIR Optimizations</a> for an overview of MIR optimizations.</p> <p>The optimizations here assume that a script continues to see data similar what has been seen before. The <em>Baseline</em> JITs are essential to success here because they generate <em>ICs</em> that match observed data. If after a script is compiled with <em>Warp</em>, it encounters data that it is not prepared to handle it performs a <em>bailout</em>. The <em>bailout</em> mechanism reconstructs the native machine stack frame to match the layout used by the <em>Baseline Interpreter</em> and then branches to that interpreter as though we were running it all along. Building this stack frame may use special side-table saved by <em>Warp</em> to reconstruct values that are not otherwise available.</p> </section> </section> <section id="id1"> <h3>🟪 WebAssembly<a class="headerlink" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#id1" title="Link to this heading">¶</a></h3> <p>In addition to <em>JavaScript</em>, the engine is also able to execute <em>WebAssembly</em> (WASM) sources.</p> <section id="wasm-baseline-rabaldrmonkey"> <h4>WASM-Baseline (RabaldrMonkey)<a class="headerlink" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#wasm-baseline-rabaldrmonkey" title="Link to this heading">¶</a></h4> <p>This engine performs fast translation to machine code in order to minimize latency to first execution.</p> </section> <section id="wasm-ion-baldrmonkey"> <h4>WASM-Ion (BaldrMonkey)<a class="headerlink" href="https://firefox--source--docs-mozilla-org.translate.goog/js/index.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB#wasm-ion-baldrmonkey" title="Link to this heading">¶</a></h4> <p>This engine translates the WASM input into same <em>MIR</em> form that <em>WarpMonkey</em> uses and uses the <em>IonBackend</em> to optimize. These optimizations (and in particular, the register allocation) generate very fast native machine code.</p> </section> </section> </section> </section> </div> </div> <footer> <div class="rst-footer-buttons" role="navigation" aria-label="Footer"><a href="https://firefox--source--docs-mozilla-org.translate.goog/toolkit/components/translations/resources/03_bergamot.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB" class="btn btn-neutral float-left" title="The Bergamot Translator" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> <a href="https://firefox--source--docs-mozilla-org.translate.goog/js/build.html?_x_tr_sl=pl&amp;_x_tr_tl=tr&amp;_x_tr_hl=en-GB" class="btn btn-neutral float-right" title="Building and testing SpiderMonkey" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> </div> <hr> <div role="contentinfo"> <p></p> </div> Built with <a href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://www.sphinx-doc.org/">Sphinx</a> using a <a href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://translate.google.com/website?sl=pl&amp;tl=tr&amp;hl=en-GB&amp;u=https://readthedocs.org">Read the Docs</a>. </footer> </div> </div> </section> </div> <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); </script> <script>function gtElInit() {var lib = new google.translate.TranslateService();lib.translatePage('pl', 'tr', function () {});}</script> <script src="https://translate.google.com/translate_a/element.js?cb=gtElInit&amp;hl=en-GB&amp;client=wt" type="text/javascript"></script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10