Changeset 254447 in webkit


Ignore:
Timestamp:
Jan 13, 2020 1:28:45 PM (4 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Put JSProxy in IsoSubspace
https://bugs.webkit.org/show_bug.cgi?id=206187

Reviewed by Mark Lam.

  1. Put JSProxy in IsoSubspace.
  2. Make JSProxy non-destructible since derived class JSWindowProxy is having its own IsoSubspace with destructibility.
  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Sources.txt:
  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::resetPrototype):
(JSC::JSGlobalObject::finishCreation):

  • runtime/JSNonDestructibleProxy.cpp: Removed.
  • runtime/JSNonDestructibleProxy.h: Removed.
  • runtime/JSProxy.h:

(JSC::JSProxy::subspaceFor):

  • runtime/JSStringIterator.h:
  • runtime/VM.cpp:

(JSC::VM::VM):

  • runtime/VM.h:
Location:
trunk/Source/JavaScriptCore
Files:
2 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r253896 r254447  
    901901    runtime/JSModuleRecord.h
    902902    runtime/JSNativeStdFunction.h
    903     runtime/JSNonDestructibleProxy.h
    904903    runtime/JSONObject.h
    905904    runtime/JSObject.h
  • trunk/Source/JavaScriptCore/ChangeLog

    r254434 r254447  
     12020-01-13  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Put JSProxy in IsoSubspace
     4        https://bugs.webkit.org/show_bug.cgi?id=206187
     5
     6        Reviewed by Mark Lam.
     7
     8        1. Put JSProxy in IsoSubspace.
     9        2. Make JSProxy non-destructible since derived class JSWindowProxy is having its own IsoSubspace with destructibility.
     10
     11        * CMakeLists.txt:
     12        * JavaScriptCore.xcodeproj/project.pbxproj:
     13        * Sources.txt:
     14        * runtime/JSGlobalObject.cpp:
     15        (JSC::JSGlobalObject::resetPrototype):
     16        (JSC::JSGlobalObject::finishCreation):
     17        * runtime/JSNonDestructibleProxy.cpp: Removed.
     18        * runtime/JSNonDestructibleProxy.h: Removed.
     19        * runtime/JSProxy.h:
     20        (JSC::JSProxy::subspaceFor):
     21        * runtime/JSStringIterator.h:
     22        * runtime/VM.cpp:
     23        (JSC::VM::VM):
     24        * runtime/VM.h:
     25
    1262020-01-11  Keith Miller  <keith_miller@apple.com>
    227
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r254262 r254447  
    18221822                E38652E3237CA0C900E1D5EE /* BlockDirectoryBits.h in Headers */ = {isa = PBXBuildFile; fileRef = E38652E2237CA0C800E1D5EE /* BlockDirectoryBits.h */; settings = {ATTRIBUTES = (Private, ); }; };
    18231823                E3893A1D2203A7C600E79A74 /* AsyncFromSyncIteratorPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = E3893A1C2203A7C600E79A74 /* AsyncFromSyncIteratorPrototype.lut.h */; };
    1824                 E38D999C221B78BB00D50474 /* JSNonDestructibleProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = E38D999A221B789F00D50474 /* JSNonDestructibleProxy.h */; settings = {ATTRIBUTES = (Private, ); }; };
    18251824                E39006212208BFC4001019CF /* SubspaceAccess.h in Headers */ = {isa = PBXBuildFile; fileRef = E39006202208BFC3001019CF /* SubspaceAccess.h */; settings = {ATTRIBUTES = (Private, ); }; };
    18261825                E393ADD81FE702D00022D681 /* WeakMapImplInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = E393ADD71FE702CC0022D681 /* WeakMapImplInlines.h */; };
     
    49704969                E38D060C1F8E814100649CF2 /* ScriptFetchParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptFetchParameters.h; sourceTree = "<group>"; };
    49714970                E38D060D1F8E814100649CF2 /* JSScriptFetchParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScriptFetchParameters.cpp; sourceTree = "<group>"; };
    4972                 E38D999A221B789F00D50474 /* JSNonDestructibleProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSNonDestructibleProxy.h; sourceTree = "<group>"; };
    4973                 E38D999B221B789F00D50474 /* JSNonDestructibleProxy.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSNonDestructibleProxy.cpp; sourceTree = "<group>"; };
    49744971                E39006202208BFC3001019CF /* SubspaceAccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubspaceAccess.h; sourceTree = "<group>"; };
    49754972                E3915C062309682900CB2561 /* WasmContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WasmContext.cpp; sourceTree = "<group>"; };
     
    73257322                                E33E8D1A1B9013C300346B52 /* JSNativeStdFunction.cpp */,
    73267323                                E33E8D1B1B9013C300346B52 /* JSNativeStdFunction.h */,
    7327                                 E38D999B221B789F00D50474 /* JSNonDestructibleProxy.cpp */,
    7328                                 E38D999A221B789F00D50474 /* JSNonDestructibleProxy.h */,
    73297324                                BC22A3980E16E14800AF21C8 /* JSObject.cpp */,
    73307325                                BC22A3990E16E14800AF21C8 /* JSObject.h */,
     
    98109805                                E39DA4A71B7E8B7C0084F33A /* JSModuleRecord.h in Headers */,
    98119806                                E33E8D1D1B9013C300346B52 /* JSNativeStdFunction.h in Headers */,
    9812                                 E38D999C221B78BB00D50474 /* JSNonDestructibleProxy.h in Headers */,
    98139807                                BC18C4240E16F5CD00B34460 /* JSObject.h in Headers */,
    98149808                                0F93275F1C21EF7F00CF6564 /* JSObjectInlines.h in Headers */,
  • trunk/Source/JavaScriptCore/Sources.txt

    r254252 r254447  
    855855runtime/JSModuleRecord.cpp
    856856runtime/JSNativeStdFunction.cpp
    857 runtime/JSNonDestructibleProxy.cpp
    858857runtime/JSONObject.cpp
    859858runtime/JSObject.cpp
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r254252 r254447  
    111111#include "JSModuleRecord.h"
    112112#include "JSNativeStdFunction.h"
    113 #include "JSNonDestructibleProxy.h"
    114113#include "JSONObject.h"
    115114#include "JSPromise.h"
     
    17071706    fixupPrototypeChainWithObjectPrototype(vm);
    17081707    // Whenever we change the prototype of the global object, we need to create a new JSProxy with the correct prototype.
    1709     setGlobalThis(vm, JSNonDestructibleProxy::create(vm, JSNonDestructibleProxy::createStructure(vm, this, prototype, PureForwardingProxyType), this));
     1708    setGlobalThis(vm, JSProxy::create(vm, JSProxy::createStructure(vm, this, prototype, PureForwardingProxyType), this));
    17101709}
    17111710
     
    22112210    m_runtimeFlags = m_globalObjectMethodTable->javaScriptRuntimeFlags(this);
    22122211    init(vm);
    2213     setGlobalThis(vm, JSNonDestructibleProxy::create(vm, JSNonDestructibleProxy::createStructure(vm, this, getPrototypeDirect(vm), PureForwardingProxyType), this));
     2212    setGlobalThis(vm, JSProxy::create(vm, JSProxy::createStructure(vm, this, getPrototypeDirect(vm), PureForwardingProxyType), this));
    22142213    ASSERT(type() == GlobalObjectType);
    22152214}
  • trunk/Source/JavaScriptCore/runtime/JSProxy.h

    r251425 r254447  
    2626#pragma once
    2727
    28 #include "JSDestructibleObject.h"
     28#include "JSObject.h"
    2929
    3030namespace JSC {
    3131
    32 class JSProxy : public JSDestructibleObject {
     32class JSProxy : public JSNonFinalObject {
    3333public:
    34     using Base = JSDestructibleObject;
     34    using Base = JSNonFinalObject;
    3535    static constexpr unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | OverridesGetPropertyNames | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero;
     36
     37    template<typename CellType, SubspaceAccess>
     38    static IsoSubspace* subspaceFor(VM& vm)
     39    {
     40        static_assert(sizeof(CellType) == sizeof(JSProxy));
     41        return &vm.jsProxySpace;
     42    }
    3643
    3744    static JSProxy* create(VM& vm, Structure* structure, JSObject* target)
  • trunk/Source/JavaScriptCore/runtime/JSStringIterator.h

    r254420 r254447  
    2626#pragma once
    2727
    28 #include "JSObject.h"
     28#include "JSInternalFieldObjectImpl.h"
    2929
    3030namespace JSC {
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r254420 r254447  
    112112#include "JSPromise.h"
    113113#include "JSPropertyNameEnumerator.h"
     114#include "JSProxy.h"
    114115#include "JSScriptFetchParameters.h"
    115116#include "JSScriptFetcher.h"
     
    370371    , globalLexicalEnvironmentSpace ISO_SUBSPACE_INIT(heap, globalLexicalEnvironmentHeapCellType.get(), JSGlobalLexicalEnvironment)
    371372    , internalFunctionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), InternalFunction) // Hash:0xf845c464
     373    , jsProxySpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSProxy)
    372374    , nativeExecutableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), NativeExecutable) // Hash:0x67567f95
    373375    , numberObjectSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), NumberObject)
  • trunk/Source/JavaScriptCore/runtime/VM.h

    r254420 r254447  
    453453    IsoSubspace globalLexicalEnvironmentSpace;
    454454    IsoSubspace internalFunctionSpace;
     455    IsoSubspace jsProxySpace;
    455456    IsoSubspace nativeExecutableSpace;
    456457    IsoSubspace numberObjectSpace;
Note: See TracChangeset for help on using the changeset viewer.