From some specific profiling, I noticed we had two inefficiencies:
- ScriptFunction::Call checks HasProperty, but then JS_CallFunctionName calls GetProperty. This is redundant and we can simplify things. I doubt it makes much difference in any practical code, but it's faster.
- We were entering the same context twice for no reason. This was noticeable. Not sure on the speedup here, likely negligible in general.