Do some CoW cleanup
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2018 22:57:09 +0000 (22:57 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2018 22:57:09 +0000 (22:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=186896

Reviewed by Mark Lam.

* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::decompressArrayAllocationProfile):
We don't need to WTFMove() ints

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
remove a TODO.

* runtime/JSObject.cpp:
(JSC::JSObject::putByIndex):
We were checking for isCopyOnWrite even after we converted away
from CoW in above code.
(JSC::JSObject::ensureWritableInt32Slow):
Model this in the same way the other ensureWritableXSlow are modeled.

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Source/JavaScriptCore/runtime/JSObject.cpp

index 206d4b5..c70e3fe 100644 (file)
@@ -1,3 +1,25 @@
+2018-06-21  Saam Barati  <sbarati@apple.com>
+
+        Do some CoW cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=186896
+
+        Reviewed by Mark Lam.
+
+        * bytecode/UnlinkedCodeBlock.h:
+        (JSC::UnlinkedCodeBlock::decompressArrayAllocationProfile):
+        We don't need to WTFMove() ints
+
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::parseBlock):
+        remove a TODO.
+
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::putByIndex):
+        We were checking for isCopyOnWrite even after we converted away
+        from CoW in above code.
+        (JSC::JSObject::ensureWritableInt32Slow):
+        Model this in the same way the other ensureWritableXSlow are modeled.
+
 2018-06-20  Keith Miller  <keith_miller@apple.com>
 
         flattenDictionaryStruture needs to zero inline storage.
index 5ae594b..31e5cf1 100644 (file)
@@ -309,7 +309,7 @@ public:
     {
         unsigned profile = (compressedProfile << 8) >> 8;
         IndexingType recommendedIndexingType = compressedProfile >> 24;
-        return std::make_tuple<unsigned, IndexingType>(WTFMove(profile), WTFMove(recommendedIndexingType));
+        return { profile, recommendedIndexingType };
 
     }
     unsigned numberOfObjectAllocationProfiles() { return m_objectAllocationProfileCount; }
index a2f9237..39f7aa6 100644 (file)
@@ -4595,7 +4595,6 @@ void ByteCodeParser::parseBlock(unsigned limit)
             JSImmutableButterfly* immutableButterfly = frozen->cast<JSImmutableButterfly*>();
             NewArrayBufferData data { };
             data.indexingMode = immutableButterfly->indexingMode();
-            // TODO: Do I need this?
             data.vectorLengthHint = immutableButterfly->toButterfly()->vectorLength();
 
             set(VirtualRegister(bytecode.dst()), addToGraph(NewArrayBuffer, OpInfo(frozen), OpInfo(data.asQuadWord)));
index 71598eb..84c078e 100644 (file)
@@ -851,7 +851,7 @@ bool JSObject::putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName,
     }
         
     case ALL_INT32_INDEXING_TYPES: {
-        if (!value.isInt32() || isCopyOnWrite(thisObject->indexingMode())) {
+        if (!value.isInt32()) {
             thisObject->convertInt32ForValue(vm, value);
             return putByIndex(cell, exec, propertyName, value, shouldThrow);
         }
@@ -1478,9 +1478,10 @@ ContiguousJSValues JSObject::ensureWritableInt32Slow(VM& vm)
 {
     ASSERT(inherits(vm, info()));
 
-    if (isCopyOnWrite(indexingMode()) && hasInt32(indexingMode())) {
+    if (isCopyOnWrite(indexingMode())) {
         convertFromCopyOnWrite(vm);
-        return butterfly()->contiguousInt32();
+        if (hasInt32(indexingMode()))
+            return butterfly()->contiguousInt32();
     }
 
     if (structure(vm)->hijacksIndexingHeader())