DescriptionEnsure that generated code for object literals will call Runtime_DefineOrRedefineAccessorProperty only once per accessor property.
To do this, we collect all accessor properties in a first pass and emit code for
defining those properties afterwards in a second pass.
As a finger exercise, the table used for collecting accessors has a (subset of
an) STL-like iterator interface, including STL-like names and operators.
Although C++ is quite verbose here (as usual, but partly this is caused by our
current slightly clumsy classes/templates), things work out quite nicely and it
cleans up some confusion, e.g. a table entry is not an iterator etc.
Everything compiles into very efficient code, e.g. the loop condition 'it !=
accessor_table.end()' compiles into a single 'testl' instruction on ia32.
+1 for using standard APIs!
Committed: https://code.google.com/p/v8/source/detail?r=11051
Patch Set 1 #Patch Set 2 : Rebased. Extraced method. #
Total comments: 8
Patch Set 3 : Rebased and incorporated review comments #Patch Set 4 : Rebased and incorporated review comments #
Total comments: 4
Patch Set 5 : Rebased #
Total comments: 1
Messages
Total messages: 7 (0 generated)
|