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

Changeset 284715 in webkit


Ignore:
Timestamp:
Oct 22, 2021, 2:47:34 PM (5 years ago)
Author:
mark.lam@apple.com
Message:

Change Heap::writeBarrier() to do the cheaper check first.
https://bugs.webkit.org/show_bug.cgi?id=232172

Reviewed by Robin Morisset.

It's cheaper to do a check using incoming args (which are already loaded in
registers) than to do a check which requires memory loads.

  • heap/HeapInlines.h:

(JSC::Heap::writeBarrier):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r284702 r284715  
     12021-10-22  Mark Lam  <mark.lam@apple.com>
     2
     3        Change Heap::writeBarrier() to do the cheaper check first.
     4        https://bugs.webkit.org/show_bug.cgi?id=232172
     5
     6        Reviewed by Robin Morisset.
     7
     8        It's cheaper to do a check using incoming args (which are already loaded in
     9        registers) than to do a check which requires memory loads.
     10
     11        * heap/HeapInlines.h:
     12        (JSC::Heap::writeBarrier):
     13
    1142021-10-22  Asumu Takikawa  <asumu@igalia.com>
    215
  • trunk/Source/JavaScriptCore/heap/HeapInlines.h

    r282707 r284715  
    110110    if (!from)
    111111        return;
     112    if (LIKELY(!to))
     113        return;
    112114    if (!isWithinThreshold(from->cellState(), barrierThreshold()))
    113         return;
    114     if (LIKELY(!to))
    115115        return;
    116116    writeBarrierSlowPath(from);
Note: See TracChangeset for help on using the changeset viewer.