Title: [276676] trunk/Source/_javascript_Core
Revision
276676
Author
[email protected]
Date
2021-04-27 15:52:55 -0700 (Tue, 27 Apr 2021)

Log Message

Move ExceptionExpectation into its own .h file.
https://bugs.webkit.org/show_bug.cgi?id=225124

Reviewed by Robin Morisset.

Also fixed some compiler warnings.

* CMakeLists.txt:
* _javascript_Core.xcodeproj/project.pbxproj:
* runtime/ExceptionExpectation.h: Added.
* runtime/ExceptionHelpers.h:
* runtime/HashMapImplInlines.h:
(JSC::jsMapHashImpl):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::setWithSpecificType):
(JSC::JSGenericTypedArrayView<Adaptor>::getOwnPropertySlotByIndex):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/_javascript_Core/CMakeLists.txt (276675 => 276676)


--- trunk/Source/_javascript_Core/CMakeLists.txt	2021-04-27 22:50:36 UTC (rev 276675)
+++ trunk/Source/_javascript_Core/CMakeLists.txt	2021-04-27 22:52:55 UTC (rev 276676)
@@ -896,6 +896,7 @@
     runtime/EvalExecutable.h
     runtime/Exception.h
     runtime/ExceptionEventLocation.h
+    runtime/ExceptionExpectation.h
     runtime/ExceptionHelpers.h
     runtime/ExceptionScope.h
     runtime/ExecutableBase.h

Modified: trunk/Source/_javascript_Core/ChangeLog (276675 => 276676)


--- trunk/Source/_javascript_Core/ChangeLog	2021-04-27 22:50:36 UTC (rev 276675)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-04-27 22:52:55 UTC (rev 276676)
@@ -1,3 +1,22 @@
+2021-04-27  Mark Lam  <[email protected]>
+
+        Move ExceptionExpectation into its own .h file.
+        https://bugs.webkit.org/show_bug.cgi?id=225124
+
+        Reviewed by Robin Morisset.
+
+        Also fixed some compiler warnings.
+
+        * CMakeLists.txt:
+        * _javascript_Core.xcodeproj/project.pbxproj:
+        * runtime/ExceptionExpectation.h: Added.
+        * runtime/ExceptionHelpers.h:
+        * runtime/HashMapImplInlines.h:
+        (JSC::jsMapHashImpl):
+        * runtime/JSGenericTypedArrayViewInlines.h:
+        (JSC::JSGenericTypedArrayView<Adaptor>::setWithSpecificType):
+        (JSC::JSGenericTypedArrayView<Adaptor>::getOwnPropertySlotByIndex):
+
 2021-04-27  Alexey Shvayka  <[email protected]>
 
         [JSC] Remove defaultValue() from the method table

Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (276675 => 276676)


--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2021-04-27 22:50:36 UTC (rev 276675)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2021-04-27 22:52:55 UTC (rev 276676)
@@ -2016,6 +2016,7 @@
 		FEF5B4272628ABD90016E776 /* JSWeakMapInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF5B4262628ABD90016E776 /* JSWeakMapInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		FEF5B4292628B5240016E776 /* JSSetInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF5B4282628B5240016E776 /* JSSetInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		FEF5B42C2628CBC80016E776 /* VMTrapsInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF5B42B2628CBC80016E776 /* VMTrapsInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		FEF5B430262A338B0016E776 /* ExceptionExpectation.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF5B42F262A338B0016E776 /* ExceptionExpectation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		FEFD6FC61D5E7992008F2F0B /* JSStringInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FEFD6FC51D5E7970008F2F0B /* JSStringInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
 /* End PBXBuildFile section */
 
@@ -5427,6 +5428,7 @@
 		FEF5B4262628ABD90016E776 /* JSWeakMapInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWeakMapInlines.h; sourceTree = "<group>"; };
 		FEF5B4282628B5240016E776 /* JSSetInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSetInlines.h; sourceTree = "<group>"; };
 		FEF5B42B2628CBC80016E776 /* VMTrapsInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMTrapsInlines.h; sourceTree = "<group>"; };
+		FEF5B42F262A338B0016E776 /* ExceptionExpectation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExceptionExpectation.h; sourceTree = "<group>"; };
 		FEFD6FC51D5E7970008F2F0B /* JSStringInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStringInlines.h; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
@@ -7345,6 +7347,7 @@
 				FE1C0FFC1B193E9800B53FCA /* Exception.h */,
 				FE80C19A1D7768FD008510C0 /* ExceptionEventLocation.cpp */,
 				FE6029D81D6E1E330030204D /* ExceptionEventLocation.h */,
