Reviewers: Mads Ager,

Description:
Analyze functions for assignment to this properties.

During parsing functions are analyzed for statements of the form this.x
= ...;. These assignments are categorized in two types: simple and non
simple. The simple ones are where the right hand side is known to be
either a constant or an argument to the function. If a function only
contains statements of this type the property names are collected and
for the simple assignments the index of the argument or the constant
value assigned are stored as well.

When the initial map for a function is created and the function consists
of only this type of assignemnts the initial map is created with a
descriptor array describing these properties which will be known to
always exist in an object created from the function.

The information on this property assignments is not collected during
pre-parsing so if compiling using pre-parse data these optimization
hints are not available.

Next step will be to use the information collected for the simple
assignments to generate constructor code which will create and
initialize the object from this information without calling the code for
the function.

Please review this at http://codereview.chromium.org/172088

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/ast.h
   M     src/codegen.cc
   M     src/heap.cc
   M     src/ia32/builtins-ia32.cc
   M     src/objects-debug.cc
   M     src/objects-inl.h
   M     src/objects.h
   M     src/objects.cc
   M     src/parser.cc
   M     src/runtime.cc
   M     src/v8-counters.h
   M     src/x64/builtins-x64.cc
   A     test/mjsunit/simple-constructor.js



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to