3 ms·
> So why do CPUs not have special instructions to accelerate common OOP GC language operations? ARM kind of tried with Jazelle and ThumbEE and it turns out not
by duped 3y ago
> So why do CPUs not have special instructions to accelerate common OOP GC language operations?
ARM kind of tried with Jazelle and ThumbEE and it turns out not to be that useful. It's much more economical to make the CPU as a whole faster rather than burning up precious die space for hardware that's only used some of the time, and only has marginal benefits.
There's also the human factor that if you actually want a JIT/interpreter to use your special sauce you will probably need to patch that runtime yourself, because it's not likely that the developers are just going to rip up their code generator unless it's really simple to do or presents massive gains.
> Could they just give the data structure for a closure an extra scratchpad for numeric values that are raw and untagged with no extra stuff required?
This is called "unboxing" and pretty much every optimizing runtime will do it in some way. But saving in memory and looking it up later is a lot more expensive than arithmetic in general.