Welcome to the chapters of . Let’s Understand Chrome V8 1. Checkout, Build 1. 1. System Requirements win 10 64bit, VS2019 community, Git Win 10 64bit, VS2019 community, Git, windows 10 SDK(10.0.19041 and higher) Note: Install SDK separately, do not use VS installer, because the SDK installed with VS installer is incomplete. 1.2. depot_tools Download the depot_tools bundle and extract it somewhere. DO NOT use drag-n-drop or copy-n-paste extract from Explorer, this will not extract the hidden “.git” folder which is necessary for depot_tools to auto-update itself. You can use “Extract all…” from the context menu though. Warning: Add to the start of your PATH (must be ahead of any installs of Python. Note that environment variable names are case insensitive). depot_tools Assuming you unzipped the bundle to , open: Control Panel → System and Security → System → Advanced system settings. C:\src\depot_tools If you have Administrator access, Modify the PATH system variable and put at the front (or at least in front of any directory that might already have a copy of Python or Git). C:\src\depot_tools If you don’t have Administrator access, you can add a user-level PATH environment variable by opening: Control Panel → System and Security → System → Search for “Edit environment variables for your account”. Add at the front. Note: If your system PATH has a Python in it, you will be out of luck. C:\src\depot_tools Also, add a environment variable in the same way, and set it to 0. This tells to use your locally installed version of Visual Studio (by default, will try to use a google-internal version). DEPOT_TOOLS_WIN_TOOLCHAIN depot_tools depot_tools From a shell, run. cmd.exe No Powershell! Note: On the first run, will install all the Windows-specific bits needed to work with the code, including and python. gclient msysgit If you run from a non-cmd shell (e.g., , PowerShell), it may appear to run properly, but , python and other tools may not get installed correctly. gclient cygwin msysgit If you see strange errors with the file system on the first run of , you may want to disable Windows Indexing. gclient 1.3. Get the Code First, configure Git: Create a chromium directory for the checkout and change to it (you can call this whatever you like and put it wherever you like, as long as the full path has no spaces): Fetch V8 fetch v8git pull origin master At least 10GB of free disk space on an NTFS-formatted hard drive. Generate GN project file cd ~\v8\src> gn gen --ide=vs out\default --args="is_component_build = true is_debug = true v8_optimized_debug = false" enable V8 debug, disenable the optimization that interferes with debug. My is below: is_debug = true v8_optimized_debug = false args.gn is_component_build = trueis_debug = truev8_optimized_debug = falsev8_use_snapshot = false 1.4. Build and Run Compile V8 with VS2019 src\out\default — ->all.sln Open it,as shown in Figure 1. In the Solution Explorer, there is the , right-click it to “Set as Startup Project”, and then build. You can see the compilation process in the output window, as shown in Figure 1. v8_hello_world Figure 2 is the call stack of . hello-world.cc In summary, if you see strange errors, maybe related to the SDK version or environment path. 2. Where is our starting point The V8 has huge code, so we need to find an easy way. The source code of V8 is in src, as shown in Figure 3. We start to learn from (it is in the samples directory) as shown in Figure 1. hello-world.cc V8 is the JavaScript engine, the includes initialization, isolate creation, handle creation, JavaScript compilation, and execution. hello-world.cc the easy way is to debug one step by one step. Again, hello-world.cc Okay, my blog is . Please reach out to me if you have any issues. cncyclops.com : qq9123013 : v8blink@outlook.com WeChat Email Also published . here