Changeset 167181 in webkit


Ignore:
Timestamp:
Apr 11, 2014 10:59:34 PM (10 years ago)
Author:
akling@apple.com
Message:

Make NodeList.length inline-cacheable by JSC.
<https://webkit.org/b/131579>

For objects with custom index or name getters, we have to make sure
that builtin properties take precedence. We do this by scanning the
ancestor chain for a suitable property slot before moving on to
named items.

With this patch, we now mark such builtins as cacheable. This is
safe since the whole point of doing this before processing named
items is to ensure the same slot is returned consistently.

Reviewed by Benjamin Poulain.

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateGetOwnPropertySlotBody):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r167177 r167181  
     12014-04-11  Andreas Kling  <akling@apple.com>
     2
     3        Make NodeList.length inline-cacheable by JSC.
     4        <https://webkit.org/b/131579>
     5
     6        For objects with custom index or name getters, we have to make sure
     7        that builtin properties take precedence. We do this by scanning the
     8        ancestor chain for a suitable property slot before moving on to
     9        named items.
     10
     11        With this patch, we now mark such builtins as cacheable. This is
     12        safe since the whole point of doing this before processing named
     13        items is to ensure the same slot is returned consistently.
     14
     15        Reviewed by Benjamin Poulain.
     16
     17        * bindings/scripts/CodeGeneratorJS.pm:
     18        (GenerateGetOwnPropertySlotBody):
     19
    1202014-04-11  Tim Horton  <timothy_horton@apple.com>
    221
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r167175 r167181  
    407407            push(@getOwnPropertySlotImpl, "    const ${namespaceMaybe}HashTableValue* entry = getStaticValueSlotEntryWithoutCaching<$className>(exec, propertyName);\n");
    408408            push(@getOwnPropertySlotImpl, "    if (entry) {\n");
    409             push(@getOwnPropertySlotImpl, "        slot.setCustom(thisObject, entry->attributes(), entry->propertyGetter());\n");
     409            push(@getOwnPropertySlotImpl, "        slot.setCacheableCustom(thisObject, entry->attributes(), entry->propertyGetter());\n");
    410410            push(@getOwnPropertySlotImpl, "        return true;\n");
    411411            push(@getOwnPropertySlotImpl, "    }\n");
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp

    r167165 r167181  
    152152    const HashTableValue* entry = getStaticValueSlotEntryWithoutCaching<JSTestEventTarget>(exec, propertyName);
    153153    if (entry) {
    154         slot.setCustom(thisObject, entry->attributes(), entry->propertyGetter());
     154        slot.setCacheableCustom(thisObject, entry->attributes(), entry->propertyGetter());
    155155        return true;
    156156    }
Note: See TracChangeset for help on using the changeset viewer.