summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/Structure.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-10-09 18:10:02 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-10-09 18:10:03 +0200
commitee21e513f3ed68af68e529b43c8fda94dfcc49ff (patch)
tree37eff93fb4b1d5de70c99ec290c3a193bf44f9ca /Source/JavaScriptCore/runtime/Structure.cpp
parent880257678ae831d9b79937e8d8533a88a8f8325d (diff)
parentea46a149dc42a48c103833742a7a0d575576c14a (diff)
downloadqtwebkit-ee21e513f3ed68af68e529b43c8fda94dfcc49ff.tar.gz
Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: Ie2225337cb5eef39035146827484496a6b3690b3
Diffstat (limited to 'Source/JavaScriptCore/runtime/Structure.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/Structure.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/runtime/Structure.cpp b/Source/JavaScriptCore/runtime/Structure.cpp
index f551eaecc..950728cca 100644
--- a/Source/JavaScriptCore/runtime/Structure.cpp
+++ b/Source/JavaScriptCore/runtime/Structure.cpp
@@ -649,6 +649,12 @@ Structure* Structure::flattenDictionaryStructure(VM& vm, JSObject* object)
}
m_dictionaryKind = NoneDictionaryKind;
+
+ // If the object had a Butterfly but after flattening/compacting we no longer have need of it,
+ // we need to zero it out because the collector depends on the Structure to know the size for copying.
+ if (object->butterfly() && !this->outOfLineCapacity() && !hasIndexingHeader(this->indexingType()))
+ object->setButterfly(vm, 0, this);
+
return this;
}