Changeset 227723 in webkit


Ignore:
Timestamp:
Jan 29, 2018 1:25:35 AM (6 years ago)
Author:
Yusuke Suzuki
Message:

[DFG][FTL] WeakMap#set should have DFG node
https://bugs.webkit.org/show_bug.cgi?id=180015

Reviewed by Saam Barati.

JSTests:

  • stress/weakmap-set-change-get.js: Added.

(shouldBe):
(test):

  • stress/weakmap-set-cse.js: Added.

(shouldBe):
(test):

  • stress/weakset-add-change-get.js: Added.

(shouldBe):

  • stress/weakset-add-cse.js: Added.

(shouldBe):

Source/JavaScriptCore:

This patch adds WeakMapSet and WeakSetAdd DFG nodes to handle them efficiently in DFG and FTL.
We also define CSE rules for them. Now, WeakMapSet and WeakSetAdd can offer the results of
the subsequent WeakMapGet if CSE allows.

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::addVarArgChild):
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):

  • dfg/DFGClobberize.h:

(JSC::DFG::clobberize):

  • dfg/DFGDoesGC.cpp:

(JSC::DFG::doesGC):
WeakMap operations do not cause GC.

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):

  • dfg/DFGNodeType.h:
  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:
  • dfg/DFGPredictionPropagationPhase.cpp:
  • dfg/DFGSafeToExecute.h:

(JSC::DFG::safeToExecute):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileWeakSetAdd):
(JSC::DFG::SpeculativeJIT::compileWeakMapSet):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::callOperation):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • ftl/FTLCapabilities.cpp:

(JSC::FTL::canCompile):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileWeakSetAdd):
(JSC::FTL::DFG::LowerDFGToB3::compileWeakMapSet):

  • jit/JITOperations.h:
  • runtime/Intrinsic.cpp:

(JSC::intrinsicName):

  • runtime/Intrinsic.h:
  • runtime/WeakMapPrototype.cpp:

(JSC::WeakMapPrototype::finishCreation):

  • runtime/WeakSetPrototype.cpp:

(JSC::WeakSetPrototype::finishCreation):

