Reviewers: Michael Starzinger,

Message:
PTAL.

This CL adds a field EnumLength to the map that indicates the number of valid
enum elements for that map. It changes the generated code to use this field
rather than the length of the cached array.

With the change, we also always create an enum cache and store it, even if
cache_result was indicated to be false. Instead, we just do not set the
enum_length field (we keep it as kInvalidEnumCache). Firstly this reduces the obvious computation to create the enum properties in case the cache "misses". More importantly, by only relying on the EnumLength field, the generated code
for checking if an enum cache is valid gets simplified.

Since we now just rely on kInvalidEnumCache to flag a map to not be "simple
enum", we do not need the empty descriptor array for that anymore. So we can
just set the EnumLength to 0 in case of an empty descriptor array, and load the
empty_fixed_array as its cache. (Or skip the loop altogether, as I do in the
full codegen).

Description:
Use a special EnumLength field to indicate number of valid enum cache values.

This is preparatory work for sharing Enum Caches.


Please review this at https://chromiumcodereview.appspot.com/10824079/

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

Affected files:
  M src/handles.cc
  M src/heap.cc
  M src/hydrogen-instructions.h
  M src/hydrogen.cc
  M src/ia32/full-codegen-ia32.cc
  M src/ia32/lithium-codegen-ia32.cc
  M src/ia32/lithium-ia32.h
  M src/ia32/lithium-ia32.cc
  M src/ia32/macro-assembler-ia32.h
  M src/ia32/macro-assembler-ia32.cc
  M src/objects.h
  M src/objects.cc
  M src/utils.h
  M src/x64/full-codegen-x64.cc
  M src/x64/lithium-codegen-x64.cc
  M src/x64/lithium-x64.h
  M src/x64/lithium-x64.cc
  M src/x64/macro-assembler-x64.h
  M src/x64/macro-assembler-x64.cc


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

Reply via email to