Title: [289863] trunk
Revision
289863
Author
[email protected]
Date
2022-02-15 16:42:15 -0800 (Tue, 15 Feb 2022)

Log Message

Make HeapType an enum class.
https://bugs.webkit.org/show_bug.cgi?id=236667
<rdar://problem/88984607>

Reviewed by Yusuke Suzuki.

Source/_javascript_Core:

* dynbench.cpp:
* heap/Heap.cpp:
* heap/Heap.h:
* jsc.cpp:
(runJSC):
* runtime/VM.cpp:
(JSC::VM::sharedInstance):
* runtime/VM.h:
* testRegExp.cpp:
(realMain):

Source/WebCore:

* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow):

Tools:

* TestWebKitAPI/Tests/_javascript_Core/DisallowVMEntry.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/_javascript_Core/PropertySlot.cpp:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (289862 => 289863)


--- trunk/Source/_javascript_Core/ChangeLog	2022-02-16 00:26:24 UTC (rev 289862)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-02-16 00:42:15 UTC (rev 289863)
@@ -1,3 +1,22 @@
+2022-02-15  Mark Lam  <[email protected]>
+
+        Make HeapType an enum class.
+        https://bugs.webkit.org/show_bug.cgi?id=236667
+        <rdar://problem/88984607>
+
+        Reviewed by Yusuke Suzuki.
+
+        * dynbench.cpp:
+        * heap/Heap.cpp:
+        * heap/Heap.h:
+        * jsc.cpp:
+        (runJSC):
+        * runtime/VM.cpp:
+        (JSC::VM::sharedInstance):
+        * runtime/VM.h:
+        * testRegExp.cpp:
+        (realMain):
+
 2022-02-15  Elliott Williams  <[email protected]>
 
         [Xcode] Remove "Make libWTF.a Symbolic Link" script phase

Modified: trunk/Source/_javascript_Core/dynbench.cpp (289862 => 289863)


--- trunk/Source/_javascript_Core/dynbench.cpp	2022-02-16 00:26:24 UTC (rev 289862)
+++ trunk/Source/_javascript_Core/dynbench.cpp	2022-02-16 00:42:15 UTC (rev 289863)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -91,7 +91,7 @@
     WTF::initializeMainThread();
     JSC::initialize();
 