+				FEF5B42F262A338B0016E776 /* ExceptionExpectation.h */,
 				0F12DE0D1979D5FD0006FF4E /* ExceptionFuzz.cpp */,
 				0F12DE0E1979D5FD0006FF4E /* ExceptionFuzz.h */,
 				1429D8770ED21ACD00B89619 /* ExceptionHelpers.cpp */,
@@ -10744,6 +10747,7 @@
 				ADE8029A1E08F1DE0058DE78 /* WebAssemblyLinkErrorConstructor.h in Headers */,
 				ADE8029C1E08F1DE0058DE78 /* WebAssemblyLinkErrorPrototype.h in Headers */,
 				AD2FCBF51DB58DAD00B3E736 /* WebAssemblyMemoryConstructor.h in Headers */,
+				FEF5B430262A338B0016E776 /* ExceptionExpectation.h in Headers */,
 				AD2FCC1A1DB59CB200B3E736 /* WebAssemblyMemoryConstructor.lut.h in Headers */,
 				AD2FCBF71DB58DAD00B3E736 /* WebAssemblyMemoryPrototype.h in Headers */,
 				AD2FCC1B1DB59CB200B3E736 /* WebAssemblyMemoryPrototype.lut.h in Headers */,

Added: trunk/Source/_javascript_Core/runtime/ExceptionExpectation.h (0 => 276676)


--- trunk/Source/_javascript_Core/runtime/ExceptionExpectation.h	                        (rev 0)
+++ trunk/Source/_javascript_Core/runtime/ExceptionExpectation.h	2021-04-27 22:52:55 UTC (rev 276676)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#pragma once
+
+namespace JSC {
+
+enum class ExceptionExpectation {
+    CanThrow,
+    ShouldNotThrow
+};
+
+} // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/ExceptionHelpers.h (276675 => 276676)


--- trunk/Source/_javascript_Core/runtime/ExceptionHelpers.h	2021-04-27 22:50:36 UTC (rev 276675)
+++ trunk/Source/_javascript_Core/runtime/ExceptionHelpers.h	2021-04-27 22:52:55 UTC (rev 276676)
@@ -36,11 +36,6 @@
 
 namespace JSC {
 
-enum class ExceptionExpectation {
-    CanThrow,
-    ShouldNotThrow
-};
-
 typedef JSObject* (*ErrorFactory)(JSGlobalObject*, const String&, ErrorInstance::SourceAppender);
 
 String defaultSourceAppender(const String&, const String&, RuntimeType, ErrorInstance::SourceTextWhereErrorOccurred);

Modified: trunk/Source/_javascript_Core/runtime/HashMapImplInlines.h (276675 => 276676)


--- trunk/Source/_javascript_Core/runtime/HashMapImplInlines.h	2021-04-27 22:50:36 UTC (rev 276675)
+++ trunk/Source/_javascript_Core/runtime/HashMapImplInlines.h	2021-04-27 22:52:55 UTC (rev 276676)
@@ -25,6 +25,7 @@
 
 #pragma once
 
+#include "ExceptionExpectation.h"
 #include "HashMapImpl.h"
 #include "JSCJSValueInlines.h"
 #include "VMTrapsInlines.h"
@@ -96,7 +97,7 @@
         if constexpr (expection == ExceptionExpectation::CanThrow)
             RETURN_IF_EXCEPTION(scope, UINT_MAX);
         else
-            EXCEPTION_ASSERT(!scope.exception());
+            EXCEPTION_ASSERT_UNUSED(scope, !scope.exception());
         return wtfString.impl()->hash();
     }
 

Modified: trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewInlines.h (276675 => 276676)


--- trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewInlines.h	2021-04-27 22:50:36 UTC (rev 276675)
+++ trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayViewInlines.h	2021-04-27 22:52:55 UTC (rev 276676)
@@ -175,7 +175,7 @@
 
     RELEASE_ASSERT(other->canAccessRangeQuickly(otherOffset, length));
     bool success = validateRange(globalObject, offset, length);
-    EXCEPTION_ASSERT(!scope.exception() == success);
+    EXCEPTION_ASSERT_UNUSED(scope, !scope.exception() == success);
     if (!success)
         return false;
 
@@ -463,9 +463,10 @@
         return false;
 
     JSValue value;
-    if constexpr (Adaptor::canConvertToJSQuickly)
+    if constexpr (Adaptor::canConvertToJSQuickly) {
+        UNUSED_VARIABLE(scope);
         value = thisObject->getIndexQuickly(propertyName);
-    else {
+    } else {
         auto nativeValue = thisObject->getIndexQuicklyAsNativeValue(propertyName);
         value = Adaptor::toJSValue(globalObject, nativeValue);
         RETURN_IF_EXCEPTION(scope, false);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to