• svenpanne@chromium.org's avatar
    Ensure that generated code for object literals will call... · c644c4e8
    svenpanne@chromium.org authored
    Ensure 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!
    
    Review URL: https://chromiumcodereview.appspot.com/9691040
    
    git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11051 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
    c644c4e8
zone.h 8.31 KB