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

Changeset 243576 in webkit


Ignore:
Timestamp:
Mar 27, 2019, 4:43:48 PM (7 years ago)
Author:
Alan Coon
Message:

Cherry-pick r243069. rdar://problem/49308056

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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243069 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-607-branch
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-607-branch/JSTests/ChangeLog

    r243571 r243576  
     12019-03-27  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r243069. rdar://problem/49308056
     4
     5    Structure::flattenDictionary() should clear unused property slots.
     6    https://bugs.webkit.org/show_bug.cgi?id=195871
     7    <rdar://problem/48959497>
     8   
     9    Reviewed by Michael Saboff.
     10   
     11    JSTests:
     12   
     13    * stress/structure-flattenDictionary-should-clear-unused-property-slots.js: Added.
     14   
     15    Source/JavaScriptCore:
     16   
     17    It currently attempts to do this but fails because it's actually clearing up the
     18    preCapacity region instead.  The fix is simply to account for the preCapacity
     19    when computing the start address of the property slots.
     20   
     21    * runtime/Structure.cpp:
     22    (JSC::Structure::flattenDictionaryStructure):
     23   
     24   
     25   
     26    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     27
     28    2019-03-18  Mark Lam  <mark.lam@apple.com>
     29
     30            Structure::flattenDictionary() should clear unused property slots.
     31            https://bugs.webkit.org/show_bug.cgi?id=195871
     32            <rdar://problem/48959497>
     33
     34            Reviewed by Michael Saboff.
     35
     36            * stress/structure-flattenDictionary-should-clear-unused-property-slots.js: Added.
     37
    1382019-03-27  Alan Coon  <alancoon@apple.com>
    239
  • branches/safari-607-branch/Source/JavaScriptCore/ChangeLog

    r243571 r243576  
     12019-03-27  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r243069. rdar://problem/49308056
     4
     5    Structure::flattenDictionary() should clear unused property slots.
     6    https://bugs.webkit.org/show_bug.cgi?id=195871
     7    <rdar://problem/48959497>
     8   
     9    Reviewed by Michael Saboff.
     10   
     11    JSTests:
     12   
     13    * stress/structure-flattenDictionary-should-clear-unused-property-slots.js: Added.
     14   
     15    Source/JavaScriptCore:
     16   
     17    It currently attempts to do this but fails because it's actually clearing up the
     18    preCapacity region instead.  The fix is simply to account for the preCapacity
     19    when computing the start address of the property slots.
     20   
     21    * runtime/Structure.cpp:
     22    (JSC::Structure::flattenDictionaryStructure):
     23   
     24   
     25   
     26    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     27
     28    2019-03-18  Mark Lam  <mark.lam@apple.com>
     29
     30            Structure::flattenDictionary() should clear unused property slots.
     31            https://bugs.webkit.org/show_bug.cgi?id=195871
     32            <rdar://problem/48959497>
     33
     34            Reviewed by Michael Saboff.
     35
     36            It currently attempts to do this but fails because it's actually clearing up the
     37            preCapacity region instead.  The fix is simply to account for the preCapacity
     38            when computing the start address of the property slots.
     39
     40            * runtime/Structure.cpp:
     41            (JSC::Structure::flattenDictionaryStructure):
     42
    1432019-03-27  Alan Coon  <alancoon@apple.com>
    244
  • branches/safari-607-branch/Source/JavaScriptCore/runtime/Structure.cpp

    r240375 r243576  
    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
     
    778778
    779779        Butterfly* butterfly = object->butterfly();
    780         memset(
    781             butterfly->base(butterfly->indexingHeader()->preCapacity(this), beforeOutOfLineCapacity),
    782             0,
    783             (beforeOutOfLineCapacity - outOfLineSize()) * sizeof(EncodedJSValue));
     780        size_t preCapacity = butterfly->indexingHeader()->preCapacity(this);
     781        void* base = butterfly->base(preCapacity, beforeOutOfLineCapacity);
     782        void* startOfPropertyStorageSlots = reinterpret_cast<EncodedJSValue*>(base) + preCapacity;
     783        memset(startOfPropertyStorageSlots, 0, (beforeOutOfLineCapacity - outOfLineSize()) * sizeof(EncodedJSValue));
    784784        checkOffsetConsistency();
    785785    }
Note: See TracChangeset for help on using the changeset viewer.