In this post, we will dive into how ECMAScript engines store variables,| boajs.dev
Background| Performance is a Feature!
As the saying goes:| Performance is a Feature!
What is ‘stack walking’, well as always the ‘Book of the Runtime’ (BotR) helps us, from the relevant page:| Performance is a Feature!
It seems like this time of year anyone with a blog is doing some sort of ‘advent calendar’, i.e. 24 posts leading up to Christmas. For instance there’s a F# one which inspired a C# one (C# copying from F#, that never happens 😉)| Performance is a Feature!
.NET is a managed runtime, which means that it provides high-level features that ‘manage’ your program for you, from Introduction to the Common Language Runtime (CLR) (written in 2007):| Performance is a Feature!
I’m constantly surprised at just how popular resources related to ‘.NET Internals’ are, for instance take this tweet and the thread that followed:| Performance is a Feature!
I’ve been digging into .NET Internals for a while now, but never really looked closely at how the ‘Just-in-Time’ (JIT) compiler works. In my mind, the interaction between the .NET Runtime and the JIT has always looked like this:| Performance is a Feature!
Whether you want to look at what your code is doing ‘under-the-hood’ or you’re trying to see what the ‘internals’ of the CLR look like, there is a whole range of tools that can help you out.| Performance is a Feature!
Firstly, what exactly is CoreRT? From its GitHub repo:| Performance is a Feature!
It turns out that the .NET Runtime has a technical standard (or specification), known by its full name ECMA-335 - Common Language Infrastructure (CLI) (not to be confused with ECMA-334 which is the ‘C# Language Specification’). The latest update is the 6th edition from June 2012.| Performance is a Feature!
I recently appeared on Herding Code and Stackify ‘Developer Things’ podcasts and in both cases, the first question asked was ‘how do you figure out the internals of the .NET runtime’?| Performance is a Feature!
Discuss this post on HackerNews and /r/programming| Performance is a Feature!
It all started with a tweet, which seemed to resonate with people:| Performance is a Feature!
The .NET runtime (CLR) has predominantly used a just-in-time (JIT) compiler to convert your executable into machine code (leaving aside ahead-of-time (AOT) scenarios for the time being), as the official Microsoft docs say:| Performance is a Feature!
If you grew up in the UK and went to school during the 1980’s or 1990’s there’s a good chance that this picture brings back fond memories:| Performance is a Feature!
Recently I was listening to the excellent DotNetRocks podcast and they had Steven Sanderson (of Knockout.js fame) talking about ‘WebAssembly and Blazor’.| Performance is a Feature!
It’s a fundamental part of .NET and can often happen without you knowing, but how does it actually work? What is the .NET Runtime doing to make boxing possible?| Performance is a Feature!
Have you ever wondered where and why the .NET Runtime (CLR) allocates memory? I don’t mean the ‘managed’ memory that your code allocates, e.g. via new MyClass(..) and the Garbage Collector (GC) then cleans up. I mean the memory that the CLR itself allocates, all the internal data structures that it needs to make is possible for your code to run.| Performance is a Feature!
It is something we take for granted every time we run a .NET program, but it turns out that loading a Type or class is a fairly complex process.| Performance is a Feature!
Now that the CoreCLR is open-source we can do fun things, for instance find out if it’s possible to add new IL (Intermediate Language) instruction to the runtime.| Performance is a Feature!
A while ago I wrote about the ‘special relationship’ that exists between Strings and the CLR, well it turns out that Arrays and the CLR have an even deeper one, the type of closeness where you hold hands on your first meeting| Performance is a Feature!
Because the CLR is a managed environment there are several components within the runtime that need to be initialised before any of your code can be executed. This post will take a look at the EE (Execution Engine) start-up routine and examine the initialisation process in detail.| Performance is a Feature!
Delegates are a fundamental part of the .NET runtime and whilst you rarely create them directly, they are there under-the-hood every time you use a lambda in LINQ (=>) or a Func<T>/Action<T> to make your code more functional. But how do they actually work and what’s going in the CLR when you use them?| Performance is a Feature!
According to the NASA ‘Near Earth Object Program’ asteroid ‘101955 Bennu (1999 RQ36)’ has a Cumulative Impact Probability of 3.7e-04, i.e. there is a 1 in 2,700 (0.0370%) chance of Earth impact, but more reassuringly there is a 99.9630% chance the asteroid will miss the Earth completely!| Performance is a Feature!
It’s common knowledge that reflection in .NET is slow, but why is that the case? This post aims to figure that out by looking at what reflection does under-the-hood.| Performance is a Feature!
Well it turns out that it’s a really nice example of collaboration between the main parts of the .NET runtime, here’s a list of all the components involved:| Performance is a Feature!
In the CLR strings are stored as a sequence of UTF-16 code units, i.e. an array of char items. So if we have the string ‘testing’, in memory it looks like this:| Performance is a Feature!
Strings and the Common Language Runtime (CLR) have a special relationship, but it’s a bit different (and way less political) than the UK <-> US special relationship that is often talked about.| Performance is a Feature!
This post explores the implementation of dotnet.exe, specifically focusing on how the hostfxr library is resolved and loaded.| Steve Gordon - Code with Steve
This post introduces the dotnet.exe muxer responsible for loading the runtime and the CLI commands, exploring some of its internal code.| Steve Gordon - Code with Steve
Since the last post about it, the dynarec (dynamic recompiler, a Just-In-Time recompilation of x86 code) changed a lot. It still works in four major steps, but now there are a lot more intermediary steps. So let’s see how it works now! Note: this article will focus on the ARM version of the dynarec on…| Box86 / Box64
Note: this article is pretty technical. Basic understanding of what registers are is a strict minimum required to understand what follows. What is AVX? AVX (and its extension AVX2) are complex x86_64 instruction sets which extends the SSE4 instruction set. It mandates the existence of extensions of the 16 SSE 128-bits-wide XMM registers (called XMM0…| Box86 / Box64
| The Grumpy Troll: The Grumpy Troll
Having an overview of the running processes on the operating system is something we usually take for granted. We can’t think of working without fundamental features like that. But how does the kernel keep track of the processes, which are currently running ? Today, we take a look at the corresponding structures of the Windows …Linux/Windows Internals – Process structures Read More »| Malware and Stuff
This blog is about the oracle database wait event ‘reliable message’. It should be noted that normally, this should not be a prominent wait, and if it does so, the most logical cause would be something that is not working as it should, either by oversubscribing something or simply because of a bug. The reliable …Read More| Frits Hoogland Weblog
This blogpost takes a look at the technical differences between Oracle database 11.2.0.4 PSU 200714 (july 2020) and PSU 201020 (october 2020). This gives technical specialists an idea of the differences, and gives them the ability to assess if the PSU impacts anything. Functions This is a poor, yet one of the only ways, to …Read More| Frits Hoogland Weblog
This blogpost takes a look at the technical differences between Oracle database 12.1.0.2 PSU 200714 (july 2020) and PSU 201020 (october 2020). This gives technical specialists an idea of the differences, and gives them the ability to assess if the PSU impacts anything. Functions This is a poor, yet one of the only ways, to …Read More| Frits Hoogland Weblog
This blogpost is about how the oracle database executable created or changed during installation and patching. I take linux for the examples, because that is the version that I am almost uniquely working with. I think the linux operating is where the vast majority of linux installations are installed on, and therefore an explanation with …Read More| Frits Hoogland Weblog
This blogpost takes a look at the technical differences between Oracle database 12.2.0.1 PSU 200714 (july 2020) and PSU 201020 (october 2020). This gives technical specialists an idea of the differences, and gives them the ability to assess if the PSU impacts anything. Functions This is a poor, yet one of the only ways to …Read More| Frits Hoogland Weblog
This blogpost takes a look at the technical differences between Oracle database 18 RU 11 (july 2020) and RU 12 (october 2020). This gives technical specialists an idea of the differences, and gives…| Frits Hoogland Weblog
UPDATE 2023.10.10.: After chatting with Thijs Alkemade, @xnyhps, updated the XPC part of the post as I originally misunderstood Apple’s intent. Apple introduced Launch Constraints in macOS Ventura (13) as a response to some common attack scenarios. LC was probably the most impactful mitigation against various type of vulnerabilities. Before we dwell into LC let’s review a couple of old vulnerabilities, which would have been not exploitable if LC was present.| theevilbit blog