Location:
trunk
Files:
4 added
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r227716 r227723  
     12018-01-29  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [DFG][FTL] WeakMap#set should have DFG node
     4        https://bugs.webkit.org/show_bug.cgi?id=180015
     5
     6        Reviewed by Saam Barati.
     7
     8        * stress/weakmap-set-change-get.js: Added.
     9        (shouldBe):
     10        (test):
     11        * stress/weakmap-set-cse.js: Added.
     12        (shouldBe):
     13        (test):
     14        * stress/weakset-add-change-get.js: Added.
     15        (shouldBe):
     16        * stress/weakset-add-cse.js: Added.
     17        (shouldBe):
     18
    1192018-01-27  Yusuke Suzuki  <utatane.tea@gmail.com>
    220
  • trunk/Source/JavaScriptCore/ChangeLog

    r227721 r227723  
     12018-01-29  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [DFG][FTL] WeakMap#set should have DFG node
     4        https://bugs.webkit.org/show_bug.cgi?id=180015
     5
     6        Reviewed by Saam Barati.
     7
     8        This patch adds WeakMapSet and WeakSetAdd DFG nodes to handle them efficiently in DFG and FTL.
     9        We also define CSE rules for them. Now, WeakMapSet and WeakSetAdd can offer the results of
     10        the subsequent WeakMapGet if CSE allows.
     11
     12        * dfg/DFGAbstractInterpreterInlines.h:
     13        (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
     14        * dfg/DFGByteCodeParser.cpp:
     15        (JSC::DFG::ByteCodeParser::addVarArgChild):
     16        (JSC::DFG::ByteCodeParser::handleIntrinsicCall):
     17        * dfg/DFGClobberize.h:
     18        (JSC::DFG::clobberize):
     19        * dfg/DFGDoesGC.cpp:
     20        (JSC::DFG::doesGC):
     21        WeakMap operations do not cause GC.
     22
     23        * dfg/DFGFixupPhase.cpp:
     24        (JSC::DFG::FixupPhase::fixupNode):
     25        * dfg/DFGNodeType.h:
     26        * dfg/DFGOperations.cpp:
     27        * dfg/DFGOperations.h:
     28        * dfg/DFGPredictionPropagationPhase.cpp:
     29        * dfg/DFGSafeToExecute.h:
     30        (JSC::DFG::safeToExecute):
     31        * dfg/DFGSpeculativeJIT.cpp:
     32        (JSC::DFG::SpeculativeJIT::compileWeakSetAdd):
     33        (JSC::DFG::SpeculativeJIT::compileWeakMapSet):
     34        * dfg/DFGSpeculativeJIT.h:
     35        (JSC::DFG::SpeculativeJIT::callOperation):
     36        * dfg/DFGSpeculativeJIT32_64.cpp:
     37        (JSC::DFG::SpeculativeJIT::compile):
     38        * dfg/DFGSpeculativeJIT64.cpp:
     39        (JSC::DFG::SpeculativeJIT::compile):
     40        * ftl/FTLCapabilities.cpp:
     41        (JSC::FTL::canCompile):
     42        * ftl/FTLLowerDFGToB3.cpp:
     43        (JSC::FTL::DFG::LowerDFGToB3::compileNode):
     44        (JSC::FTL::DFG::LowerDFGToB3::compileWeakSetAdd):
     45        (JSC::FTL::DFG::LowerDFGToB3::compileWeakMapSet):
     46        * jit/JITOperations.h:
     47        * runtime/Intrinsic.cpp:
     48        (JSC::intrinsicName):
     49        * runtime/Intrinsic.h:
     50        * runtime/WeakMapPrototype.cpp:
     51        (JSC::WeakMapPrototype::finishCreation):
     52        * runtime/WeakSetPrototype.cpp:
     53        (JSC::WeakSetPrototype::finishCreation):
     54
    1552018-01-28  Filip Pizlo  <fpizlo@apple.com>
    256
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h

    r227410 r227723  
    11631163    case MapSet:
    11641164        forNode(node).set(m_graph, m_vm.hashMapBucketMapStructure.get());
     1165        break;
     1166
     1167    case WeakSetAdd:
     1168    case WeakMapSet:
    11651169        break;
    11661170
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r227462 r227723  
    760760        m_numPassedVarArgs++;
    761761    }
     762
     763    void addVarArgChild(Edge child)
     764    {
     765        m_graph.m_varArgChildren.append(child);
     766        m_numPassedVarArgs++;
     767    }
    762768   
    763769    Node* addCallWithoutSettingResult(
     
    30003006
    30013007        set(VirtualRegister(resultOperand), result);
     3008        return true;
     3009    }
     3010
     3011    case JSWeakSetAddIntrinsic: {
     3012        if (argumentCountIncludingThis != 2)
     3013            return false;
     3014
     3015        if (m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadType))
     3016            return false;
     3017
     3018        insertChecks();
     3019        Node* base = get(virtualRegisterForArgument(0, registerOffset));
     3020        Node* key = get(virtualRegisterForArgument(1, registerOffset));
     3021        addToGraph(Check, Edge(key, ObjectUse));
     3022        Node* hash = addToGraph(MapHash, key);
     3023        addToGraph(WeakSetAdd, Edge(base, WeakSetObjectUse), Edge(key, ObjectUse), Edge(hash, Int32Use));
     3024        set(VirtualRegister(resultOperand), base);
     3025        return true;
     3026    }
     3027
     3028    case JSWeakMapSetIntrinsic: {
     3029        if (argumentCountIncludingThis != 3)
     3030            return false;
     3031
     3032        if (m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadType))
     3033            return false;
     3034
     3035        insertChecks();
     3036        Node* base = get(virtualRegisterForArgument(0, registerOffset));
     3037        Node* key = get(virtualRegisterForArgument(1, registerOffset));
     3038        Node* value = get(virtualRegisterForArgument(2, registerOffset));
     3039
     3040        addToGraph(Check, Edge(key, ObjectUse));
     3041        Node* hash = addToGraph(MapHash, key);
     3042
     3043        addVarArgChild(Edge(base, WeakMapObjectUse));
     3044        addVarArgChild(Edge(key, ObjectUse));
     3045        addVarArgChild(Edge(value));
     3046        addVarArgChild(Edge(hash, Int32Use));
     3047        addToGraph(Node::VarArg, WeakMapSet, OpInfo(0), OpInfo(0));
     3048        set(VirtualRegister(resultOperand), base);
    30023049        return true;
    30033050    }
  • trunk/Source/JavaScriptCore/dfg/DFGClobberize.h

    r227410 r227723  
    16731673    }
    16741674
     1675    case WeakSetAdd: {
     1676        Edge& mapEdge = node->child1();
     1677        Edge& keyEdge = node->child2();
     1678        write(JSWeakSetFields);
     1679        def(HeapLocation(WeakMapGetLoc, JSWeakSetFields, mapEdge, keyEdge), LazyNode(keyEdge.node()));
     1680        return;
     1681    }
     1682
     1683    case WeakMapSet: {
     1684        Edge& mapEdge = graph.varArgChild(node, 0);
     1685        Edge& keyEdge = graph.varArgChild(node, 1);
     1686        Edge& valueEdge = graph.varArgChild(node, 2);
     1687        write(JSWeakMapFields);
     1688        def(HeapLocation(WeakMapGetLoc, JSWeakMapFields, mapEdge, keyEdge), LazyNode(valueEdge.node()));
     1689        return;
     1690    }
     1691
    16751692    case ExtractValueFromWeakMapGet:
    16761693        def(PureValue(node));
  • trunk/Source/JavaScriptCore/dfg/DFGDoesGC.cpp

    r227410 r227723  
    215215    case ExtractValueFromWeakMapGet:
    216216    case WeakMapGet:
     217    case WeakSetAdd:
     218    case WeakMapSet:
    217219    case Unreachable:
    218220    case ExtractCatchLocal:
  • trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp

    r227410 r227723  
    19761976        case MapSet: {
    19771977            fixEdge<MapObjectUse>(m_graph.varArgChild(node, 0));
     1978            fixEdge<Int32Use>(m_graph.varArgChild(node, 3));
     1979            break;
     1980        }
     1981
     1982        case WeakSetAdd: {
     1983            fixEdge<WeakSetObjectUse>(node->child1());
     1984            fixEdge<ObjectUse>(node->child2());
     1985            fixEdge<Int32Use>(node->child3());
     1986            break;
     1987        }
     1988
     1989        case WeakMapSet: {
     1990            fixEdge<WeakMapObjectUse>(m_graph.varArgChild(node, 0));
     1991            fixEdge<ObjectUse>(m_graph.varArgChild(node, 1));
    19781992            fixEdge<Int32Use>(m_graph.varArgChild(node, 3));
    19791993            break;
  • trunk/Source/JavaScriptCore/dfg/DFGNodeType.h

    r227410 r227723  
    451451    /* Nodes for JSWeakMap and JSWeakSet */ \
    452452    macro(WeakMapGet, NodeResultJS) \
     453    macro(WeakSetAdd, NodeMustGenerate) \
     454    macro(WeakMapSet, NodeMustGenerate | NodeHasVarArgs) \
    453455    macro(ExtractValueFromWeakMapGet, NodeResultJS) \
    454456    \
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r227107 r227723  
    5858#include "JSPropertyNameEnumerator.h"
    5959#include "JSSet.h"
     60#include "JSWeakMap.h"
     61#include "JSWeakSet.h"
    6062#include "ObjectConstructor.h"
    6163#include "Operations.h"
     
    26962698}
    26972699
     2700void JIT_OPERATION operationWeakSetAdd(ExecState* exec, JSCell* set, JSCell* key, int32_t hash)
     2701{
     2702    VM& vm = exec->vm();
     2703    NativeCallFrameTracer tracer(&vm, exec);
     2704    jsCast<JSWeakSet*>(set)->add(vm, asObject(key), JSValue(), hash);
     2705}
     2706
     2707void JIT_OPERATION operationWeakMapSet(ExecState* exec, JSCell* map, JSCell* key, EncodedJSValue value, int32_t hash)
     2708{
     2709    VM& vm = exec->vm();
     2710    NativeCallFrameTracer tracer(&vm, exec);
     2711    jsCast<JSWeakMap*>(map)->add(vm, asObject(key), JSValue::decode(value), hash);
     2712}
     2713
    26982714EncodedJSValue JIT_OPERATION operationGetPrototypeOfObject(ExecState* exec, JSObject* thisObject)
    26992715{
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.h

    r227107 r227723  
    171171JSCell* JIT_OPERATION operationSetAdd(ExecState*, JSCell*, EncodedJSValue, int32_t) WTF_INTERNAL;
    172172JSCell* JIT_OPERATION operationMapSet(ExecState*, JSCell*, EncodedJSValue, EncodedJSValue, int32_t) WTF_INTERNAL;
     173void JIT_OPERATION operationWeakSetAdd(ExecState*, JSCell*, JSCell*, int32_t) WTF_INTERNAL;
     174void JIT_OPERATION operationWeakMapSet(ExecState*, JSCell*, JSCell*, EncodedJSValue, int32_t) WTF_INTERNAL;
    173175double JIT_OPERATION operationFModOnInts(int32_t, int32_t) WTF_INTERNAL;
    174176size_t JIT_OPERATION operationObjectIsObject(ExecState*, JSGlobalObject*, JSCell*) WTF_INTERNAL;
  • trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp

    r227410 r227723  
    11911191        case NukeStructureAndSetButterfly:
    11921192        case InitializeEntrypointArguments:
     1193        case WeakSetAdd:
     1194        case WeakMapSet:
    11931195            break;
    11941196           
  • trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h

    r227410 r227723  
    432432    case ExtractValueFromWeakMapGet:
    433433    case WeakMapGet:
     434    case WeakSetAdd:
     435    case WeakMapSet:
    434436    case AtomicsAdd:
    435437    case AtomicsAnd:
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r227643 r227723  
    1171011710}
    1171111711
     11712void SpeculativeJIT::compileWeakSetAdd(Node* node)
     11713{
     11714    SpeculateCellOperand set(this, node->child1());
     11715    SpeculateCellOperand key(this, node->child2());
     11716    SpeculateInt32Operand hash(this, node->child3());
     11717
     11718    GPRReg setGPR = set.gpr();
     11719    GPRReg keyGPR = key.gpr();
     11720    GPRReg hashGPR = hash.gpr();
     11721
     11722    speculateWeakSetObject(node->child1(), setGPR);
     11723    speculateObject(node->child2(), keyGPR);
     11724
     11725    flushRegisters();
     11726    callOperation(operationWeakSetAdd, setGPR, keyGPR, hashGPR);
     11727    m_jit.exceptionCheck();
     11728    noResult(node);
     11729}
     11730
     11731void SpeculativeJIT::compileWeakMapSet(Node* node)
     11732{
     11733    SpeculateCellOperand map(this, m_jit.graph().varArgChild(node, 0));
     11734    SpeculateCellOperand key(this, m_jit.graph().varArgChild(node, 1));
     11735    JSValueOperand value(this, m_jit.graph().varArgChild(node, 2));
     11736    SpeculateInt32Operand hash(this, m_jit.graph().varArgChild(node, 3));
     11737
     11738    GPRReg mapGPR = map.gpr();
     11739    GPRReg keyGPR = key.gpr();
     11740    JSValueRegs valueRegs = value.jsValueRegs();
     11741    GPRReg hashGPR = hash.gpr();
     11742
     11743    speculateWeakMapObject(m_jit.graph().varArgChild(node, 0), mapGPR);
     11744    speculateObject(m_jit.graph().varArgChild(node, 1), keyGPR);
     11745
     11746    flushRegisters();
     11747    callOperation(operationWeakMapSet, mapGPR, keyGPR, valueRegs, hashGPR);
     11748    m_jit.exceptionCheck();
     11749    noResult(node);
     11750}
     11751
    1171211752void SpeculativeJIT::compileGetPrototypeOf(Node* node)
    1171311753{
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h

    r227617 r227723  
    12631263        return appendCall(operation);
    12641264    }
     1265    JITCompiler::Call callOperation(V_JITOperation_ECCZ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3)
     1266    {
     1267        m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
     1268        return appendCall(operation);
     1269    }
    12651270
    12661271    JITCompiler::Call callOperationWithCallFrameRollbackOnException(V_JITOperation_ECb operation, void* pointer)
     
    20052010    {
    20062011        m_jit.setupArgumentsWithExecState(arg1, arg2, arg3.payloadGPR());
     2012        return appendCall(operation);
     2013    }
     2014    JITCompiler::Call callOperation(V_JITOperation_ECCJZ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3, GPRReg arg4)
     2015    {
     2016        m_jit.setupArgumentsWithExecState(arg1, arg2, arg3.payloadGPR(), arg4);
    20072017        return appendCall(operation);
    20082018    }
     
    25902600    {
    25912601        m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR());
     2602        return appendCall(operation);
     2603    }
     2604    JITCompiler::Call callOperation(V_JITOperation_ECCJZ operation, GPRReg arg1, GPRReg arg2, JSValueRegs arg3, GPRReg arg4)
     2605    {
     2606        m_jit.setupArgumentsWithExecState(arg1, arg2, EABI_32BIT_DUMMY_ARG arg3.payloadGPR(), arg3.tagGPR(), arg4);
    25922607        return appendCall(operation);
    25932608    }
     
    29652980    void compileMapSet(Node*);
    29662981    void compileWeakMapGet(Node*);
     2982    void compileWeakSetAdd(Node*);
     2983    void compileWeakMapSet(Node*);
    29672984    void compileLoadKeyFromMapBucket(Node*);
    29682985    void compileLoadValueFromMapBucket(Node*);
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

    r227410 r227723  
    45284528    case WeakMapGet:
    45294529        compileWeakMapGet(node);
     4530        break;
     4531
     4532    case WeakSetAdd:
     4533        compileWeakSetAdd(node);
     4534        break;
     4535
     4536    case WeakMapSet:
     4537        compileWeakMapSet(node);
    45304538        break;
    45314539
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r227410 r227723  
    49194919        break;
    49204920
     4921    case WeakSetAdd:
     4922        compileWeakSetAdd(node);
     4923        break;
     4924
     4925    case WeakMapSet:
     4926        compileWeakMapSet(node);
     4927        break;
     4928
    49214929    case StringSlice: {
    49224930        compileStringSlice(node);
  • trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp

    r227410 r227723  
    214214    case MapSet:
    215215    case WeakMapGet:
     216    case WeakSetAdd:
     217    case WeakMapSet:
    216218    case IsEmpty:
    217219    case IsUndefined:
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

    r227700 r227723  
    10941094        case WeakMapGet:
    10951095            compileWeakMapGet();
     1096            break;
     1097        case WeakSetAdd:
     1098            compileWeakSetAdd();
     1099            break;
     1100        case WeakMapSet:
     1101            compileWeakMapSet();
    10961102            break;
    10971103        case IsObject:
     
    91189124            result = bucketKey;
    91199125        setJSValue(result);
     9126    }
     9127
     9128    void compileWeakSetAdd()
     9129    {
     9130        LValue set = lowWeakSetObject(m_node->child1());
     9131        LValue key = lowObject(m_node->child2());
     9132        LValue hash = lowInt32(m_node->child3());
     9133
     9134        vmCall(Void, m_out.operation(operationWeakSetAdd), m_callFrame, set, key, hash);
     9135    }
     9136
     9137    void compileWeakMapSet()
     9138    {
     9139        LValue map = lowWeakMapObject(m_graph.varArgChild(m_node, 0));
     9140        LValue key = lowObject(m_graph.varArgChild(m_node, 1));
     9141        LValue value = lowJSValue(m_graph.varArgChild(m_node, 2));
     9142        LValue hash = lowInt32(m_graph.varArgChild(m_node, 3));
     9143
     9144        vmCall(Void, m_out.operation(operationWeakMapSet), m_callFrame, map, key, value, hash);
    91209145    }
    91219146
  • trunk/Source/JavaScriptCore/jit/JITOperations.h

    r227107 r227723  
    281281typedef void (JIT_OPERATION *V_JITOperation_ECliJsf)(ExecState*, CallLinkInfo*, JSFunction*);
    282282typedef void (JIT_OPERATION *V_JITOperation_ECCJ)(ExecState*, JSCell*, JSCell*, EncodedJSValue);
     283typedef void (JIT_OPERATION *V_JITOperation_ECCZ)(ExecState*, JSCell*, JSCell*, int32_t);
     284typedef void (JIT_OPERATION *V_JITOperation_ECCJZ)(ExecState*, JSCell*, JSCell*, EncodedJSValue, int32_t);
    283285typedef void (JIT_OPERATION *V_JITOperation_EZSymtabJ)(ExecState*, int32_t, SymbolTable*, EncodedJSValue);
    284286typedef void (JIT_OPERATION *V_JITOperation_EJ)(ExecState*, EncodedJSValue);
  • trunk/Source/JavaScriptCore/runtime/Intrinsic.cpp

    r226775 r227723  
    170170    case JSWeakMapHasIntrinsic:
    171171        return "JSWeakMapHasIntrinsic";
     172    case JSWeakMapSetIntrinsic:
     173        return "JSWeakMapSetIntrinsic";
    172174    case JSWeakSetHasIntrinsic:
    173175        return "JSWeakSetHasIntrinsic";
     176    case JSWeakSetAddIntrinsic:
     177        return "JSWeakSetAddIntrinsic";
    174178    case HasOwnPropertyIntrinsic:
    175179        return "HasOwnPropertyIntrinsic";
  • trunk/Source/JavaScriptCore/runtime/Intrinsic.h

    r226775 r227723  
    9898    JSWeakMapGetIntrinsic,
    9999    JSWeakMapHasIntrinsic,
     100    JSWeakMapSetIntrinsic,
    100101    JSWeakSetHasIntrinsic,
     102    JSWeakSetAddIntrinsic,
    101103    HasOwnPropertyIntrinsic,
    102104    AtomicsAddIntrinsic,
  • trunk/Source/JavaScriptCore/runtime/WeakMapImpl.h

    r226017 r227723  
    222222    }
    223223
     224    // WeakMap operations must not cause GC. We model operations in DFG based on this guarantee.
     225    // This guarantee is ensured by DisallowGC.
     226
    224227    template <typename T = WeakMapBucketType>
    225228    ALWAYS_INLINE typename std::enable_if<std::is_same<T, WeakMapBucket<WeakMapBucketDataKeyValue>>::value, JSValue>::type get(JSObject* key)
  • trunk/Source/JavaScriptCore/runtime/WeakMapPrototype.cpp

    r225832 r227723  
    4848    JSC_NATIVE_INTRINSIC_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->get, protoFuncWeakMapGet, static_cast<unsigned>(PropertyAttribute::DontEnum), 1, JSWeakMapGetIntrinsic);
    4949    JSC_NATIVE_INTRINSIC_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->has, protoFuncWeakMapHas, static_cast<unsigned>(PropertyAttribute::DontEnum), 1, JSWeakMapHasIntrinsic);
    50     JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->set, protoFuncWeakMapSet, static_cast<unsigned>(PropertyAttribute::DontEnum), 2);
     50    JSC_NATIVE_INTRINSIC_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->set, protoFuncWeakMapSet, static_cast<unsigned>(PropertyAttribute::DontEnum), 2, JSWeakMapSetIntrinsic);
    5151
    5252    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(&vm, "WeakMap"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
  • trunk/Source/JavaScriptCore/runtime/WeakSetPrototype.cpp

    r225832 r227723  
    4646    JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->deleteKeyword, protoFuncWeakSetDelete, static_cast<unsigned>(PropertyAttribute::DontEnum), 1);
    4747    JSC_NATIVE_INTRINSIC_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->has, protoFuncWeakSetHas, static_cast<unsigned>(PropertyAttribute::DontEnum), 1, JSWeakSetHasIntrinsic);
    48     JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->add, protoFuncWeakSetAdd, static_cast<unsigned>(PropertyAttribute::DontEnum), 1);
     48    JSC_NATIVE_INTRINSIC_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->add, protoFuncWeakSetAdd, static_cast<unsigned>(PropertyAttribute::DontEnum), 1, JSWeakSetAddIntrinsic);
    4949
    5050    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(&vm, "WeakSet"), PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
Note: See TracChangeset for help on using the changeset viewer.