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

Changeset 244007 in webkit


Ignore:
Timestamp:
Apr 8, 2019, 5:39:04 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r243069 - Structure::flattenDictionary() should clear unused property slots.
https://bugs.webkit.org/show_bug.cgi?id=195871
<rdar://problem/48959497>

Reviewed by Michael Saboff.

JSTests:

  • stress/structure-flattenDictionary-should-clear-unused-property-slots.js: Added.

Source/JavaScriptCore:

It currently attempts to do this but fails because it's actually clearing up the
preCapacity region instead. The fix is simply to account for the preCapacity
when computing the start address of the property slots.

  • runtime/Structure.cpp:

(JSC::Structure::flattenDictionaryStructure):

Location:
releases/WebKitGTK/webkit-2.24
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.24/JSTests/ChangeLog

    r242871 r244007  
     12019-03-18  Mark Lam  <mark.lam@apple.com>
     2
     3        Structure::flattenDictionary() should clear unused property slots.
     4        https://bugs.webkit.org/show_bug.cgi?id=195871
     5        <rdar://problem/48959497>
     6
     7        Reviewed by Michael Saboff.
     8
     9        * stress/structure-flattenDictionary-should-clear-unused-property-slots.js: Added.
     10
    1112019-03-12  Mark Lam  <mark.lam@apple.com>
    212
  • releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore/ChangeLog

    r244001 r244007  
     12019-03-18  Mark Lam  <mark.lam@apple.com>
     2
     3        Structure::flattenDictionary() should clear unused property slots.
     4        https://bugs.webkit.org/show_bug.cgi?id=195871
     5        <rdar://problem/48959497>
     6
     7        Reviewed by Michael Saboff.
     8
     9        It currently attempts to do this but fails because it's actually clearing up the
     10        preCapacity region instead.  The fix is simply to account for the preCapacity
     11        when computing the start address of the property slots.
     12
     13        * runtime/Structure.cpp:
     14        (JSC::Structure::flattenDictionaryStructure):
     15
    1162019-04-08  Xan Lopez  <xan@igalia.com>
    217
  • releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore/runtime/Structure.cpp

    r242478 r244007  
    11/*
    2  * Copyright (C) 2008, 2009, 2013-2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2008-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    779779
    780780        Butterfly* butterfly = object->butterfly();
    781         memset(
    782             butterfly->base(butterfly->indexingHeader()->preCapacity(this), beforeOutOfLineCapacity),
    783             0,
    784             (beforeOutOfLineCapacity - outOfLineSize()) * sizeof(EncodedJSValue));
     781        size_t preCapacity = butterfly->indexingHeader()->preCapacity(this);
     782        void* base = butterfly->base(preCapacity, beforeOutOfLineCapacity);
     783        void* startOfPropertyStorageSlots = reinterpret_cast<EncodedJSValue*>(base) + preCapacity;
     784        memset(startOfPropertyStorageSlots, 0, (beforeOutOfLineCapacity - outOfLineSize()) * sizeof(EncodedJSValue));
    785785        checkOffsetConsistency();
    786786    }
Note: See TracChangeset for help on using the changeset viewer.