Title: [201340] trunk/Source/_javascript_Core
Revision
201340
Author
[email protected]
Date
2016-05-24 12:01:35 -0700 (Tue, 24 May 2016)

Log Message

Map should not be in JSGlobalObject's static hashtable because it's initialized eagerly via FOR_EACH_SIMPLE_BUILTIN_TYPE_WITH_CONSTRUCTOR
https://bugs.webkit.org/show_bug.cgi?id=158031
rdar://problem/26353661

Reviewed by Geoffrey Garen.
        
We were listing Map as being a lazy class structure. It's not. m_mapStructure is a WriteBarrier<>
not a LazyClassStructure<> and there is nothing lazy about it.

* runtime/JSGlobalObject.cpp: The fix is to remove Map here.
* runtime/Lookup.cpp: Add some dumping on the assert path.
(JSC::setUpStaticFunctionSlot):
* tests/stress/override-map-constructor.js: Added. This test used to crash.
(Map):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (201339 => 201340)


--- trunk/Source/_javascript_Core/ChangeLog	2016-05-24 19:00:51 UTC (rev 201339)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-05-24 19:01:35 UTC (rev 201340)
@@ -1,5 +1,22 @@
 2016-05-24  Filip Pizlo  <[email protected]>
 
+        Map should not be in JSGlobalObject's static hashtable because it's initialized eagerly via FOR_EACH_SIMPLE_BUILTIN_TYPE_WITH_CONSTRUCTOR
+        https://bugs.webkit.org/show_bug.cgi?id=158031
+        rdar://problem/26353661
+
+        Reviewed by Geoffrey Garen.
+        
+        We were listing Map as being a lazy class structure. It's not. m_mapStructure is a WriteBarrier<>
+        not a LazyClassStructure<> and there is nothing lazy about it.
+
+        * runtime/JSGlobalObject.cpp: The fix is to remove Map here.
+        * runtime/Lookup.cpp: Add some dumping on the assert path.
+        (JSC::setUpStaticFunctionSlot):
+        * tests/stress/override-map-constructor.js: Added. This test used to crash.
+        (Map):
+
+2016-05-24  Filip Pizlo  <[email protected]>
+
         LLInt64 should have typed array fast paths for get_by_val
         https://bugs.webkit.org/show_bug.cgi?id=157931
 

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp (201339 => 201340)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2016-05-24 19:00:51 UTC (rev 201339)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2016-05-24 19:01:35 UTC (rev 201340)
@@ -239,7 +239,6 @@
   Float64Array          JSGlobalObject::m_typedArrayFloat64          DontEnum|ClassStructure
   DataView              JSGlobalObject::m_typedArrayDataView         DontEnum|ClassStructure
   Set                   JSGlobalObject::m_setStructure               DontEnum|ClassStructure
-  Map                   JSGlobalObject::m_mapStructure               DontEnum|ClassStructure
   Date                  JSGlobalObject::m_dateStructure              DontEnum|ClassStructure
   Boolean               JSGlobalObject::m_booleanObjectStructure     DontEnum|ClassStructure
   Number                JSGlobalObject::m_numberObjectStructure      DontEnum|ClassStructure

Modified: trunk/Source/_javascript_Core/runtime/Lookup.cpp (201339 => 201340)


--- trunk/Source/_javascript_Core/runtime/Lookup.cpp	2016-05-24 19:00:51 UTC (rev 201339)
+++ trunk/Source/_javascript_Core/runtime/Lookup.cpp	2016-05-24 19:01:35 UTC (rev 201340)
@@ -77,11 +77,16 @@
         } else if (entry->attributes() & PropertyCallback) {
             JSValue result = entry->lazyPropertyCallback()(vm, thisObj);
             thisObj->putDirect(vm, propertyName, result, attributesForStructure(entry->attributes()));
-        } else
+        } else {
+            dataLog("Static hashtable entry for ", propertyName, " has weird attributes: ", entry->attributes(), "\n");
             RELEASE_ASSERT_NOT_REACHED();
+        }
 
         offset = thisObj->getDirectOffset(vm, propertyName, attributes);
-        RELEASE_ASSERT(isValidOffset(offset));
+        if (!isValidOffset(offset)) {
+            dataLog("Static hashtable initialiation for ", propertyName, " did not produce a property.\n");
+            RELEASE_ASSERT_NOT_REACHED();
+        }
     }
 
     if (isAccessor)

Added: trunk/Source/_javascript_Core/tests/stress/override-map-constructor.js (0 => 201340)


--- trunk/Source/_javascript_Core/tests/stress/override-map-constructor.js	                        (rev 0)
+++ trunk/Source/_javascript_Core/tests/stress/override-map-constructor.js	2016-05-24 19:01:35 UTC (rev 201340)
@@ -0,0 +1,2 @@
+function Map() {
+}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to