Changeset 228420 in webkit
- Timestamp:
- Feb 13, 2018 9:02:45 AM (6 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r228411 r228420 1 2018-02-10 Filip Pizlo <fpizlo@apple.com> 2 3 Lock down JSFunction 4 https://bugs.webkit.org/show_bug.cgi?id=182652 5 6 Reviewed by Saam Barati. 7 8 This poisons pointers in JSFunction and puts all of the types in the JSFunction hierarchy in 9 isospaces. 10 11 This is so neutral on JetStream: 0.01% slower with p = 0.969211. 12 13 * dfg/DFGSpeculativeJIT.cpp: 14 (JSC::DFG::SpeculativeJIT::compileNewFunctionCommon): 15 (JSC::DFG::SpeculativeJIT::compileNewFunction): 16 (JSC::DFG::SpeculativeJIT::compileCreateThis): 17 * dfg/DFGSpeculativeJIT.h: 18 (JSC::DFG::SpeculativeJIT::TrustedImmPtr::TrustedImmPtr): 19 (JSC::DFG::SpeculativeJIT::TrustedImmPtr::weakPointer): 20 (JSC::DFG::SpeculativeJIT::TrustedImmPtr::weakPoisonedPointer): 21 * dfg/DFGSpeculativeJIT64.cpp: 22 (JSC::DFG::SpeculativeJIT::compile): 23 * ftl/FTLLowerDFGToB3.cpp: 24 (JSC::FTL::DFG::LowerDFGToB3::compileGetExecutable): 25 (JSC::FTL::DFG::LowerDFGToB3::compileNewFunction): 26 (JSC::FTL::DFG::LowerDFGToB3::weakPointer): 27 (JSC::FTL::DFG::LowerDFGToB3::weakPoisonedPointer): 28 * ftl/FTLOutput.h: 29 (JSC::FTL::Output::weakPointer): 30 (JSC::FTL::Output::weakPoisonedPointer): 31 * heap/MarkedSpace.cpp: 32 * jit/JITOpcodes.cpp: 33 (JSC::JIT::emit_op_create_this): 34 * jit/ThunkGenerators.cpp: 35 (JSC::virtualThunkFor): 36 (JSC::nativeForGenerator): 37 (JSC::boundThisNoArgsFunctionCallGenerator): 38 * llint/LowLevelInterpreter.asm: 39 * llint/LowLevelInterpreter64.asm: 40 * runtime/JSAsyncFunction.h: 41 (JSC::JSAsyncFunction::subspaceFor): 42 * runtime/JSAsyncGeneratorFunction.h: 43 (JSC::JSAsyncGeneratorFunction::subspaceFor): 44 * runtime/JSBoundFunction.h: 45 (JSC::JSBoundFunction::subspaceFor): 46 * runtime/JSCPoison.h: 47 * runtime/JSCustomGetterSetterFunction.h: 48 (JSC::JSCustomGetterSetterFunction::subspaceFor): 49 * runtime/JSFunction.h: 50 (JSC::JSFunction::subspaceFor): 51 * runtime/JSGeneratorFunction.h: 52 (JSC::JSGeneratorFunction::subspaceFor): 53 * runtime/JSNativeStdFunction.h: 54 (JSC::JSNativeStdFunction::subspaceFor): 55 * runtime/VM.cpp: 56 (JSC::VM::VM): 57 * runtime/VM.h: 58 * wasm/js/WebAssemblyFunction.h: 59 * wasm/js/WebAssemblyWrapperFunction.h: 60 1 61 2018-02-12 Saam Barati <sbarati@apple.com> 2 62 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r228411 r228420 6719 6719 6720 6720 template <typename ClassType> 6721 void SpeculativeJIT::compileNewFunctionCommon(GPRReg resultGPR, RegisteredStructure structure, GPRReg scratch1GPR, GPRReg scratch2GPR, GPRReg scopeGPR, MacroAssembler::JumpList& slowPath, size_t size, FunctionExecutable* executable , ptrdiff_t offsetOfScopeChain, ptrdiff_t offsetOfExecutable, ptrdiff_t offsetOfRareData)6721 void SpeculativeJIT::compileNewFunctionCommon(GPRReg resultGPR, RegisteredStructure structure, GPRReg scratch1GPR, GPRReg scratch2GPR, GPRReg scopeGPR, MacroAssembler::JumpList& slowPath, size_t size, FunctionExecutable* executable) 6722 6722 { 6723 6723 auto butterfly = TrustedImmPtr(nullptr); … … 6725 6725 emitAllocateJSObjectWithKnownSize<ClassType>(resultGPR, TrustedImmPtr(structure), butterfly, mask, scratch1GPR, scratch2GPR, slowPath, size); 6726 6726 6727 m_jit.storePtr(scopeGPR, JITCompiler::Address(resultGPR, offsetOfScopeChain));6728 m_jit.storePtr(TrustedImmPtr::weakPoi nter(m_jit.graph(), executable), JITCompiler::Address(resultGPR, offsetOfExecutable));6729 m_jit.storePtr(TrustedImmPtr(0), JITCompiler::Address(resultGPR, offsetOfRareData));6727 m_jit.storePtr(scopeGPR, JITCompiler::Address(resultGPR, JSFunction::offsetOfScopeChain())); 6728 m_jit.storePtr(TrustedImmPtr::weakPoisonedPointer<JSFunctionPoison>(m_jit.graph(), executable), JITCompiler::Address(resultGPR, JSFunction::offsetOfExecutable())); 6729 m_jit.storePtr(TrustedImmPtr(0), JITCompiler::Address(resultGPR, JSFunction::offsetOfRareData())); 6730 6730 6731 6731 m_jit.mutatorFence(*m_jit.vm()); … … 6789 6789 6790 6790 if (nodeType == NewFunction) { 6791 compileNewFunctionCommon<JSFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSFunction::allocationSize(0), executable , JSFunction::offsetOfScopeChain(), JSFunction::offsetOfExecutable(), JSFunction::offsetOfRareData());6791 compileNewFunctionCommon<JSFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSFunction::allocationSize(0), executable); 6792 6792 6793 6793 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewFunctionWithInvalidatedReallocationWatchpoint, resultGPR, scopeGPR, executable)); … … 6795 6795 6796 6796 if (nodeType == NewGeneratorFunction) { 6797 compileNewFunctionCommon<JSGeneratorFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSGeneratorFunction::allocationSize(0), executable , JSGeneratorFunction::offsetOfScopeChain(), JSGeneratorFunction::offsetOfExecutable(), JSGeneratorFunction::offsetOfRareData());6797 compileNewFunctionCommon<JSGeneratorFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSGeneratorFunction::allocationSize(0), executable); 6798 6798 6799 6799 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewGeneratorFunctionWithInvalidatedReallocationWatchpoint, resultGPR, scopeGPR, executable)); … … 6801 6801 6802 6802 if (nodeType == NewAsyncFunction) { 6803 compileNewFunctionCommon<JSAsyncFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSAsyncFunction::allocationSize(0), executable , JSAsyncFunction::offsetOfScopeChain(), JSAsyncFunction::offsetOfExecutable(), JSAsyncFunction::offsetOfRareData());6803 compileNewFunctionCommon<JSAsyncFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSAsyncFunction::allocationSize(0), executable); 6804 6804 6805 6805 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewAsyncFunctionWithInvalidatedReallocationWatchpoint, resultGPR, scopeGPR, executable)); … … 6807 6807 6808 6808 if (nodeType == NewAsyncGeneratorFunction) { 6809 compileNewFunctionCommon<JSAsyncGeneratorFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSAsyncGeneratorFunction::allocationSize(0), executable , JSAsyncGeneratorFunction::offsetOfScopeChain(), JSAsyncGeneratorFunction::offsetOfExecutable(), JSAsyncGeneratorFunction::offsetOfRareData());6809 compileNewFunctionCommon<JSAsyncGeneratorFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSAsyncGeneratorFunction::allocationSize(0), executable); 6810 6810 6811 6811 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewAsyncGeneratorFunctionWithInvalidatedReallocationWatchpoint, resultGPR, scopeGPR, executable)); … … 11486 11486 m_jit.loadPtr(JITCompiler::Address(calleeGPR, JSFunction::offsetOfRareData()), rareDataGPR); 11487 11487 slowPath.append(m_jit.branchTestPtr(MacroAssembler::Zero, rareDataGPR)); 11488 m_jit.xorPtr(JITCompiler::TrustedImmPtr(JSFunctionPoison::key()), rareDataGPR); 11488 11489 m_jit.load32(JITCompiler::Address(rareDataGPR, FunctionRareData::offsetOfObjectAllocationProfile() + ObjectAllocationProfile::offsetOfAllocator()), allocatorGPR); 11489 11490 m_jit.loadPtr(JITCompiler::Address(rareDataGPR, FunctionRareData::offsetOfObjectAllocationProfile() + ObjectAllocationProfile::offsetOfStructure()), structureGPR); … … 11496 11497 11497 11498 m_jit.loadPtr(JITCompiler::Address(calleeGPR, JSFunction::offsetOfRareData()), rareDataGPR); 11499 m_jit.xorPtr(JITCompiler::TrustedImmPtr(JSFunctionPoison::key()), rareDataGPR); 11498 11500 m_jit.load32(JITCompiler::Address(rareDataGPR, FunctionRareData::offsetOfObjectAllocationProfile() + ObjectAllocationProfile::offsetOfInlineCapacity()), inlineCapacityGPR); 11499 11501 m_jit.emitInitializeInlineStorage(resultGPR, inlineCapacityGPR); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
r228411 r228420 122 122 : m_value(value) 123 123 { 124 static_assert(!std::is_base_of< HeapCell, T>::value, "To use a GC pointer, the graph must be aware of it. Use SpeculativeJIT::TrustedImmPtr::weakPointer instead.");124 static_assert(!std::is_base_of<JSCell, T>::value, "To use a GC pointer, the graph must be aware of it. Use SpeculativeJIT::TrustedImmPtr::weakPointer instead."); 125 125 } 126 126 … … 154 154 static TrustedImmPtr weakPointer(Graph& graph, JSCell* cell) 155 155 { 156 // There are weird relationships in how optimized CodeBlocks157 // point to other CodeBlocks. We don't want to have them be158 // part of the weak pointer set. For example, an optimized CodeBlock159 // having a weak pointer to itself will cause it to get collected.160 ASSERT(!jsDynamicCast<CodeBlock*>(graph.m_vm, cell));161 162 156 graph.m_plan.weakReferences.addLazily(cell); 163 157 return TrustedImmPtr(bitwise_cast<size_t>(cell)); 158 } 159 160 template<typename Key> 161 static TrustedImmPtr weakPoisonedPointer(Graph& graph, JSCell* cell) 162 { 163 graph.m_plan.weakReferences.addLazily(cell); 164 return TrustedImmPtr(bitwise_cast<size_t>(cell) ^ Key::key()); 164 165 } 165 166 … … 3082 3083 void loadFromIntTypedArray(GPRReg baseReg, GPRReg storageReg, GPRReg propertyReg, GPRReg resultReg, TypedArrayType); 3083 3084 void setIntTypedArrayLoadResult(Node*, GPRReg resultReg, TypedArrayType, bool canSpeculate = false); 3084 template <typename ClassType> void compileNewFunctionCommon(GPRReg, RegisteredStructure, GPRReg, GPRReg, GPRReg, MacroAssembler::JumpList&, size_t, FunctionExecutable* , ptrdiff_t, ptrdiff_t, ptrdiff_t);3085 template <typename ClassType> void compileNewFunctionCommon(GPRReg, RegisteredStructure, GPRReg, GPRReg, GPRReg, MacroAssembler::JumpList&, size_t, FunctionExecutable*); 3085 3086 void compileNewFunction(Node*); 3086 3087 void compileSetFunctionName(Node*); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r228411 r228420 1 1 /* 2 * Copyright (C) 2011-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2011-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 4253 4253 speculateCellType(node->child1(), functionGPR, SpecFunction, JSFunctionType); 4254 4254 m_jit.loadPtr(JITCompiler::Address(functionGPR, JSFunction::offsetOfExecutable()), resultGPR); 4255 m_jit.xorPtr(JITCompiler::TrustedImmPtr(JSFunctionPoison::key()), resultGPR); 4255 4256 cellResult(resultGPR, node); 4256 4257 break; -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r228411 r228420 2945 2945 LValue cell = lowCell(m_node->child1()); 2946 2946 speculateFunction(m_node->child1(), cell); 2947 setJSValue(m_out.loadPtr(cell, m_heaps.JSFunction_executable)); 2947 setJSValue( 2948 m_out.bitXor( 2949 m_out.loadPtr(cell, m_heaps.JSFunction_executable), 2950 m_out.constIntPtr(JSFunctionPoison::key()))); 2948 2951 } 2949 2952 … … 4870 4873 // must be young. 4871 4874 m_out.storePtr(scope, fastObject, m_heaps.JSFunction_scope); 4872 m_out.storePtr(weakPoi nter(executable), fastObject, m_heaps.JSFunction_executable);4875 m_out.storePtr(weakPoisonedPointer<JSFunctionPoison>(executable), fastObject, m_heaps.JSFunction_executable); 4873 4876 m_out.storePtr(m_out.intPtrZero, fastObject, m_heaps.JSFunction_rareData); 4874 4877 … … 15726 15729 LValue weakPointer(JSCell* pointer) 15727 15730 { 15728 // There are weird relationships in how optimized CodeBlocks15729 // point to other CodeBlocks. We don't want to have them be15730 // part of the weak pointer set. For example, an optimized CodeBlock15731 // having a weak pointer to itself will cause it to get collected.15732 RELEASE_ASSERT(!jsDynamicCast<CodeBlock*>(vm(), pointer));15733 15734 15731 addWeakReference(pointer); 15735 15732 return m_out.weakPointer(m_graph, pointer); 15733 } 15734 15735 template<typename Key> 15736 LValue weakPoisonedPointer(JSCell* pointer) 15737 { 15738 addWeakReference(pointer); 15739 return m_out.weakPoisonedPointer<Key>(m_graph, pointer); 15736 15740 } 15737 15741 -
trunk/Source/JavaScriptCore/ftl/FTLOutput.h
r225913 r228420 112 112 ASSERT(graph.m_plan.weakReferences.contains(cell)); 113 113 114 if (sizeof(void*) == 8) 115 return constInt64(bitwise_cast<intptr_t>(cell)); 116 return constInt32(bitwise_cast<intptr_t>(cell)); 114 return constIntPtr(bitwise_cast<intptr_t>(cell)); 115 } 116 117 template<typename Key> 118 LValue weakPoisonedPointer(DFG::Graph& graph, JSCell* cell) 119 { 120 ASSERT(graph.m_plan.weakReferences.contains(cell)); 121 122 return constIntPtr(bitwise_cast<intptr_t>(cell) ^ Key::key()); 117 123 } 118 124 … … 121 127 RELEASE_ASSERT(value->value().isCell()); 122 128 123 if (sizeof(void*) == 8) 124 return constInt64(bitwise_cast<intptr_t>(value->cell())); 125 return constInt32(bitwise_cast<intptr_t>(value->cell())); 129 return constIntPtr(bitwise_cast<intptr_t>(value->cell())); 126 130 } 127 131 -
trunk/Source/JavaScriptCore/heap/MarkedSpace.cpp
r227718 r228420 142 142 add(sizeof(UnlinkedFunctionCodeBlock)); 143 143 add(sizeof(JSString)); 144 add(sizeof(JSFunction));145 144 146 145 { -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r227617 r228420 768 768 loadPtr(Address(calleeReg, JSFunction::offsetOfRareData()), rareDataReg); 769 769 addSlowCase(branchTestPtr(Zero, rareDataReg)); 770 xorPtr(TrustedImmPtr(JSFunctionPoison::key()), rareDataReg); 770 771 load32(Address(rareDataReg, FunctionRareData::offsetOfObjectAllocationProfile() + ObjectAllocationProfile::offsetOfAllocator()), allocatorReg); 771 772 loadPtr(Address(rareDataReg, FunctionRareData::offsetOfObjectAllocationProfile() + ObjectAllocationProfile::offsetOfStructure()), structureReg); … … 783 784 emitGetVirtualRegister(callee, scratchReg); 784 785 loadPtr(Address(scratchReg, JSFunction::offsetOfRareData()), scratchReg); 786 xorPtr(TrustedImmPtr(JSFunctionPoison::key()), scratchReg); 785 787 load32(Address(scratchReg, FunctionRareData::offsetOfObjectAllocationProfile() + ObjectAllocationProfile::offsetOfInlineCapacity()), scratchReg); 786 788 emitInitializeInlineStorage(resultReg, scratchReg); -
trunk/Source/JavaScriptCore/jit/Repatch.cpp
r225768 r228420 937 937 CCallHelpers::Address(calleeGPR, JSFunction::offsetOfExecutable()), 938 938 scratchGPR); 939 stubJit.xorPtr(CCallHelpers::TrustedImmPtr(JSFunctionPoison::key()), scratchGPR); 939 940 940 941 comparisonValueGPR = scratchGPR; -
trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp
r227527 r228420 205 205 CCallHelpers::Address(GPRInfo::regT0, JSFunction::offsetOfExecutable()), 206 206 GPRInfo::regT4); 207 jit.xorPtr(CCallHelpers::TrustedImmPtr(JSFunctionPoison::key()), GPRInfo::regT4); 207 208 jit.loadPtr( 208 209 CCallHelpers::Address( … … 293 294 if (thunkFunctionType == ThunkFunctionType::JSFunction) { 294 295 jit.loadPtr(JSInterfaceJIT::Address(JSInterfaceJIT::regT1, JSFunction::offsetOfExecutable()), JSInterfaceJIT::regT1); 296 jit.xorPtr(JSInterfaceJIT::TrustedImmPtr(JSFunctionPoison::key()), JSInterfaceJIT::regT1); 295 297 jit.call(JSInterfaceJIT::Address(JSInterfaceJIT::regT1, executableOffsetToFunction)); 296 298 } else … … 308 310 if (thunkFunctionType == ThunkFunctionType::JSFunction) { 309 311 jit.loadPtr(JSInterfaceJIT::Address(X86Registers::esi, JSFunction::offsetOfExecutable()), X86Registers::r9); 312 jit.xorPtr(JSInterfaceJIT::TrustedImmPtr(JSFunctionPoison::key()), X86Registers::r9); 310 313 jit.loadPtr(JSInterfaceJIT::Address(X86Registers::r9, executableOffsetToFunction), X86Registers::r9); 311 314 } else … … 327 330 if (thunkFunctionType == ThunkFunctionType::JSFunction) { 328 331 jit.loadPtr(JSInterfaceJIT::Address(X86Registers::edx, JSFunction::offsetOfExecutable()), X86Registers::r9); 332 jit.xorPtr(JSInterfaceJIT::TrustedImmPtr(JSFunctionPoison::key()), X86Registers::r9); 329 333 jit.call(JSInterfaceJIT::Address(X86Registers::r9, executableOffsetToFunction)); 330 334 } else … … 345 349 if (thunkFunctionType == ThunkFunctionType::JSFunction) { 346 350 jit.loadPtr(JSInterfaceJIT::Address(ARM64Registers::x1, JSFunction::offsetOfExecutable()), ARM64Registers::x2); 351 jit.xorPtr(JSInterfaceJIT::TrustedImmPtr(JSFunctionPoison::key()), ARM64Registers::x2); 347 352 jit.loadPtr(JSInterfaceJIT::Address(ARM64Registers::x2, executableOffsetToFunction), ARM64Registers::x2); 348 353 } else … … 365 370 if (thunkFunctionType == ThunkFunctionType::JSFunction) { 366 371 jit.loadPtr(JSInterfaceJIT::Address(JSInterfaceJIT::argumentGPR1, JSFunction::offsetOfExecutable()), JSInterfaceJIT::regT2); 372 jit.xorPtr(JSInterfaceJIT::TrustedImmPtr(JSFunctionPoison::key()), JSInterfaceJIT::regT2); 367 373 jit.call(JSInterfaceJIT::Address(JSInterfaceJIT::regT2, executableOffsetToFunction)); 368 374 } else … … 1165 1171 CCallHelpers::Address(GPRInfo::regT3, JSFunction::offsetOfExecutable()), 1166 1172 GPRInfo::regT0); 1173 jit.xorPtr(CCallHelpers::TrustedImmPtr(JSFunctionPoison::key()), GPRInfo::regT0); 1167 1174 jit.loadPtr( 1168 1175 CCallHelpers::Address( -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r227874 r228420 941 941 end 942 942 943 macro functionForCallCodeBlockGetter(targetRegister )943 macro functionForCallCodeBlockGetter(targetRegister, scratch) 944 944 if JSVALUE64 945 945 loadp Callee[cfr], targetRegister … … 948 948 end 949 949 loadp JSFunction::m_executable[targetRegister], targetRegister 950 unpoison(_g_JSFunctionPoison, targetRegister, scratch) 950 951 loadp FunctionExecutable::m_codeBlockForCall[targetRegister], targetRegister 951 952 loadp ExecutableToCodeBlockEdge::m_codeBlock[targetRegister], targetRegister 952 953 end 953 954 954 macro functionForConstructCodeBlockGetter(targetRegister )955 macro functionForConstructCodeBlockGetter(targetRegister, scratch) 955 956 if JSVALUE64 956 957 loadp Callee[cfr], targetRegister … … 959 960 end 960 961 loadp JSFunction::m_executable[targetRegister], targetRegister 962 unpoison(_g_JSFunctionPoison, targetRegister, scratch) 961 963 loadp FunctionExecutable::m_codeBlockForConstruct[targetRegister], targetRegister 962 964 loadp ExecutableToCodeBlockEdge::m_codeBlock[targetRegister], targetRegister 963 965 end 964 966 965 macro notFunctionCodeBlockGetter(targetRegister )967 macro notFunctionCodeBlockGetter(targetRegister, ignored) 966 968 loadp CodeBlock[cfr], targetRegister 967 969 end … … 986 988 addp maxFrameExtentForSlowPathCall, sp 987 989 end 988 codeBlockGetter(t1 )990 codeBlockGetter(t1, t2) 989 991 if not C_LOOP 990 992 baddis 5, CodeBlock::m_llintExecuteCounter + BaselineExecutionCounter::m_counter[t1], .continue … … 1015 1017 jmp r0 1016 1018 .recover: 1017 codeBlockGetter(t1 )1019 codeBlockGetter(t1, t2) 1018 1020 .continue: 1019 1021 end … … 1056 1058 # Stack check slow path returned that the stack was ok. 1057 1059 # Since they were clobbered, need to get CodeBlock and new sp 1058 codeBlockGetter(t1 )1060 codeBlockGetter(t1, t2) 1059 1061 getFrameRegisterSizeForCodeBlock(t1, t0) 1060 1062 subp cfr, t0, t0 -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
r227874 r228420 2103 2103 loadp Callee[cfr], t1 2104 2104 loadp JSFunction::m_executable[t1], t1 2105 unpoison(_g_JSFunctionPoison, t1, t2) 2105 2106 checkStackPointerAlignment(t3, 0xdead0001) 2106 2107 if C_LOOP -
trunk/Source/JavaScriptCore/runtime/JSAsyncFunction.h
r215345 r228420 1 1 /* 2 2 * Copyright (C) 2016 Caitlin Potter <caitp@igalia.com>. 3 * Copyright (C) 2018 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 38 39 const static unsigned StructureFlags = Base::StructureFlags; 39 40 41 template<typename CellType> 42 static IsoSubspace* subspaceFor(VM& vm) 43 { 44 return &vm.asyncFunctionSpace; 45 } 46 40 47 DECLARE_EXPORT_INFO; 41 48 -
trunk/Source/JavaScriptCore/runtime/JSAsyncGeneratorFunction.h
r221080 r228420 1 1 /* 2 2 * Copyright (C) 2017 Oleksandr Skachkov <gskachkov@gmail.com>. 3 * Copyright (C) 2018 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 37 38 38 39 const static unsigned StructureFlags = Base::StructureFlags; 40 41 template<typename CellType> 42 static IsoSubspace* subspaceFor(VM& vm) 43 { 44 return &vm.asyncGeneratorFunctionSpace; 45 } 39 46 40 47 DECLARE_EXPORT_INFO; -
trunk/Source/JavaScriptCore/runtime/JSBoundFunction.h
r216561 r228420 1 1 /* 2 * Copyright (C) 2011 , 2016Apple Inc. All rights reserved.2 * Copyright (C) 2011-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 42 42 const static unsigned StructureFlags = ~ImplementsDefaultHasInstance & Base::StructureFlags; 43 43 44 template<typename CellType> 45 static IsoSubspace* subspaceFor(VM& vm) 46 { 47 return &vm.boundFunctionSpace; 48 } 49 44 50 static JSBoundFunction* create(VM&, ExecState*, JSGlobalObject*, JSObject* targetFunction, JSValue boundThis, JSArray* boundArgs, int, const String& name); 45 51 … … 70 76 void finishCreation(VM&, NativeExecutable*, int length); 71 77 78 // FIXME: Consider poisoning these pointers. 79 // https://bugs.webkit.org/show_bug.cgi?id=182713 72 80 WriteBarrier<JSObject> m_targetFunction; 73 81 WriteBarrier<Unknown> m_boundThis; -
trunk/Source/JavaScriptCore/runtime/JSCPoison.h
r227874 r228420 40 40 v(JSArrayBuffer) \ 41 41 v(JSCallbackObject) \ 42 v(JSFunction) \ 42 43 v(JSGlobalObject) \ 43 44 v(JSScriptFetchParameters) \ -
trunk/Source/JavaScriptCore/runtime/JSCustomGetterSetterFunction.h
r206525 r228420 1 1 /* 2 * Copyright (C) 2015 , 2016Apple Inc. All rights reserved.2 * Copyright (C) 2015-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 41 41 static const unsigned StructureFlags = Base::StructureFlags; 42 42 43 template<typename CellType> 44 static IsoSubspace* subspaceFor(VM& vm) 45 { 46 return &vm.customGetterSetterFunctionSpace; 47 } 48 43 49 static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) 44 50 { -
trunk/Source/JavaScriptCore/runtime/JSFunction.h
r225891 r228420 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2003 , 2006-2009, 2015-2016Apple Inc. All rights reserved.3 * Copyright (C) 2003-2018 Apple Inc. All rights reserved. 4 4 * Copyright (C) 2007 Cameron Zwarich (cwzwarich@uwaterloo.ca) 5 5 * Copyright (C) 2007 Maks Orlovich … … 62 62 63 63 public: 64 65 template<typename CellType> 66 static IsoSubspace* subspaceFor(VM& vm) 67 { 68 return &vm.functionSpace; 69 } 70 64 71 typedef JSCallee Base; 65 72 const static unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | OverridesGetPropertyNames; … … 213 220 static EncodedJSValue nameGetter(ExecState*, EncodedJSValue, PropertyName); 214 221 215 WriteBarrier<ExecutableBase> m_executable; 216 WriteBarrier<FunctionRareData> m_rareData; 222 template<typename T> 223 using PoisonedBarrier = PoisonedWriteBarrier<JSFunctionPoison, T>; 224 225 PoisonedBarrier<ExecutableBase> m_executable; 226 PoisonedBarrier<FunctionRareData> m_rareData; 217 227 }; 218 228 -
trunk/Source/JavaScriptCore/runtime/JSGeneratorFunction.h
r215345 r228420 1 1 /* 2 2 * Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>. 3 * Copyright (C) 2018 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 67 68 const static unsigned StructureFlags = Base::StructureFlags; 68 69 70 template<typename CellType> 71 static IsoSubspace* subspaceFor(VM& vm) 72 { 73 return &vm.generatorFunctionSpace; 74 } 75 69 76 DECLARE_EXPORT_INFO; 70 77 -
trunk/Source/JavaScriptCore/runtime/JSNativeStdFunction.h
r206525 r228420 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 41 41 const static unsigned StructureFlags = Base::StructureFlags; 42 42 43 template<typename CellType> 44 static IsoSubspace* subspaceFor(VM& vm) 45 { 46 return &vm.nativeStdFunctionSpace; 47 } 48 43 49 DECLARE_EXPORT_INFO; 44 50 -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r228366 r228420 69 69 #include "JSAPIValueWrapper.h" 70 70 #include "JSArray.h" 71 #include "JSAsyncFunction.h" 71 72 #include "JSBigInt.h" 73 #include "JSBoundFunction.h" 72 74 #include "JSCInlines.h" 75 #include "JSCustomGetterSetterFunction.h" 73 76 #include "JSDestructibleObjectHeapCellType.h" 74 77 #include "JSFixedArray.h" … … 132 135 #include "Watchdog.h" 133 136 #include "WeakGCMapInlines.h" 137 #include "WebAssemblyFunction.h" 138 #include "WebAssemblyWrapperFunction.h" 134 139 #include <wtf/CurrentTime.h> 135 140 #include <wtf/ProcessID.h> … … 251 256 , webAssemblyCodeBlockSpace("JSWebAssemblyCodeBlockSpace", heap, webAssemblyCodeBlockHeapCellType.get(), fastMallocAllocator.get()) 252 257 #endif 258 , asyncFunctionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSAsyncFunction) 259 , asyncGeneratorFunctionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSAsyncGeneratorFunction) 260 , boundFunctionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSBoundFunction) 261 , customGetterSetterFunctionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSCustomGetterSetterFunction) 253 262 , directEvalExecutableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), DirectEvalExecutable) 254 263 , errorInstanceSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), ErrorInstance) … … 256 265 , executableToCodeBlockEdgeSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), ExecutableToCodeBlockEdge) 257 266 , functionExecutableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), FunctionExecutable) 267 , functionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSFunction) 268 , generatorFunctionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSGeneratorFunction) 258 269 , indirectEvalExecutableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), IndirectEvalExecutable) 259 270 , inferredTypeSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), InferredType) … … 261 272 , moduleProgramExecutableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), ModuleProgramExecutable) 262 273 , nativeExecutableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), NativeExecutable) 274 , nativeStdFunctionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSNativeStdFunction) 263 275 , programExecutableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), ProgramExecutable) 264 276 , propertyTableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), PropertyTable) … … 267 279 , weakSetSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), JSWeakSet) 268 280 , weakMapSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), JSWeakMap) 281 #if ENABLE(WEBASSEMBLY) 282 , webAssemblyFunctionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), WebAssemblyFunction) 283 , webAssemblyWrapperFunctionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), WebAssemblyWrapperFunction) 284 #endif 269 285 , errorInstancesWithFinalizers(errorInstanceSpace) 270 286 , exceptionsWithFinalizers(exceptionSpace) -
trunk/Source/JavaScriptCore/runtime/VM.h
r228366 r228420 339 339 #endif 340 340 341 IsoSubspace asyncFunctionSpace; 342 IsoSubspace asyncGeneratorFunctionSpace; 343 IsoSubspace boundFunctionSpace; 344 IsoSubspace customGetterSetterFunctionSpace; 341 345 IsoSubspace directEvalExecutableSpace; 342 346 IsoSubspace errorInstanceSpace; … … 344 348 IsoSubspace executableToCodeBlockEdgeSpace; 345 349 IsoSubspace functionExecutableSpace; 350 IsoSubspace functionSpace; 351 IsoSubspace generatorFunctionSpace; 346 352 IsoSubspace indirectEvalExecutableSpace; 347 353 IsoSubspace inferredTypeSpace; … … 349 355 IsoSubspace moduleProgramExecutableSpace; 350 356 IsoSubspace nativeExecutableSpace; 357 IsoSubspace nativeStdFunctionSpace; 351 358 IsoSubspace programExecutableSpace; 352 359 IsoSubspace propertyTableSpace; … … 355 362 IsoSubspace weakSetSpace; 356 363 IsoSubspace weakMapSpace; 364 #if ENABLE(WEBASSEMBLY) 365 IsoSubspace webAssemblyFunctionSpace; 366 IsoSubspace webAssemblyWrapperFunctionSpace; 367 #endif 357 368 358 369 IsoCellSet errorInstancesWithFinalizers; -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.h
r225363 r228420 1 1 /* 2 * Copyright (C) 2016 Apple Inc. All rights reserved.2 * Copyright (C) 2016-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 49 49 const static unsigned StructureFlags = Base::StructureFlags | TypeOfShouldCallGetCallData; 50 50 51 template<typename CellType> 52 static IsoSubspace* subspaceFor(VM& vm) 53 { 54 return &vm.webAssemblyFunctionSpace; 55 } 56 51 57 DECLARE_EXPORT_INFO; 52 58 -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyWrapperFunction.h
r227527 r228420 39 39 const static unsigned StructureFlags = Base::StructureFlags; 40 40 41 template<typename CellType> 42 static IsoSubspace* subspaceFor(VM& vm) 43 { 44 return &vm.webAssemblyWrapperFunctionSpace; 45 } 46 41 47 DECLARE_INFO; 42 48
Note: See TracChangeset
for help on using the changeset viewer.