Title: [237821] trunk/Source/_javascript_Core
Revision
237821
Author
[email protected]
Date
2018-11-05 11:21:36 -0800 (Mon, 05 Nov 2018)

Log Message

Make static_asserts in APICast into bitwise_cast
https://bugs.webkit.org/show_bug.cgi?id=191272

Reviewed by Filip Pizlo.

* API/APICast.h:
(toJS):
(toJSForGC):
(toRef):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/API/APICast.h (237820 => 237821)


--- trunk/Source/_javascript_Core/API/APICast.h	2018-11-05 19:18:05 UTC (rev 237820)
+++ trunk/Source/_javascript_Core/API/APICast.h	2018-11-05 19:21:36 UTC (rev 237821)
@@ -79,8 +79,7 @@
     else
         result = jsCell;
 #else
-    static_assert(sizeof(OpaqueJSValue*) == sizeof(JSC::JSValue), "JSValue needs to fit into a boxed pointer");
-    JSC::JSValue result = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(const_cast<OpaqueJSValue*>(v)));
+    JSC::JSValue result = bitwise_cast<JSC::JSValue>(v);
 #endif
     if (!result)
         return JSC::jsNull();
@@ -98,8 +97,7 @@
         return JSC::JSValue();
     JSC::JSValue result = jsCell;
 #else
-    static_assert(sizeof(OpaqueJSValue*) == sizeof(JSC::JSValue), "JSValue needs to fit into a boxed pointer");
-    JSC::JSValue result = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(const_cast<OpaqueJSValue*>(v)));
+    JSC::JSValue result = bitwise_cast<JSC::JSValue>(v);
 #endif
     if (result && result.isCell())
         RELEASE_ASSERT(result.asCell()->methodTable(exec->vm()));
@@ -140,9 +138,8 @@
         return reinterpret_cast<JSValueRef>(JSC::jsAPIValueWrapper(exec, v).asCell());
     return reinterpret_cast<JSValueRef>(v.asCell());
 #else
-    static_assert(sizeof(OpaqueJSValue*) == sizeof(JSC::JSValue), "JSValue needs to fit into a boxed pointer");
     UNUSED_PARAM(exec);
-    return reinterpret_cast<JSValueRef>(JSC::JSValue::encode(v));
+    return bitwise_cast<JSValueRef>(v);
 #endif
 }
 

Modified: trunk/Source/_javascript_Core/ChangeLog (237820 => 237821)


--- trunk/Source/_javascript_Core/ChangeLog	2018-11-05 19:18:05 UTC (rev 237820)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-11-05 19:21:36 UTC (rev 237821)
@@ -1,3 +1,15 @@
+2018-11-05  Keith Miller  <[email protected]>
+
+        Make static_asserts in APICast into bitwise_cast
+        https://bugs.webkit.org/show_bug.cgi?id=191272
+
+        Reviewed by Filip Pizlo.
+
+        * API/APICast.h:
+        (toJS):
+        (toJSForGC):
+        (toRef):
+
 2018-11-05  Dominik Infuehr  <[email protected]>
 
         Enable LLInt on ARMv7/Linux
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to