Open obastemur opened 7 years ago
true
and false
are potentially useful additions.
I like the idea of sharing more static data between contexts, but I'm concerned that there may be a number of places where the ScriptContext is considered and will lead to us going down slow paths, and that you may run into a bunch of asserts.
but I'm concerned that there may be a number of places where the ScriptContext is considered and will lead to us going down slow paths, and that you may run into a bunch of asserts.
@MikeHolman could you provide more context on this?
The example I'm thinking of is that for property caches, if an object's scriptContext isn't the current context we won't cache it. I think there are a number of places where we will do these type of comparisons.
I see. How your scenario could prevent us from having a single undefined
or null
framework wide? (this is the part I didn't understand though)
I'm having a hard time coming up with anything that will concretely be a problem, so maybe there isn't anything. I just have a feeling that there will be a number of subtle issues.
Currently
null
andundefined
are created perJavascriptLibrary
.JsVar
tonull
orundefined
because we don't know its' origin.JsVar
-> ToRecyc..Object -> Compare... is unnecessarily more complicatedJsVar
is actually aRecyc..Object
hence things are easier (this improvement is already merged to master). Yet, those places are very limitedAny objections to making
null
,undefined
values are allocated per framework only once?Is there anything else that we could use the same approach?