Changeset 289863 in webkit


Ignore:
Timestamp:
Feb 15, 2022, 4:42:15 PM (3 years ago)
Author:
mark.lam@apple.com
Message:

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

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

  • 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/JavaScriptCore/DisallowVMEntry.cpp:

(TestWebKitAPI::TEST):

  • TestWebKitAPI/Tests/JavaScriptCore/PropertySlot.cpp:

(TestWebKitAPI::TEST):

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r289823 r289863  
     12022-02-15  Mark Lam  <mark.lam@apple.com>
     2
     3        Make HeapType an enum class.
     4        https://bugs.webkit.org/show_bug.cgi?id=236667
     5        <rdar://problem/88984607>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        * dynbench.cpp:
     10        * heap/Heap.cpp:
     11        * heap/Heap.h:
     12        * jsc.cpp:
     13        (runJSC):
     14        * runtime/VM.cpp:
     15        (JSC::VM::sharedInstance):
     16        * runtime/VM.h:
     17        * testRegExp.cpp:
     18        (realMain):
     19
    1202022-02-15  Elliott Williams  <emw@apple.com>
    221
  • trunk/Source/JavaScriptCore/dynbench.cpp

    r278069 r289863  
    11/*
    2  * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
     2 * Copyright (C) 2015-2022 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    9292    JSC::initialize();
    9393
    94     VM& vm = VM::create(LargeHeap).leakRef();
     94    VM& vm = VM::create(HeapType::Large).leakRef();
    9595    {
    9696        JSLockHolder locker(vm);
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r289417 r289863  
    11/*
    2  *  Copyright (C) 2003-2021 Apple Inc. All rights reserved.
     2 *  Copyright (C) 2003-2022 Apple Inc. All rights reserved.
    33 *  Copyright (C) 2007 Eric Seidel <eric@webkit.org>
    44 *
     
    115115size_t minHeapSize(HeapType heapType, size_t ramSize)
    116116{
    117     if (heapType == LargeHeap) {
     117    if (heapType == HeapType::Large) {
    118118        double result = std::min(
    119119            static_cast<double>(Options::largeHeapSize()),
  • trunk/Source/JavaScriptCore/heap/Heap.h

    r289417 r289863  
    22 *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
    33 *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
    4  *  Copyright (C) 2003-2021 Apple Inc. All rights reserved.
     4 *  Copyright (C) 2003-2022 Apple Inc. All rights reserved.
    55 *
    66 *  This library is free software; you can redistribute it and/or
     
    110110typedef HashCountedSet<const char*> TypeCountSet;
    111111
    112 enum HeapType { SmallHeap, LargeHeap };
     112enum class HeapType : uint8_t { Small, Large };
    113113
    114114class HeapUtil;
  • trunk/Source/JavaScriptCore/jsc.cpp

    r289417 r289863  
    11/*
    22 *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
    3  *  Copyright (C) 2004-2021 Apple Inc. All rights reserved.
     3 *  Copyright (C) 2004-2022 Apple Inc. All rights reserved.
    44 *  Copyright (C) 2006 Bjoern Graf (bjoern.graf@gmail.com)
    55 *
     
    36053605    Worker worker(Workers::singleton());
    36063606   
    3607     VM& vm = VM::create(LargeHeap).leakRef();
     3607    VM& vm = VM::create(HeapType::Large).leakRef();
    36083608    if (!isWorker && options.m_canBlockIsFalse)
    36093609        vm.m_typedArrayController = adoptRef(new JSC::SimpleTypedArrayController(false));
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r289417 r289863  
    552552    VM*& instance = sharedInstanceInternal();
    553553    if (!instance)
    554         instance = adoptRef(new VM(APIShared, SmallHeap)).leakRef();
     554        instance = adoptRef(new VM(APIShared, HeapType::Small)).leakRef();
    555555    return *instance;
    556556}
  • trunk/Source/JavaScriptCore/runtime/VM.h

    r289417 r289863  
    254254    JS_EXPORT_PRIVATE static VM& sharedInstance();
    255255
    256     JS_EXPORT_PRIVATE static Ref<VM> create(HeapType = SmallHeap, WTF::RunLoop* = nullptr);
    257     JS_EXPORT_PRIVATE static RefPtr<VM> tryCreate(HeapType = SmallHeap, WTF::RunLoop* = nullptr);
    258     static Ref<VM> createContextGroup(HeapType = SmallHeap);
     256    JS_EXPORT_PRIVATE static Ref<VM> create(HeapType = HeapType::Small, WTF::RunLoop* = nullptr);
     257    JS_EXPORT_PRIVATE static RefPtr<VM> tryCreate(HeapType = HeapType::Small, WTF::RunLoop* = nullptr);
     258    static Ref<VM> createContextGroup(HeapType = HeapType::Small);
    259259    JS_EXPORT_PRIVATE ~VM();
    260260
  • trunk/Source/JavaScriptCore/testRegExp.cpp

    r285730 r289863  
    11/*
    2  *  Copyright (C) 2011-2021 Apple Inc. All rights reserved.
     2 *  Copyright (C) 2011-2022 Apple Inc. All rights reserved.
    33 *
    44 *  This library is free software; you can redistribute it and/or
     
    517517int realMain(int argc, char** argv)
    518518{
    519     VM* vm = &VM::create(LargeHeap).leakRef();
     519    VM* vm = &VM::create(HeapType::Large).leakRef();
    520520    JSLockHolder locker(vm);
    521521
  • trunk/Source/WebCore/ChangeLog

    r289862 r289863  
     12022-02-15  Mark Lam  <mark.lam@apple.com>
     2
     3        Make HeapType an enum class.
     4        https://bugs.webkit.org/show_bug.cgi?id=236667
     5        <rdar://problem/88984607>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        * bindings/js/CommonVM.cpp:
     10        (WebCore::commonVMSlow):
     11
    1122022-02-15  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
    213
  • trunk/Source/WebCore/bindings/js/CommonVM.cpp

    r275013 r289863  
    11/*
    2  * Copyright (C) 2016-2020 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2022 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    6262#endif
    6363
    64     auto& vm = JSC::VM::create(JSC::LargeHeap, runLoop).leakRef();
     64    auto& vm = JSC::VM::create(JSC::HeapType::Large, runLoop).leakRef();
    6565
    6666    g_commonVMOrNull = &vm;
  • trunk/Tools/ChangeLog

    r289856 r289863  
     12022-02-15  Mark Lam  <mark.lam@apple.com>
     2
     3        Make HeapType an enum class.
     4        https://bugs.webkit.org/show_bug.cgi?id=236667
     5        <rdar://problem/88984607>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        * TestWebKitAPI/Tests/JavaScriptCore/DisallowVMEntry.cpp:
     10        (TestWebKitAPI::TEST):
     11        * TestWebKitAPI/Tests/JavaScriptCore/PropertySlot.cpp:
     12        (TestWebKitAPI::TEST):
     13
    1142022-02-15  Jonathan Bedard  <jbedard@apple.com>
    215
  • trunk/Tools/TestWebKitAPI/Tests/JavaScriptCore/DisallowVMEntry.cpp

    r264937 r289863  
    11/*
    2  * Copyright (C) 2020 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020-2022 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3333using JSC::DisallowVMEntry;
    3434using JSC::JSLockHolder;
    35 using JSC::LargeHeap;
     35using JSC::HeapType;
    3636using JSC::VM;
    3737
     
    5252    JSC::initialize();
    5353
    54     VM& vm = VM::create(LargeHeap).leakRef();
     54    VM& vm = VM::create(HeapType::Large).leakRef();
    5555    {
    5656        JSLockHolder locker(vm);
     
    6666    JSC::initialize();
    6767
    68     VM& vm = VM::create(LargeHeap).leakRef();
     68    VM& vm = VM::create(HeapType::Large).leakRef();
    6969    {
    7070        JSLockHolder locker(vm);
     
    9090    JSC::initialize();
    9191
    92     VM& vm = VM::create(LargeHeap).leakRef();
     92    VM& vm = VM::create(HeapType::Large).leakRef();
    9393    {
    9494        JSLockHolder locker(vm);
  • trunk/Tools/TestWebKitAPI/Tests/JavaScriptCore/PropertySlot.cpp

    r264937 r289863  
    11/*
    2  * Copyright (C) 2020 Apple Inc. All rights reserved.
     2 * Copyright (C) 2020-2022 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3333
    3434using JSC::JSLockHolder;
    35 using JSC::LargeHeap;
     35using JSC::HeapType;
    3636using JSC::PropertySlot;
    3737using JSC::VM;
     
    4343    JSC::initialize();
    4444
    45     VM& vm = VM::create(LargeHeap).leakRef();
     45    VM& vm = VM::create(HeapType::Large).leakRef();
    4646    {
    4747        JSLockHolder locker(vm);
     
    7979    JSC::initialize();
    8080
    81     VM& vm = VM::create(LargeHeap).leakRef();
     81    VM& vm = VM::create(HeapType::Large).leakRef();
    8282    {
    8383        JSLockHolder locker(vm);
     
    103103    JSC::initialize();
    104104
    105     VM& vm = VM::create(LargeHeap).leakRef();
     105    VM& vm = VM::create(HeapType::Large).leakRef();
    106106    {
    107107        JSLockHolder locker(vm);
Note: See TracChangeset for help on using the changeset viewer.