Title: [117150] branches/safari-536-branch/Source/_javascript_Core

Diff

Modified: branches/safari-536-branch/Source/_javascript_Core/API/JSContextRef.cpp (117149 => 117150)


--- branches/safari-536-branch/Source/_javascript_Core/API/JSContextRef.cpp	2012-05-15 21:02:59 UTC (rev 117149)
+++ branches/safari-536-branch/Source/_javascript_Core/API/JSContextRef.cpp	2012-05-15 21:04:41 UTC (rev 117150)
@@ -38,6 +38,12 @@
 #include "UStringBuilder.h"
 #include <wtf/text/StringHash.h>
 
+#if OS(DARWIN)
+#include <mach-o/dyld.h>
+
+static const int32_t webkitFirstVersionWithConcurrentGlobalContexts = 0x2100500; // 528.5.0
+#endif
+
 using namespace JSC;
 
 // From the API's perspective, a context group remains alive iff
@@ -67,6 +73,16 @@
 JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass)
 {
     initializeThreading();
+
+#if OS(DARWIN)
+    // If the application was linked before JSGlobalContextCreate was changed to use a unique JSGlobalData,
+    // we use a shared one for backwards compatibility.
+    if (NSVersionOfLinkTimeLibrary("_javascript_Core") <= webkitFirstVersionWithConcurrentGlobalContexts) {
+        JSLock lock(LockForReal);
+        return JSGlobalContextCreateInGroup(toRef(&JSGlobalData::sharedInstance()), globalObjectClass);
+    }
+#endif // OS(DARWIN)
+
     return JSGlobalContextCreateInGroup(0, globalObjectClass);
 }
 

Modified: branches/safari-536-branch/Source/_javascript_Core/ChangeLog (117149 => 117150)


--- branches/safari-536-branch/Source/_javascript_Core/ChangeLog	2012-05-15 21:02:59 UTC (rev 117149)
+++ branches/safari-536-branch/Source/_javascript_Core/ChangeLog	2012-05-15 21:04:41 UTC (rev 117150)
@@ -1,5 +1,23 @@
 2012-05-15  Lucas Forschler  <[email protected]>
 
+    Merge 116809
+
+    2012-05-11  Geoffrey Garen  <[email protected]>
+
+            Clarified JSGlobalData (_javascript_ VM) lifetime
+            https://bugs.webkit.org/show_bug.cgi?id=85142
+
+            Reviewed by Alexey Proskuryakov.
+
+            (Follow-up fix.)
+
+            * API/JSContextRef.cpp:
+            (JSGlobalContextCreate): Restored some code I removed because I misread an #ifdef.
+            (We don't need to test BUILDING_ON_LEOPARD, but we still need the linked-on
+            test, because apps might have been linked on older OS's.)
+
+2012-05-15  Lucas Forschler  <[email protected]>
+
     Merge 116813
 
     2012-05-11  Filip Pizlo  <[email protected]>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to