Title: [166376] trunk/Source/_javascript_Core
Revision
166376
Author
[email protected]
Date
2014-03-27 15:39:00 -0700 (Thu, 27 Mar 2014)

Log Message

Avoid fetching JSObject::structure() repeatedly in putDirectInternal.
<https://webkit.org/b/130857>

Use the cached Structure* instead of re-fetching it over and over since
that's a non-trivial operation these days.

Reviewed by Mark Hahnenberg.

* runtime/JSObject.h:
(JSC::JSObject::putDirectInternal):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (166375 => 166376)


--- trunk/Source/_javascript_Core/ChangeLog	2014-03-27 22:34:23 UTC (rev 166375)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-03-27 22:39:00 UTC (rev 166376)
@@ -1,3 +1,16 @@
+2014-03-27  Andreas Kling  <[email protected]>
+
+        Avoid fetching JSObject::structure() repeatedly in putDirectInternal.
+        <https://webkit.org/b/130857>
+
+        Use the cached Structure* instead of re-fetching it over and over since
+        that's a non-trivial operation these days.
+
+        Reviewed by Mark Hahnenberg.
+
+        * runtime/JSObject.h:
+        (JSC::JSObject::putDirectInternal):
+
 2014-03-27  Mark Hahnenberg  <[email protected]>
 
         Check the remembered set bit faster

Modified: trunk/Source/_javascript_Core/runtime/JSObject.h (166375 => 166376)


--- trunk/Source/_javascript_Core/runtime/JSObject.h	2014-03-27 22:34:23 UTC (rev 166375)
+++ trunk/Source/_javascript_Core/runtime/JSObject.h	2014-03-27 22:39:00 UTC (rev 166376)
@@ -1325,35 +1325,35 @@
 
         DeferGC deferGC(vm.heap);
         Butterfly* newButterfly = butterfly();
-        if (this->structure()->putWillGrowOutOfLineStorage())
-            newButterfly = growOutOfLineStorage(vm, this->structure()->outOfLineCapacity(), this->structure()->suggestedNewOutOfLineStorageCapacity());
-        offset = this->structure()->addPropertyWithoutTransition(vm, propertyName, attributes, specificFunction);
-        setStructureAndButterfly(vm, this->structure(), newButterfly);
+        if (structure->putWillGrowOutOfLineStorage())
+            newButterfly = growOutOfLineStorage(vm, structure->outOfLineCapacity(), structure->suggestedNewOutOfLineStorageCapacity());
+        offset = structure->addPropertyWithoutTransition(vm, propertyName, attributes, specificFunction);
+        setStructureAndButterfly(vm, structure, newButterfly);
 
         validateOffset(offset);
-        ASSERT(this->structure()->isValidOffset(offset));
+        ASSERT(structure->isValidOffset(offset));
         putDirect(vm, offset, value);
         // See comment on setNewProperty call below.
         if (!specificFunction)
             slot.setNewProperty(this, offset);
         if (attributes & ReadOnly)
-            this->structure()->setContainsReadOnlyProperties();
+            structure->setContainsReadOnlyProperties();
         return true;
     }
 
     PropertyOffset offset;
-    size_t currentCapacity = this->structure()->outOfLineCapacity();
-    if (Structure* structure = Structure::addPropertyTransitionToExistingStructure(this->structure(), propertyName, attributes, specificFunction, offset)) {
+    size_t currentCapacity = structure->outOfLineCapacity();
+    if (Structure* newStructure = Structure::addPropertyTransitionToExistingStructure(structure, propertyName, attributes, specificFunction, offset)) {
         DeferGC deferGC(vm.heap);
         Butterfly* newButterfly = butterfly();
-        if (currentCapacity != structure->outOfLineCapacity()) {
-            ASSERT(structure != this->structure());
-            newButterfly = growOutOfLineStorage(vm, currentCapacity, structure->outOfLineCapacity());
+        if (currentCapacity != newStructure->outOfLineCapacity()) {
+            ASSERT(newStructure != structure);
+            newButterfly = growOutOfLineStorage(vm, currentCapacity, newStructure->outOfLineCapacity());
         }
 
         validateOffset(offset);
-        ASSERT(structure->isValidOffset(offset));
-        setStructureAndButterfly(vm, structure, newButterfly);
+        ASSERT(newStructure->isValidOffset(offset));
+        setStructureAndButterfly(vm, newStructure, newButterfly);
         putDirect(vm, offset, value);
         // This is a new property; transitions with specific values are not currently cachable,
         // so leave the slot in an uncachable state.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to