Reviewers: danno,

Message:
Hi!

Please take a look at this change.

Current behavior of TransformPropertiesToFastFor leads to unpredictable
performance for dynamically constructed prototypes. Depending on GC timing
methods on the prototype might end up either as CONSTANT_FUNCTION properties or
as FIELD ones.

Calling methods through a FIELD is much slower then calling a method through a CONSTANT_FUNCTION. Currently hydrogen emits a generic HCallNamed for such case
instead of splitting call into fast field load and invocation and neither
hydrogen does try to inline at such call sites.

Description:
Relax restrictions on CONSTANT_FUNCTION descriptors in
TransformPropertiesToFastFor.

Since r10174 they are not required to be in new space.

[email protected]
BUG=


Please review this at https://codereview.chromium.org/11418181/

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

Affected files:
  M src/objects.cc


Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 8d9f328f431fa71a2c9fd443210656c5983b964c..2601ed1060566ea2175ad9bb5f0f4ea8fb48e1f2 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -13270,8 +13270,7 @@ MaybeObject* StringDictionary::TransformPropertiesToFastFor(
       PropertyType type = DetailsAt(i).type();
       ASSERT(type != FIELD);
       instance_descriptor_length++;
-      if (type == NORMAL &&
-          (!value->IsJSFunction() || heap->InNewSpace(value))) {
+      if (type == NORMAL && !value->IsJSFunction()) {
         number_of_fields += 1;
       }
     }
@@ -13336,7 +13335,7 @@ MaybeObject* StringDictionary::TransformPropertiesToFastFor(
       int enumeration_index = details.descriptor_index();
       PropertyType type = details.type();

-      if (value->IsJSFunction() && !heap->InNewSpace(value)) {
+      if (value->IsJSFunction()) {
         ConstantFunctionDescriptor d(key,
                                      JSFunction::cast(value),
                                      details.attributes(),


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

Reply via email to