summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/Structure.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-09-18 15:53:33 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-09-18 15:53:33 +0200
commit6bbb7fbbac94d0f511a7bd0cbd50854ab643bfb2 (patch)
treed9c68d1cca0b3e352f1e438561f3e504e641a08f /Source/JavaScriptCore/runtime/Structure.cpp
parentd0424a769059c84ae20beb3c217812792ea6726b (diff)
downloadqtwebkit-6bbb7fbbac94d0f511a7bd0cbd50854ab643bfb2.tar.gz
Imported WebKit commit c7503cef7ecb236730d1309676ab9fc723fd061d (http://svn.webkit.org/repository/webkit/trunk@128886)
New snapshot with various build fixes
Diffstat (limited to 'Source/JavaScriptCore/runtime/Structure.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/Structure.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/runtime/Structure.cpp b/Source/JavaScriptCore/runtime/Structure.cpp
index c99c6dda4..a59a0860d 100644
--- a/Source/JavaScriptCore/runtime/Structure.cpp
+++ b/Source/JavaScriptCore/runtime/Structure.cpp
@@ -309,6 +309,30 @@ Structure* Structure::addPropertyTransitionToExistingStructure(Structure* struct
return 0;
}
+bool Structure::anyObjectInChainMayInterceptIndexedAccesses() const
+{
+ for (const Structure* current = this; ;) {
+ if (current->mayInterceptIndexedAccesses())
+ return true;
+
+ JSValue prototype = current->storedPrototype();
+ if (prototype.isNull())
+ return false;
+
+ current = asObject(prototype)->structure();
+ }
+}
+
+NonPropertyTransition Structure::suggestedIndexingTransition() const
+{
+ ASSERT(!hasIndexedProperties(indexingType()));
+
+ if (anyObjectInChainMayInterceptIndexedAccesses() || globalObject()->isHavingABadTime())
+ return AllocateSlowPutArrayStorage;
+
+ return AllocateArrayStorage;
+}
+
Structure* Structure::addPropertyTransition(JSGlobalData& globalData, Structure* structure, PropertyName propertyName, unsigned attributes, JSCell* specificValue, PropertyOffset& offset)
{
// If we have a specific function, we may have got to this point if there is