Maybe it would be wise to keep my question less specific. What I really
want to know is: is there any possible way to define the conditions for the
optimization so that they do not break down when properties are added? The
alternative is rather gruesome to think about -- that it is not safe to
extend classes or otherwise use objects that do not have identical
transition trees in perf-sensitive code. I'm currently writing a parser,
and to work around that limitation I'd need to write this code!
{
type: 'NodeType',
prop1: ...,
prop2: ...,
prop3: ...,
prop4: ...,
prop5: ...,
// hope more than 6 properties are never needed
}
buildIfStatement(test, consequent, alternate) {
return {
type 'IfStatement',
prop1: test,
prop2: consequent,
prop3: alternate,
prop4: null,
prop5: null,
}
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/v8-dev/3e87edc1-91f9-4ed5-8de7-a863bfa45994n%40googlegroups.com.