⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 259807 in webkit


Ignore:
Timestamp:
Apr 9, 2020, 10:59:06 AM (6 years ago)
Author:
sbarati@apple.com
Message:

We can still cache delete in strict mode as long as the property is not "non-configurable"
https://bugs.webkit.org/show_bug.cgi?id=210148

Reviewed by Tadeu Zagallo.

JSTests:

  • microbenchmarks/delete-cache-strict-mode.js: Added.

(assert):
(doDel):
(doDelByVal):

Source/JavaScriptCore:

We were incorrectly not inline caching all delete misses in strict mode.
We only must to not cache deletes on non-configurable properties in strict
mode, as that should throw a runtime error. Delete misses can still be cached
in strict mode without any issues. This is a 4x speedup on the microbenchmark.

  • jit/Repatch.cpp:

(JSC::tryCacheDeleteBy):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r259800 r259807  
     12020-04-09  Saam Barati  <sbarati@apple.com>
     2
     3        We can still cache delete in strict mode as long as the property is not "non-configurable"
     4        https://bugs.webkit.org/show_bug.cgi?id=210148
     5
     6        Reviewed by Tadeu Zagallo.
     7
     8        * microbenchmarks/delete-cache-strict-mode.js: Added.
     9        (assert):
     10        (doDel):
     11        (doDelByVal):
     12
    1132020-04-09  Alexey Shvayka  <shvaikalesh@gmail.com>
    214
  • trunk/Source/JavaScriptCore/ChangeLog

    r259803 r259807  
     12020-04-09  Saam Barati  <sbarati@apple.com>
     2
     3        We can still cache delete in strict mode as long as the property is not "non-configurable"
     4        https://bugs.webkit.org/show_bug.cgi?id=210148
     5
     6        Reviewed by Tadeu Zagallo.
     7
     8        We were incorrectly not inline caching all delete misses in strict mode.
     9        We only must to not cache deletes on non-configurable properties in strict
     10        mode, as that should throw a runtime error. Delete misses can still be cached
     11        in strict mode without any issues. This is a 4x speedup on the microbenchmark.
     12
     13        * jit/Repatch.cpp:
     14        (JSC::tryCacheDeleteBy):
     15
    1162020-04-09  Sergio Villar Senin  <svillar@igalia.com>
    217
  • trunk/Source/JavaScriptCore/jit/Repatch.cpp

    r259681 r259807  
    782782            ASSERT(isValidOffset(newOffset));
    783783            newCase = AccessCase::createDelete(vm, codeBlock, propertyName, newOffset, oldStructure, newStructure);
    784         } else if (!ecmaMode.isStrict()) {
    785             if (slot.isNonconfigurable())
    786                 newCase = AccessCase::create(vm, codeBlock, AccessCase::DeleteNonConfigurable, propertyName, invalidOffset, oldStructure, { }, nullptr);
    787             else
    788                 newCase = AccessCase::create(vm, codeBlock, AccessCase::DeleteMiss, propertyName, invalidOffset, oldStructure, { }, nullptr);
    789         }
     784        } else if (slot.isNonconfigurable()) {
     785            if (ecmaMode.isStrict())
     786                return GiveUpOnCache;
     787
     788            newCase = AccessCase::create(vm, codeBlock, AccessCase::DeleteNonConfigurable, propertyName, invalidOffset, oldStructure, { }, nullptr);
     789        } else
     790            newCase = AccessCase::create(vm, codeBlock, AccessCase::DeleteMiss, propertyName, invalidOffset, oldStructure, { }, nullptr);
    790791
    791792        result = stubInfo.addAccessCase(locker, globalObject, codeBlock, propertyName, WTFMove(newCase));
Note: See TracChangeset for help on using the changeset viewer.