8E770 馃憢

Welcome to the blog where we dig into how some awesome piece of software work

8080 Emulator

This repo contains worked out tutorials to learn software emulation. The main goal is to write a C based functional 8080 emulator. Post which we will move to emulation Nintendo鈥檚 GameBoy in a separate Repo (or playstation maybe). For now, let鈥檚 get going with the tutorials on Emulator 101. Note: These might changes as I learn more and currently may not be the best way to go about things. But really what is?...

January 15, 2021 路 7 min 路 1405 words 路 Pranay Garg

CSA, Torque & builtins

Introduction & Rational Imagine you were implementing the V8 engine. Your main target is to be able to run the ECMAScript specification for Javascript. This requires reading through the comprehensive specification and implement the required behavior. V8鈥檚 optimizing compiler Turbofan uses a combination of techniques to make long-running code faster with help of type information and optimizations. However, you would still require a good baseline performance for all the functions that ECMAScript defines....

November 14, 2020 路 8 min 路 1612 words 路 Pranay Garg

Exploring V8 Engine - II (Control Flow & Memory Structures)

In this post, we will start our exploration of V8 engine and look under the hood at call sequences that are made to execute a simple 'hello' + 'world' command. This post is a follow up to our Exploring V8 Engine - I post. Setting up release.sample build (monolithic with debug) To test out the V8 embedding, you need a compile your sample hello-world.cc file with the V8 source code. Doing this for each sample would be tedious....

October 15, 2020 路 5 min 路 878 words 路 Pranay Garg

Exploring the V8 engine - I

Exploring the V8 engine - I This post starts our exploration into the V8 sourcecode. We use the hello-world.cc and the embedding process as our starting point and go exploring from there. Introduction V8鈥檚 codebase is no small beast. It keeps getting updated all the time with faster and often changes which refine a huge chunk of internal structures. Our motivation in this post is to understand the basics about the staple objects in V8鈥檚 execution context alongside the basic control flow....

September 23, 2020 路 7 min 路 1287 words 路 Pranay Garg

Chromium C++ Primer for C++98 Folks

Chromium C++ Primer for C++98 Folks lvalues, rvalues, C++11/14 & Chromium({}, auto, constructor: var_name{}, yada, yada, yada 鈥 ) Introduction C++ powers most of the V8 engine. All the memory management logic, Ignition Interpreter, Turbofan (Optimizing compiler) are written in C++. Thus, it鈥檚 very much required for anyone beginning with V8 exploitation to brush up their C++ skills enough to understand V8鈥檚 source code. While a lot of us have run into C++ at some point in our lives, if it wasn鈥檛 in a recent production code (which isn鈥檛 older than you are) there鈥檚 a great chance you never ran into the new, expansive, and a little different world of new features from C++11/14....

September 2, 2020 路 9 min 路 1767 words 路 Pranay Garg