Do any languages / compilers utilize the x86 ENTER instruction with a nonzero nesting level?

enter is avoided in practice as it performs quite poorly – see the answers at “enter” vs “push ebp; mov ebp, esp; sub esp, imm” and “leave” vs “mov esp, ebp; pop ebp”. There are a bunch of x86 instructions that are obsolete but are still supported for backwards compatibility reasons – enter is one … Read more

“enter” vs “push ebp; mov ebp, esp; sub esp, imm” and “leave” vs “mov esp, ebp; pop ebp”

There is a performance difference, especially for enter. On modern processors this decodes to some 10 to 20 µops, while the three instruction sequence is about 4 to 6, depending on the architecture. For details consult Agner Fog’s instruction tables. Additionally the enter instruction usually has a quite high latency, for example 8 clocks on … Read more

What is a stack map frame

Java requires all classes that are loaded to be verified, in order to maintain the security of the sandbox and ensure that the code is safe to optimize. Note that this is done on the bytecode level, so the verification does not verify invariants of the Java language, it merely verifies that the bytecode makes … Read more

What is the difference between parent.frame() and parent.env() in R; how do they differ in call by reference?

parent.env is the environment in which a closure (e.g., function) is defined. parent.frame is the environment from which the closure was invoked. f = function() c(f=environment(), defined_in=parent.env(environment()), called_from=parent.frame()) g = function() c(g=environment(), f()) and then > g() $g <environment: 0x14060e8> $f <environment: 0x1405f28> $defined_in <environment: R_GlobalEnv> $called_from <environment: 0x14060e8> I’m not sure when a mere … Read more

Trying to understand gcc option -fomit-frame-pointer

Most smaller functions don’t need a frame pointer – larger functions MAY need one. It’s really about how well the compiler manages to track how the stack is used, and where things are on the stack (local variables, arguments passed to the current function and arguments being prepared for a function about to be called). … Read more