Handle insertion order for simple constructors
authorsgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 2 Feb 2010 13:33:29 +0000 (13:33 +0000)
committersgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 2 Feb 2010 13:33:29 +0000 (13:33 +0000)
commit10910394e6a909dee937b42843e54fbaf5dab86b
tree3f800cc6165ec94044c5ed5375ecae4da8b6e50d
parent8b5387506caa73cbe824382c5a7888664b3addbc
Handle insertion order for simple constructors

When functions only have simple assignments of the form this.x = ... the object is created in generated code without actually calling the constructor. In this case the initial map for the function already contains the properties assigned in the constructor. The field descriptors in this initial map now has an enumeration index assigned to make property enumeration order the insertion order. The insertion order here is the order of the this.x assignments in the code.

BUG=http://crbug.com/3867
TEST=test/mjsunit/regress/regress-crbug-3867.js

Review URL: http://codereview.chromium.org/566016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3768 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/heap.cc
test/mjsunit/regress/regress-crbug-3867.js [new file with mode: 0644]