ChakraCore is the core part of the Chakra JavaScript engine that powers Microsoft Edge
Nhat Nguyen
Nhat Nguyen [MERGE #5861 @nhat-nguyen] Lazy bailout
Merge pull request #5861 from nhat-nguyen:lazybailout

## Overview
+ Eager fixed field checks are no longer generated thanks to lazy bailout
    + Lazy bailout should work for both user JavaScript calls and runtime helper calls
        + Operations that have implicit calls (like getter/setter) are also guarded by lazy bailout
    + Lazy bailout points are inserted in the forward pass and removed if not needed during backward pass
    + For helper calls, we copy the `BailOutInfo` from the bailout path to the call to helper so that the register allocator can fill it correctly
    + Jit'd frames on the stack that depend on fixed fields are invalidated by changing their return addresses to a common lazy bailout thunk per function. The thunk is responsible for cleaning up the stack, loading the right `BailOutRecord` for each bailout point, and finally calls to the bailout code. Other jit'd functions are invalidated normally

+ Support x86/ARM/ARM64 as lazy bailout only works on x64 for now
+ `NewScObjArray` helper path needs rework
+ Instead of having `BailOnNotNativeArray` directly on `NewScObjArray`, insert it on a bailout instruction before `NewScObjArray`
+ Support Out-of-proc jit
+ Lower `BailOnImplicitCallPreOp` when we need to attach lazy bailout to instructions that already have preop bailouts
+ Investigate instructions that have helper path but don't go through `ChangeToHelperCall`
+ Stack clean up for x86 in lazy bailout thunk
+ Support `SaveAllRegisterAndBranchBailOut` variant in the thunk
+ `pdf.js` bug
Latest commit 8527dc2 Dec 14, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
Build [1.11>master] [1.10>1.11] [MERGE #5787 @Cellule] Merge changes from W… Oct 23, 2018
bin surface oop jit on windows builds of chakracore Nov 20, 2018
deps/Chakra.ICU Update Chakra.ICU to support ICU 62.1 Aug 28, 2018
jenkins Add check for non-ascii Sep 1, 2018
lib [MERGE #5861 @nhat-nguyen] Lazy bailout Dec 15, 2018
manifests [1.11>master] [1.10>1.11] [MERGE #5787 @Cellule] Merge changes from W… Oct 23, 2018
pal attributs -> attributes Nov 29, 2018
test This optimization groups bailout instrs (created by the inliner when … Dec 13, 2018
tools Keep memory usage under control when running compile_clang Nov 13, 2018
.gitattributes Revert "Update .gitattributes" Dec 21, 2017
.gitignore Add ClangCL VcBuild directory to gitignore Jul 18, 2018
CMakeLists.txt Add ccache option to CMakeLists.txt and Mar 14, 2018 rename 'Your first PR' to 'good first issue' (See #3938 Oct 17, 2017
LICENSE.txt LICENSE: Remove project name from line 1 Nov 28, 2017 fix link Dec 11, 2018
RegenAllByteCode.cmd Implement the prototype of JS built in Array.prototype.indexOf Nov 3, 2017
RegenAllByteCodeNoBuild.cmd Remove duplicate bytecode generation Aug 13, 2018
THIRD-PARTY-NOTICES.txt add third party notice May 7, 2018 update the build script to support LLVM > 9 Sep 11, 2018
netci.groovy [1.11>master] [1.10>1.11] [MERGE #5758 @sethbrenith] Use different ma… Oct 5, 2018


Join the chat at Licensed under the MIT License PR's Welcome

ChakraCore is the core part of Chakra, the high-performance JavaScript engine that powers Microsoft Edge and Windows applications written in HTML/CSS/JS. ChakraCore supports Just-in-time (JIT) compilation of JavaScript for x86/x64/ARM, garbage collection, and a wide range of the latest JavaScript features. ChakraCore also supports the JavaScript Runtime (JSRT) APIs, which allows you to easily embed ChakraCore in your applications.

You can stay up-to-date on progress by following the MSEdge developer blog.

Build Status

Debug Test Release
Windows (x64) x64debug x64test x64release
Windows (x86) x86debug x86test x86release
Windows (ARM) armdebug armtest armrelease
Ubuntu 16.04 (x64)[a] linux_a_debug linux_a_test linux_a_release
Ubuntu 16.04 (x64)[s] linux_s_debug linux_s_test linux_s_release
Ubuntu 16.04 (x64)[s][n] * linux_sn_test *
OS X 10.9 (x64)[a] osx_a_debug osx_a_test osx_a_release
OS X 10.9 (x64)[s][n] * osx_sn_test *

[a] Static | [s] Shared | [n] NoJIT | * Omitted

Above is a table of our rolling build status. We run additional builds on a daily basis. See Build Status for the status of all builds and additional details.


If you believe you have found a security issue in ChakraCore, please share it with us privately following the guidance at the Microsoft Security TechCenter. Reporting it via this channel helps minimize risk to projects built with ChakraCore.


Building ChakraCore

You can build ChakraCore on Windows 7 SP1 or above, and Windows Server 2008 R2 or above, with either Visual Studio 2015 or 2017 with C++ support installed. Once you have Visual Studio installed:

  • Clone ChakraCore through git clone
  • Open Build\Chakra.Core.sln in Visual Studio
  • Build Solution

More details in Building ChakraCore.

Alternatively, see Getting ChakraCore binaries for pre-built ChakraCore binaries.

Using ChakraCore

Once built, you have a few options for how you can use ChakraCore:

  • The most basic is to test the engine is running correctly with the ch.exe binary. This app is a lightweight hosting of JSRT that you can use to run small applications. After building, you can find this binary in:
    • Build\VcBuild\bin\${platform}_${configuration}
    • (e.g. Build\VcBuild\bin\x64_debug)
  • You can embed ChakraCore in your applications - see documentation and samples.
  • Finally, you can also use ChakraCore as the JavaScript engine in Node. You can learn more by reading how to use Chakra as Node's JS engine

A note about using ChakraCore: ChakraCore is the foundational JavaScript engine, but it does not include the external APIs that make up the modern JavaScript development experience. For example, DOM APIs like document.write() are additional APIs that are not available by default and would need to be provided. For debugging, you may instead want to use print().


Contributions to ChakraCore are welcome. Here is how you can contribute to ChakraCore:

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.

Please refer to Contribution Guidelines for more details.


Code licensed under the MIT License.


For details on our planned features and future direction please refer to our Roadmap.

Contact Us

If you have questions about ChakraCore, or you would like to reach out to us about an issue you're having or for development advice as you work on a ChakraCore issue, you can reach us as follows:

  • Open an issue and prefix the issue title with [Question]. See Question tag for already-opened questions.
  • Discuss ChakraCore with the team and the community on our Gitter Channel.
  • You can also start private messages with individual ChakraCore developers via Gitter.