Changeset 262475 in webkit
- Timestamp:
- Jun 2, 2020, 9:47:30 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r262203 r262475 565 565 dfg/DFGCommon.h 566 566 dfg/DFGCompilationMode.h 567 dfg/DFGDoesGCCheck.h 567 568 dfg/DFGMinifiedID.h 568 569 -
trunk/Source/JavaScriptCore/ChangeLog
r262467 r262475 1 2020-06-02 Mark Lam <mark.lam@apple.com> 2 3 Enhance DoesGC verification to print more useful info when verification fails. 4 https://bugs.webkit.org/show_bug.cgi?id=212680 5 6 Reviewed by Yusuke Suzuki. 7 8 When DoesGC verification fails, the first step of debugging it would be to find 9 out what and which DFG node resulted in the failed verification. In pre-existing 10 code, all we get is an assertion failure. 11 12 This patch makes it so that the verifier will dump useful info. Here's an example: 13 14 Error: DoesGC failed @ D@34 DateGetInt32OrNaN in #DtCHMz:[0x1135bd1d0->0x1135bcab0->0x1135e5c80, DFGFunctionCall, 150 (DidTryToEnterInLoop)] 15 [0] frame 0x7ffee8285660 { 16 name: 17 sourceURL: 18 isInlinedFrame: false 19 callee: 0x1135f6820 20 returnPC: 0x50ce61248ae6 21 callerFrame: 0x7ffee82856f0 22 rawLocationBits: 5 0x5 23 codeBlock: 0x1135bd1d0 #DtCHMz:[0x1135bd1d0->0x1135bcab0->0x1135e5c80, DFGFunctionCall, 150 (DidTryToEnterInLoop)] 24 hasCodeOrigins: true 25 callSiteIndex: 5 of 13 26 jitCode: 0x113020200 start 0x50ce61214c60 end 0x50ce61219b00 27 line: 1 28 column: 60 29 EntryFrame: 0x7ffee8285860 30 } 31 [1] frame 0x7ffee82856f0 { 32 name: 33 sourceURL: date-format-xparb.js 34 isInlinedFrame: false 35 callee: 0x1135f65a0 36 returnPC: 0x50ce61227e99 37 callerFrame: 0x7ffee8285770 38 rawLocationBits: 4 0x4 39 codeBlock: 0x1135bd0a0 #BU6Zcd:[0x1135bd0a0->0x1135bc260->0x1135e5180, DFGFunctionCall, 112 (DidTryToEnterInLoop)] 40 hasCodeOrigins: true 41 callSiteIndex: 4 of 12 42 jitCode: 0x113004000 start 0x50ce61212c60 end 0x50ce61214960 43 line: 26 44 column: 22 45 EntryFrame: 0x7ffee8285860 46 } 47 [2] frame 0x7ffee8285770 { 48 name: 49 sourceURL: date-format-xparb.js 50 isInlinedFrame: false 51 callee: 0x1135f64e0 52 returnPC: 0x108058eb1 53 callerFrame: 0x7ffee82857e0 54 rawLocationBits: 1001 0x3e9 55 codeBlock: 0x1135bc130 #DAS9xe:[0x1135bc130->0x1135e5100, BaselineFunctionCall, 1149] 56 bc#1001 of 1149 57 line: 417 58 column: 38 59 EntryFrame: 0x7ffee8285860 60 } 61 [3] frame 0x7ffee82857e0 { 62 name: global code 63 sourceURL: date-format-xparb.js 64 isInlinedFrame: false 65 callee: 0x1130f97b8 66 returnPC: 0x108039043 67 callerFrame: 0x0 68 rawLocationBits: 23 0x17 69 codeBlock: 0x1135bc000 <global>#CukXvt:[0x1135bc000->0x1130cd768, LLIntGlobal, 81] 70 bc#23 of 81 71 line: 425 72 column: 3 73 EntryFrame: 0x7ffee8285860 74 } 75 76 ASSERTION FAILED: expectDoesGC() 77 78 The error message now comes with the node index, NodeType, codeBlock which this 79 failure was found in, and the JS call stack that led to the failure. 80 81 Changes made: 82 83 1. Introduced a DoesGCCheck value that is used to encode some of the above data. 84 85 Previously, we only recorded whether doesGC() returns true or false for the 86 Node. Now, we record the nodeIndex and nodeOp as well. 87 88 Note that we also set DoesGC expectations for OSR exits. So, DoesGCCheck 89 includes Special cases for those. 90 91 2. Added store64(TrustedImm64 imm, const void* address) emitters for X86_64 and ARM64. 92 Also added a test for this new emitter in testmasm. 93 94 * CMakeLists.txt: 95 * JavaScriptCore.xcodeproj/project.pbxproj: 96 * Sources.txt: 97 * assembler/MacroAssemblerARM64.h: 98 (JSC::MacroAssemblerARM64::store64): 99 * assembler/MacroAssemblerX86_64.h: 100 (JSC::MacroAssemblerX86_64::store64): 101 * assembler/testmasm.cpp: 102 (JSC::testStore64Imm64AddressPointer): 103 (JSC::run): 104 * dfg/DFGDoesGCCheck.cpp: Added. 105 (JSC::DFG::DoesGCCheck::verifyCanGC): 106 * dfg/DFGDoesGCCheck.h: Added. 107 (JSC::DFG::DoesGCCheck::DoesGCCheck): 108 (JSC::DFG::DoesGCCheck::encode): 109 (JSC::DFG::DoesGCCheck::set): 110 (JSC::DFG::DoesGCCheck::expectDoesGC): 111 (JSC::DFG::DoesGCCheck::special): 112 (JSC::DFG::DoesGCCheck::nodeIndex): 113 (JSC::DFG::DoesGCCheck::nodeOp): 114 (JSC::DFG::DoesGCCheck::isSpecial): 115 (JSC::DFG::DoesGCCheck::specialIndex): 116 (JSC::DFG::DoesGCCheck::bits): 117 * dfg/DFGGraph.cpp: 118 * dfg/DFGOSRExit.cpp: 119 (JSC::DFG::operationCompileOSRExit): 120 (JSC::DFG::OSRExit::compileExit): 121 * dfg/DFGSpeculativeJIT64.cpp: 122 (JSC::DFG::SpeculativeJIT::compile): 123 * ftl/FTLLowerDFGToB3.cpp: 124 (JSC::FTL::DFG::LowerDFGToB3::compileNode): 125 * ftl/FTLOSRExitCompiler.cpp: 126 (JSC::FTL::compileStub): 127 (JSC::FTL::operationCompileFTLOSRExit): 128 * heap/CompleteSubspace.cpp: 129 (JSC::CompleteSubspace::tryAllocateSlow): 130 (JSC::CompleteSubspace::reallocatePreciseAllocationNonVirtual): 131 * heap/CompleteSubspaceInlines.h: 132 (JSC::CompleteSubspace::allocateNonVirtual): 133 * heap/DeferGC.h: 134 (JSC::DeferGC::~DeferGC): 135 * heap/GCDeferralContextInlines.h: 136 (JSC::GCDeferralContext::~GCDeferralContext): 137 * heap/Heap.cpp: 138 (JSC::Heap::collectNow): 139 (JSC::Heap::collectAsync): 140 (JSC::Heap::collectSync): 141 (JSC::Heap::stopIfNecessarySlow): 142 (JSC::Heap::collectIfNecessaryOrDefer): 143 * heap/Heap.h: 144 (JSC::Heap::addressOfDoesGC): 145 (JSC::Heap::setDoesGCExpectation): 146 (JSC::Heap::verifyCanGC): 147 (JSC::Heap::expectDoesGC const): Deleted. 148 (JSC::Heap::setExpectDoesGC): Deleted. 149 (JSC::Heap::addressOfExpectDoesGC): Deleted. 150 * heap/HeapInlines.h: 151 (JSC::Heap::acquireAccess): 152 (JSC::Heap::stopIfNecessary): 153 * heap/LocalAllocatorInlines.h: 154 (JSC::LocalAllocator::allocate): 155 * heap/PreciseAllocation.cpp: 156 (JSC::PreciseAllocation::tryCreate): 157 (JSC::PreciseAllocation::createForLowerTier): 158 * runtime/JSString.h: 159 (JSC::jsSingleCharacterString): 160 (JSC::JSString::toAtomString const): 161 (JSC::JSString::toExistingAtomString const): 162 (JSC::JSString::value const): 163 (JSC::JSString::tryGetValue const): 164 (JSC::JSRopeString::unsafeView const): 165 (JSC::JSRopeString::viewWithUnderlyingString const): 166 (JSC::JSString::unsafeView const): 167 * runtime/RegExpMatchesArray.h: 168 (JSC::createRegExpMatchesArray): 169 1 170 2020-06-02 Mark Lam <mark.lam@apple.com> 2 171 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r262308 r262475 1937 1937 FEB58C15187B8B160098EF0B /* ErrorHandlingScope.h in Headers */ = {isa = PBXBuildFile; fileRef = FEB58C13187B8B160098EF0B /* ErrorHandlingScope.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1938 1938 FEC160322339E9F900A04CB8 /* CellSize.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC160312339E9F900A04CB8 /* CellSize.h */; }; 1939 FEC3A3A1248735CA00395B54 /* DFGDoesGCCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC3A3A0248735BC00395B54 /* DFGDoesGCCheck.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1939 1940 FEC5797323105B5100BCA83F /* VMInspectorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC5797223105B4800BCA83F /* VMInspectorInlines.h */; }; 1940 1941 FEC5797623105F4E00BCA83F /* Integrity.h in Headers */ = {isa = PBXBuildFile; fileRef = FEC5797523105F4300BCA83F /* Integrity.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 5233 5234 FEB58C13187B8B160098EF0B /* ErrorHandlingScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorHandlingScope.h; sourceTree = "<group>"; }; 5234 5235 FEC160312339E9F900A04CB8 /* CellSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CellSize.h; sourceTree = "<group>"; }; 5236 FEC3A39F248735BC00395B54 /* DFGDoesGCCheck.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDoesGCCheck.cpp; path = dfg/DFGDoesGCCheck.cpp; sourceTree = "<group>"; }; 5237 FEC3A3A0248735BC00395B54 /* DFGDoesGCCheck.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DFGDoesGCCheck.h; path = dfg/DFGDoesGCCheck.h; sourceTree = "<group>"; }; 5235 5238 FEC5797223105B4800BCA83F /* VMInspectorInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMInspectorInlines.h; sourceTree = "<group>"; }; 5236 5239 FEC5797423105F4200BCA83F /* Integrity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Integrity.cpp; sourceTree = "<group>"; }; … … 7897 7900 0F5A1271192D9FDF008764A3 /* DFGDoesGC.cpp */, 7898 7901 0F5A1272192D9FDF008764A3 /* DFGDoesGC.h */, 7902 FEC3A39F248735BC00395B54 /* DFGDoesGCCheck.cpp */, 7903 FEC3A3A0248735BC00395B54 /* DFGDoesGCCheck.h */, 7899 7904 0FD81AD0154FB4EB00983E72 /* DFGDominators.h */, 7900 7905 0F1E3A441534CBAD000F9456 /* DFGDoubleFormatState.h */, … … 10197 10202 0FE050281AA9095600D33B33 /* ScopedArguments.h in Headers */, 10198 10203 0FE050291AA9095600D33B33 /* ScopedArgumentsTable.h in Headers */, 10204 FEC3A3A1248735CA00395B54 /* DFGDoesGCCheck.h in Headers */, 10199 10205 0FE0502B1AA9095600D33B33 /* ScopeOffset.h in Headers */, 10200 10206 0F24E55217EE274900ABB217 /* ScratchRegisterAllocator.h in Headers */, -
trunk/Source/JavaScriptCore/Sources.txt
r261600 r262475 348 348 dfg/DFGDisassembler.cpp 349 349 dfg/DFGDoesGC.cpp 350 dfg/DFGDoesGCCheck.cpp 350 351 dfg/DFGDriver.cpp 351 352 dfg/DFGEdge.cpp -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h
r262168 r262475 1460 1460 } 1461 1461 1462 void store64(TrustedImm64 imm, const void* address) 1463 { 1464 if (!imm.m_value) { 1465 store64(ARM64Registers::zr, address); 1466 return; 1467 } 1468 1469 moveToCachedReg(imm, dataMemoryTempRegister()); 1470 store64(dataTempRegister, address); 1471 } 1472 1462 1473 void store64(TrustedImm32 imm, ImplicitAddress address) 1463 1474 { -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h
r262168 r262475 978 978 } 979 979 980 void store64(TrustedImm64 imm, void* address) 981 { 982 if (CAN_SIGN_EXTEND_32_64(imm.m_value)) { 983 auto addressReg = scratchRegister(); 984 move(TrustedImmPtr(address), addressReg); 985 store64(TrustedImm32(static_cast<int32_t>(imm.m_value)), addressReg); 986 return; 987 } 988 989 auto src = scratchRegister(); 990 move(imm, src); 991 swap(src, X86Registers::eax); 992 m_assembler.movq_EAXm(address); 993 swap(src, X86Registers::eax); 994 } 995 980 996 void store64(TrustedImm64 imm, ImplicitAddress address) 981 997 { -
trunk/Source/JavaScriptCore/assembler/testmasm.cpp
r262434 r262475 659 659 testCountTrailingZeros64Impl(wordCanBeZero); 660 660 } 661 662 void testStore64Imm64AddressPointer() 663 { 664 auto doTest = [] (int64_t value) { 665 int64_t dest; 666 void* destAddress = &dest; 667 668 auto test = compile([=] (CCallHelpers& jit) { 669 emitFunctionPrologue(jit); 670 jit.store64(CCallHelpers::TrustedImm64(value), destAddress); 671 emitFunctionEpilogue(jit); 672 jit.ret(); 673 }); 674 675 invoke<size_t>(test); 676 CHECK_EQ(dest, value); 677 }; 678 679 for (auto value : int64Operands()) 680 doTest(value); 681 682 doTest(0x98765555AAAA4321); 683 doTest(0xAAAA432198765555); 684 } 685 661 686 #endif // CPU(X86_64) || CPU(ARM64) 662 687 … … 2500 2525 RUN(testCountTrailingZeros64()); 2501 2526 RUN(testCountTrailingZeros64WithoutNullCheck()); 2527 RUN(testStore64Imm64AddressPointer()); 2502 2528 #endif 2503 2529 -
trunk/Source/JavaScriptCore/dfg/DFGGraph.cpp
r261895 r262475 63 63 64 64 // Creates an array of stringized names. 65 staticconst char* dfgOpNames[] = {65 const char* dfgOpNames[] = { 66 66 #define STRINGIZE_DFG_OP_ENUM(opcode, flags) #opcode , 67 67 FOR_EACH_DFG_OP(STRINGIZE_DFG_OP_ENUM) -
trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp
r261895 r262475 147 147 // We're about to exit optimized code. So, there's no longer any optimized 148 148 // code running that expects no GC. 149 vm.heap.set ExpectDoesGC(true);149 vm.heap.setDoesGCExpectation(true, DoesGCCheck::Special::DFGOSRExit); 150 150 } 151 151 … … 556 556 // materialization below (see emitRestoreArguments()). 557 557 558 // Even though we set Heap::m_ expectDoesGC in compileOSRExit(), we also need558 // Even though we set Heap::m_doesGC in compileOSRExit(), we also need 559 559 // to set it here because compileOSRExit() is only called on the first time 560 560 // we exit from this site, but all subsequent exits will take this compiled 561 561 // ramp without calling compileOSRExit() first. 562 jit.store 8(CCallHelpers::TrustedImm32(true), vm.heap.addressOfExpectDoesGC());562 jit.store64(CCallHelpers::TrustedImm64(DoesGCCheck::encode(true, DoesGCCheck::Special::DFGOSRExit)), vm.heap.addressOfDoesGC()); 563 563 } 564 564 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r262252 r262475 2139 2139 if (validateDFGDoesGC) { 2140 2140 bool expectDoesGC = doesGC(m_jit.graph(), node); 2141 m_jit.store 8(TrustedImm32(expectDoesGC), vm().heap.addressOfExpectDoesGC());2141 m_jit.store64(TrustedImm64(DoesGCCheck::encode(expectDoesGC, node->index(), node->op())), vm().heap.addressOfDoesGC()); 2142 2142 } 2143 2143 -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r262434 r262475 705 705 if (validateDFGDoesGC) { 706 706 bool expectDoesGC = doesGC(m_graph, m_node); 707 m_out.store(m_out.const Bool(expectDoesGC), m_out.absolute(vm().heap.addressOfExpectDoesGC()));707 m_out.store(m_out.constInt64(DoesGCCheck::encode(expectDoesGC, m_node->index(), m_node->op())), m_out.absolute(vm().heap.addressOfDoesGC())); 708 708 } 709 709 -
trunk/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp
r262098 r262475 212 212 // materialization below. 213 213 214 // Even though we set Heap::m_ expectDoesGC in compileFTLOSRExit(), we also need214 // Even though we set Heap::m_doesGC in compileFTLOSRExit(), we also need 215 215 // to set it here because compileFTLOSRExit() is only called on the first time 216 216 // we exit from this site, but all subsequent exits will take this compiled 217 217 // ramp without calling compileFTLOSRExit() first. 218 jit.store 8(CCallHelpers::TrustedImm32(true), vm.heap.addressOfExpectDoesGC());218 jit.store64(CCallHelpers::TrustedImm64(DoesGCCheck::encode(true, DoesGCCheck::Special::FTLOSRExit)), vm.heap.addressOfDoesGC()); 219 219 } 220 220 … … 549 549 // We're about to exit optimized code. So, there's no longer any optimized 550 550 // code running that expects no GC. 551 vm.heap.set ExpectDoesGC(true);551 vm.heap.setDoesGCExpectation(true, DoesGCCheck::Special::FTLOSRExit); 552 552 } 553 553 -
trunk/Source/JavaScriptCore/heap/CompleteSubspace.cpp
r261755 r262475 1 1 /* 2 * Copyright (C) 2017-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2017-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 121 121 { 122 122 if (validateDFGDoesGC) 123 RELEASE_ASSERT(vm.heap.expectDoesGC());123 vm.heap.verifyCanGC(); 124 124 125 125 sanitizeStackForVM(vm); … … 157 157 { 158 158 if (validateDFGDoesGC) 159 RELEASE_ASSERT(vm.heap.expectDoesGC());159 vm.heap.verifyCanGC(); 160 160 161 161 // The following conditions are met in Butterfly for example. -
trunk/Source/JavaScriptCore/heap/CompleteSubspaceInlines.h
r252452 r262475 1 1 /* 2 * Copyright (C) 2018-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2018-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 34 34 { 35 35 if (validateDFGDoesGC) 36 RELEASE_ASSERT(vm.heap.expectDoesGC());36 vm.heap.verifyCanGC(); 37 37 38 38 if (Allocator allocator = allocatorForNonVirtual(size, AllocatorForMode::AllocatorIfExists)) -
trunk/Source/JavaScriptCore/heap/DeferGC.h
r252671 r262475 1 1 /* 2 * Copyright (C) 2013-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2013-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 46 46 { 47 47 if (validateDFGDoesGC) 48 RELEASE_ASSERT(m_heap.expectDoesGC());48 m_heap.verifyCanGC(); 49 49 m_heap.decrementDeferralDepthAndGCIfNeeded(); 50 50 } -
trunk/Source/JavaScriptCore/heap/GCDeferralContextInlines.h
r241927 r262475 1 1 /* 2 * Copyright (C) 2016-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2016-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 39 39 { 40 40 if (validateDFGDoesGC) 41 RELEASE_ASSERT(m_heap.expectDoesGC());41 m_heap.verifyCanGC(); 42 42 43 43 if (UNLIKELY(m_shouldGC)) -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r262040 r262475 1 1 /* 2 * Copyright (C) 2003-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2003-2020 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 4 * … … 1065 1065 { 1066 1066 if (validateDFGDoesGC) 1067 RELEASE_ASSERT(expectDoesGC());1067 verifyCanGC(); 1068 1068 1069 1069 switch (synchronousness) { … … 1098 1098 { 1099 1099 if (validateDFGDoesGC) 1100 RELEASE_ASSERT(expectDoesGC());1100 verifyCanGC(); 1101 1101 1102 1102 if (!m_isSafeToCollect) … … 1122 1122 { 1123 1123 if (validateDFGDoesGC) 1124 RELEASE_ASSERT(expectDoesGC());1124 verifyCanGC(); 1125 1125 1126 1126 if (!m_isSafeToCollect) … … 1785 1785 { 1786 1786 if (validateDFGDoesGC) 1787 RELEASE_ASSERT(expectDoesGC());1787 verifyCanGC(); 1788 1788 1789 1789 while (stopIfNecessarySlow(m_worldState.load())) { } … … 1800 1800 { 1801 1801 if (validateDFGDoesGC) 1802 RELEASE_ASSERT(expectDoesGC());1802 verifyCanGC(); 1803 1803 1804 1804 RELEASE_ASSERT(oldState & hasAccessBit); … … 2602 2602 ASSERT(deferralContext || isDeferred() || !DisallowGC::isInEffectOnCurrentThread()); 2603 2603 if (validateDFGDoesGC) 2604 RELEASE_ASSERT(expectDoesGC());2604 verifyCanGC(); 2605 2605 2606 2606 if (!m_isSafeToCollect) -
trunk/Source/JavaScriptCore/heap/Heap.h
r261569 r262475 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 4 * Copyright (C) 2003-20 19Apple Inc. All rights reserved.4 * Copyright (C) 2003-2020 Apple Inc. All rights reserved. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 26 26 #include "CollectionScope.h" 27 27 #include "CollectorPhase.h" 28 #include "DFGDoesGCCheck.h" 28 29 #include "DeleteAllCodeEffort.h" 29 30 #include "GCConductor.h" … … 304 305 305 306 #if ENABLE(DFG_DOES_GC_VALIDATION) 306 bool expectDoesGC() const { return m_expectDoesGC; } 307 void setExpectDoesGC(bool value) { m_expectDoesGC = value; } 308 bool* addressOfExpectDoesGC() { return &m_expectDoesGC; } 307 DoesGCCheck* addressOfDoesGC() { return &m_doesGC; } 308 void setDoesGCExpectation(bool expectDoesGC, unsigned nodeIndex, unsigned nodeOp) { m_doesGC.set(expectDoesGC, nodeIndex, nodeOp); } 309 void setDoesGCExpectation(bool expectDoesGC, DoesGCCheck::Special special) { m_doesGC.set(expectDoesGC, special); } 310 void verifyCanGC() { m_doesGC.verifyCanGC(vm()); } 309 311 #else 310 bool expectDoesGC() const { UNREACHABLE_FOR_PLATFORM(); return true; } 311 void setExpectDoesGC(bool) { UNREACHABLE_FOR_PLATFORM(); } 312 bool* addressOfExpectDoesGC() { UNREACHABLE_FOR_PLATFORM(); return nullptr; } 312 DoesGCCheck* addressOfDoesGC() { UNREACHABLE_FOR_PLATFORM(); return nullptr; } 313 void setDoesGCExpectation(bool, unsigned, unsigned) { } 314 void setDoesGCExpectation(bool, DoesGCCheck::Special) { } 315 void verifyCanGC() { } 313 316 #endif 314 317 … … 607 610 Lock m_raceMarkStackLock; 608 611 #if ENABLE(DFG_DOES_GC_VALIDATION) 609 bool m_expectDoesGC { true };612 DoesGCCheck m_doesGC; 610 613 #endif 611 614 -
trunk/Source/JavaScriptCore/heap/HeapInlines.h
r255897 r262475 237 237 { 238 238 if (validateDFGDoesGC) 239 RELEASE_ASSERT(expectDoesGC());239 verifyCanGC(); 240 240 241 241 if (m_worldState.compareExchangeWeak(0, hasAccessBit)) … … 264 264 { 265 265 if (validateDFGDoesGC) 266 RELEASE_ASSERT(expectDoesGC());266 verifyCanGC(); 267 267 268 268 if (mayNeedToStop()) -
trunk/Source/JavaScriptCore/heap/LocalAllocatorInlines.h
r252452 r262475 34 34 { 35 35 if (validateDFGDoesGC) 36 RELEASE_ASSERT(heap.expectDoesGC());36 heap.verifyCanGC(); 37 37 return m_freeList.allocate( 38 38 [&] () -> HeapCell* { -
trunk/Source/JavaScriptCore/heap/PreciseAllocation.cpp
r261895 r262475 44 44 { 45 45 if (validateDFGDoesGC) 46 RELEASE_ASSERT(heap.expectDoesGC());46 heap.verifyCanGC(); 47 47 48 48 size_t adjustedAlignmentAllocationSize = headerSize() + size + halfAlignment; … … 124 124 { 125 125 if (validateDFGDoesGC) 126 RELEASE_ASSERT(heap.expectDoesGC());126 heap.verifyCanGC(); 127 127 128 128 size_t adjustedAlignmentAllocationSize = headerSize() + size + halfAlignment; -
trunk/Source/JavaScriptCore/runtime/JSString.h
r260331 r262475 734 734 { 735 735 if (validateDFGDoesGC) 736 RELEASE_ASSERT(vm.heap.expectDoesGC());736 vm.heap.verifyCanGC(); 737 737 if (c <= maxSingleCharacterString) 738 738 return vm.smallStrings.singleCharacterString(c); … … 764 764 { 765 765 if (validateDFGDoesGC) 766 RELEASE_ASSERT(vm().heap.expectDoesGC());766 vm().heap.verifyCanGC(); 767 767 if (isRope()) 768 768 return static_cast<const JSRopeString*>(this)->resolveRopeToAtomString(globalObject); … … 773 773 { 774 774 if (validateDFGDoesGC) 775 RELEASE_ASSERT(vm().heap.expectDoesGC());775 vm().heap.verifyCanGC(); 776 776 if (isRope()) 777 777 return static_cast<const JSRopeString*>(this)->resolveRopeToExistingAtomString(globalObject); … … 784 784 { 785 785 if (validateDFGDoesGC) 786 RELEASE_ASSERT(vm().heap.expectDoesGC());786 vm().heap.verifyCanGC(); 787 787 if (isRope()) 788 788 return static_cast<const JSRopeString*>(this)->resolveRope(globalObject); … … 794 794 if (allocationAllowed) { 795 795 if (validateDFGDoesGC) 796 RELEASE_ASSERT(vm().heap.expectDoesGC());796 vm().heap.verifyCanGC(); 797 797 if (isRope()) { 798 798 // Pass nullptr for the JSGlobalObject so that resolveRope does not throw in the event of an OOM error. … … 984 984 { 985 985 if (validateDFGDoesGC) 986 RELEASE_ASSERT(vm().heap.expectDoesGC());986 vm().heap.verifyCanGC(); 987 987 if (isSubstring()) { 988 988 auto& base = substringBase()->valueInternal(); … … 997 997 { 998 998 if (validateDFGDoesGC) 999 RELEASE_ASSERT(vm().heap.expectDoesGC());999 vm().heap.verifyCanGC(); 1000 1000 if (isSubstring()) { 1001 1001 auto& base = substringBase()->valueInternal(); … … 1011 1011 { 1012 1012 if (validateDFGDoesGC) 1013 RELEASE_ASSERT(vm().heap.expectDoesGC());1013 vm().heap.verifyCanGC(); 1014 1014 if (isRope()) 1015 1015 return static_cast<const JSRopeString*>(this)->unsafeView(globalObject); -
trunk/Source/JavaScriptCore/runtime/RegExpMatchesArray.h
r261464 r262475 65 65 { 66 66 if (validateDFGDoesGC) 67 RELEASE_ASSERT(vm.heap.expectDoesGC());67 vm.heap.verifyCanGC(); 68 68 69 69 Vector<int, 32> subpatternResults;
Note:
See TracChangeset
for help on using the changeset viewer.