4 ms·
In a related bit of cleverness I've heard that the JVM doesn't actually put NULL checks in it's generated ASM, instead it installs a SIGSEGV handler that catchs
by kingkilr 17y ago
In a related bit of cleverness I've heard that the JVM doesn't actually put NULL checks in it's generated ASM, instead it installs a SIGSEGV handler that catchs the null pointer exception and does the right thing.
- barrkel 17y agoAnd C# on .NET disallows non-virtual method calls on null instance locations. It does so by emitting a callvirt IL instruction for the non-virtual method, which in turn is translated by the CLR to: cmp dword ptr [ecx],ecx (Assuming 'this' is in ecx.)