-    VM& vm = VM::create(LargeHeap).leakRef();
+    VM& vm = VM::create(HeapType::Large).leakRef();
     {
         JSLockHolder locker(vm);
 

Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (289862 => 289863)


--- trunk/Source/_javascript_Core/heap/Heap.cpp	2022-02-16 00:26:24 UTC (rev 289862)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp	2022-02-16 00:42:15 UTC (rev 289863)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2003-2021 Apple Inc. All rights reserved.
+ *  Copyright (C) 2003-2022 Apple Inc. All rights reserved.
  *  Copyright (C) 2007 Eric Seidel <[email protected]>
  *
  *  This library is free software; you can redistribute it and/or
@@ -114,7 +114,7 @@
 
 size_t minHeapSize(HeapType heapType, size_t ramSize)
 {
-    if (heapType == LargeHeap) {
+    if (heapType == HeapType::Large) {
         double result = std::min(
             static_cast<double>(Options::largeHeapSize()),
             ramSize * Options::smallHeapRAMFraction());

Modified: trunk/Source/_javascript_Core/heap/Heap.h (289862 => 289863)


--- trunk/Source/_javascript_Core/heap/Heap.h	2022-02-16 00:26:24 UTC (rev 289862)
+++ trunk/Source/_javascript_Core/heap/Heap.h	2022-02-16 00:42:15 UTC (rev 289863)
@@ -1,7 +1,7 @@
 /*
  *  Copyright (C) 1999-2000 Harri Porten ([email protected])
  *  Copyright (C) 2001 Peter Kelly ([email protected])
- *  Copyright (C) 2003-2021 Apple Inc. All rights reserved.
+ *  Copyright (C) 2003-2022 Apple Inc. All rights reserved.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
@@ -109,7 +109,7 @@
 typedef HashCountedSet<JSCell*> ProtectCountSet;
 typedef HashCountedSet<const char*> TypeCountSet;
 
-enum HeapType { SmallHeap, LargeHeap };
+enum class HeapType : uint8_t { Small, Large };
 
 class HeapUtil;
 

Modified: trunk/Source/_javascript_Core/jsc.cpp (289862 => 289863)


--- trunk/Source/_javascript_Core/jsc.cpp	2022-02-16 00:26:24 UTC (rev 289862)
+++ trunk/Source/_javascript_Core/jsc.cpp	2022-02-16 00:42:15 UTC (rev 289863)
@@ -1,6 +1,6 @@
 /*
  *  Copyright (C) 1999-2000 Harri Porten ([email protected])
- *  Copyright (C) 2004-2021 Apple Inc. All rights reserved.
+ *  Copyright (C) 2004-2022 Apple Inc. All rights reserved.
  *  Copyright (C) 2006 Bjoern Graf ([email protected])
  *
  *  This library is free software; you can redistribute it and/or
@@ -3604,7 +3604,7 @@
 {
     Worker worker(Workers::singleton());
     
-    VM& vm = VM::create(LargeHeap).leakRef();
+    VM& vm = VM::create(HeapType::Large).leakRef();
     if (!isWorker && options.m_canBlockIsFalse)
         vm.m_typedArrayController = adoptRef(new JSC::SimpleTypedArrayController(false));
 #if ENABLE(WEBASSEMBLY)

Modified: trunk/Source/_javascript_Core/runtime/VM.cpp (289862 => 289863)


--- trunk/Source/_javascript_Core/runtime/VM.cpp	2022-02-16 00:26:24 UTC (rev 289862)
+++ trunk/Source/_javascript_Core/runtime/VM.cpp	2022-02-16 00:42:15 UTC (rev 289863)
@@ -551,7 +551,7 @@
     GlobalJSLock globalLock;
     VM*& instance = sharedInstanceInternal();
     if (!instance)
-        instance = adoptRef(new VM(APIShared, SmallHeap)).leakRef();
+        instance = adoptRef(new VM(APIShared, HeapType::Small)).leakRef();
     return *instance;
 }
 

Modified: trunk/Source/_javascript_Core/runtime/VM.h (289862 => 289863)


--- trunk/Source/_javascript_Core/runtime/VM.h	2022-02-16 00:26:24 UTC (rev 289862)
+++ trunk/Source/_javascript_Core/runtime/VM.h	2022-02-16 00:42:15 UTC (rev 289863)
@@ -253,9 +253,9 @@
     JS_EXPORT_PRIVATE static bool sharedInstanceExists();
     JS_EXPORT_PRIVATE static VM& sharedInstance();
 
-    JS_EXPORT_PRIVATE static Ref<VM> create(HeapType = SmallHeap, WTF::RunLoop* = nullptr);
-    JS_EXPORT_PRIVATE static RefPtr<VM> tryCreate(HeapType = SmallHeap, WTF::RunLoop* = nullptr);
-    static Ref<VM> createContextGroup(HeapType = SmallHeap);
+    JS_EXPORT_PRIVATE static Ref<VM> create(HeapType = HeapType::Small, WTF::RunLoop* = nullptr);
+    JS_EXPORT_PRIVATE static RefPtr<VM> tryCreate(HeapType = HeapType::Small, WTF::RunLoop* = nullptr);
+    static Ref<VM> createContextGroup(HeapType = HeapType::Small);
     JS_EXPORT_PRIVATE ~VM();
 
     Watchdog& ensureWatchdog();

Modified: trunk/Source/_javascript_Core/testRegExp.cpp (289862 => 289863)


--- trunk/Source/_javascript_Core/testRegExp.cpp	2022-02-16 00:26:24 UTC (rev 289862)
+++ trunk/Source/_javascript_Core/testRegExp.cpp	2022-02-16 00:42:15 UTC (rev 289863)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2011-2021 Apple Inc. All rights reserved.
+ *  Copyright (C) 2011-2022 Apple Inc. All rights reserved.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Library General Public
@@ -516,7 +516,7 @@
 
 int realMain(int argc, char** argv)
 {
-    VM* vm = &VM::create(LargeHeap).leakRef();
+    VM* vm = &VM::create(HeapType::Large).leakRef();
     JSLockHolder locker(vm);
 
     CommandLine options;

Modified: trunk/Source/WebCore/ChangeLog (289862 => 289863)


--- trunk/Source/WebCore/ChangeLog	2022-02-16 00:26:24 UTC (rev 289862)
+++ trunk/Source/WebCore/ChangeLog	2022-02-16 00:42:15 UTC (rev 289863)
@@ -1,3 +1,14 @@
+2022-02-15  Mark Lam  <[email protected]>
+
+        Make HeapType an enum class.
+        https://bugs.webkit.org/show_bug.cgi?id=236667
+        <rdar://problem/88984607>
+
+        Reviewed by Yusuke Suzuki.
+
+        * bindings/js/CommonVM.cpp:
+        (WebCore::commonVMSlow):
+
 2022-02-15  Nikolaos Mouchtaris  <[email protected]>
 
         [css-transforms] properly handle interpolation of non-invertible matrices

Modified: trunk/Source/WebCore/bindings/js/CommonVM.cpp (289862 => 289863)


--- trunk/Source/WebCore/bindings/js/CommonVM.cpp	2022-02-16 00:26:24 UTC (rev 289862)
+++ trunk/Source/WebCore/bindings/js/CommonVM.cpp	2022-02-16 00:42:15 UTC (rev 289863)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -61,7 +61,7 @@
     RunLoop* runLoop = nullptr;
 #endif
 
-    auto& vm = JSC::VM::create(JSC::LargeHeap, runLoop).leakRef();
+    auto& vm = JSC::VM::create(JSC::HeapType::Large, runLoop).leakRef();
 
     g_commonVMOrNull = &vm;
 

Modified: trunk/Tools/ChangeLog (289862 => 289863)


--- trunk/Tools/ChangeLog	2022-02-16 00:26:24 UTC (rev 289862)
+++ trunk/Tools/ChangeLog	2022-02-16 00:42:15 UTC (rev 289863)
@@ -1,3 +1,16 @@
+2022-02-15  Mark Lam  <[email protected]>
+
+        Make HeapType an enum class.
+        https://bugs.webkit.org/show_bug.cgi?id=236667
+        <rdar://problem/88984607>
+
+        Reviewed by Yusuke Suzuki.
+
+        * TestWebKitAPI/Tests/_javascript_Core/DisallowVMEntry.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/_javascript_Core/PropertySlot.cpp:
+        (TestWebKitAPI::TEST):
+
 2022-02-15  Jonathan Bedard  <[email protected]>
 
         [webkitscmpy] Support draft pull-requests

Modified: trunk/Tools/TestWebKitAPI/Tests/_javascript_Core/DisallowVMEntry.cpp (289862 => 289863)


--- trunk/Tools/TestWebKitAPI/Tests/_javascript_Core/DisallowVMEntry.cpp	2022-02-16 00:26:24 UTC (rev 289862)
+++ trunk/Tools/TestWebKitAPI/Tests/_javascript_Core/DisallowVMEntry.cpp	2022-02-16 00:42:15 UTC (rev 289863)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2020-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -32,7 +32,7 @@
 
 using JSC::DisallowVMEntry;
 using JSC::JSLockHolder;
-using JSC::LargeHeap;
+using JSC::HeapType;
 using JSC::VM;
 
 static void enterScope(VM& vm, unsigned entryCount, unsigned remainingEntries)
@@ -51,7 +51,7 @@
     WTF::initializeMainThread();
     JSC::initialize();
 
-    VM& vm = VM::create(LargeHeap).leakRef();
+    VM& vm = VM::create(HeapType::Large).leakRef();
     {
         JSLockHolder locker(vm);
         EXPECT_EQ(vm.disallowVMEntryCount, 0u);
@@ -65,7 +65,7 @@
     WTF::initializeMainThread();
     JSC::initialize();
 
-    VM& vm = VM::create(LargeHeap).leakRef();
+    VM& vm = VM::create(HeapType::Large).leakRef();
     {
         JSLockHolder locker(vm);
         EXPECT_EQ(vm.disallowVMEntryCount, 0u);
@@ -89,7 +89,7 @@
     WTF::initializeMainThread();
     JSC::initialize();
 
-    VM& vm = VM::create(LargeHeap).leakRef();
+    VM& vm = VM::create(HeapType::Large).leakRef();
     {
         JSLockHolder locker(vm);
         EXPECT_EQ(vm.disallowVMEntryCount, 0u);

Modified: trunk/Tools/TestWebKitAPI/Tests/_javascript_Core/PropertySlot.cpp (289862 => 289863)


--- trunk/Tools/TestWebKitAPI/Tests/_javascript_Core/PropertySlot.cpp	2022-02-16 00:26:24 UTC (rev 289862)
+++ trunk/Tools/TestWebKitAPI/Tests/_javascript_Core/PropertySlot.cpp	2022-02-16 00:42:15 UTC (rev 289863)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2020-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -32,7 +32,7 @@
 namespace TestWebKitAPI {
 
 using JSC::JSLockHolder;
-using JSC::LargeHeap;
+using JSC::HeapType;
 using JSC::PropertySlot;
 using JSC::VM;
 using JSC::jsUndefined;
@@ -42,7 +42,7 @@
     WTF::initializeMainThread();
     JSC::initialize();
 
-    VM& vm = VM::create(LargeHeap).leakRef();
+    VM& vm = VM::create(HeapType::Large).leakRef();
     {
         JSLockHolder locker(vm);
         EXPECT_EQ(vm.disallowVMEntryCount, 0u);
@@ -78,7 +78,7 @@
     WTF::initializeMainThread();
     JSC::initialize();
 
-    VM& vm = VM::create(LargeHeap).leakRef();
+    VM& vm = VM::create(HeapType::Large).leakRef();
     {
         JSLockHolder locker(vm);
         EXPECT_EQ(vm.disallowVMEntryCount, 0u);
@@ -102,7 +102,7 @@
     WTF::initializeMainThread();
     JSC::initialize();
 
-    VM& vm = VM::create(LargeHeap).leakRef();
+    VM& vm = VM::create(HeapType::Large).leakRef();
     {
         JSLockHolder locker(vm);
         EXPECT_EQ(vm.disallowVMEntryCount, 0u);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to