Changeset 154162 in webkit
- Timestamp:
- Aug 15, 2013 8:28:39 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 6 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r154127 r154162 101 101 dfg/DFGDesiredIdentifiers.cpp 102 102 dfg/DFGDesiredStructureChains.cpp 103 dfg/DFGDesiredTransitions.cpp 103 104 dfg/DFGDesiredWatchpoints.cpp 105 dfg/DFGDesiredWeakReferences.cpp 106 dfg/DFGDesiredWriteBarriers.cpp 104 107 dfg/DFGDisassembler.cpp 105 108 dfg/DFGDominators.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r154161 r154162 1 2013-08-15 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 <https://webkit.org/b/119833> Concurrent compilation thread should not trigger WriteBarriers 4 5 Reviewed by Oliver Hunt. 6 7 The concurrent compilation thread should interact minimally with the Heap, including not 8 triggering WriteBarriers. This is a prerequisite for generational GC. 9 10 * JavaScriptCore.xcodeproj/project.pbxproj: 11 * bytecode/CodeBlock.cpp: 12 (JSC::CodeBlock::addOrFindConstant): 13 (JSC::CodeBlock::findConstant): 14 * bytecode/CodeBlock.h: 15 (JSC::CodeBlock::addConstantLazily): 16 * dfg/DFGByteCodeParser.cpp: 17 (JSC::DFG::ByteCodeParser::getJSConstantForValue): 18 (JSC::DFG::ByteCodeParser::constantUndefined): 19 (JSC::DFG::ByteCodeParser::constantNull): 20 (JSC::DFG::ByteCodeParser::one): 21 (JSC::DFG::ByteCodeParser::constantNaN): 22 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): 23 * dfg/DFGCommonData.cpp: 24 (JSC::DFG::CommonData::notifyCompilingStructureTransition): 25 * dfg/DFGCommonData.h: 26 * dfg/DFGDesiredTransitions.cpp: Added. 27 (JSC::DFG::DesiredTransition::DesiredTransition): 28 (JSC::DFG::DesiredTransition::reallyAdd): 29 (JSC::DFG::DesiredTransitions::DesiredTransitions): 30 (JSC::DFG::DesiredTransitions::~DesiredTransitions): 31 (JSC::DFG::DesiredTransitions::addLazily): 32 (JSC::DFG::DesiredTransitions::reallyAdd): 33 * dfg/DFGDesiredTransitions.h: Added. 34 * dfg/DFGDesiredWeakReferences.cpp: Added. 35 (JSC::DFG::DesiredWeakReferences::DesiredWeakReferences): 36 (JSC::DFG::DesiredWeakReferences::~DesiredWeakReferences): 37 (JSC::DFG::DesiredWeakReferences::addLazily): 38 (JSC::DFG::DesiredWeakReferences::reallyAdd): 39 * dfg/DFGDesiredWeakReferences.h: Added. 40 * dfg/DFGDesiredWriteBarriers.cpp: Added. 41 (JSC::DFG::DesiredWriteBarrier::DesiredWriteBarrier): 42 (JSC::DFG::DesiredWriteBarrier::trigger): 43 (JSC::DFG::DesiredWriteBarriers::DesiredWriteBarriers): 44 (JSC::DFG::DesiredWriteBarriers::~DesiredWriteBarriers): 45 (JSC::DFG::DesiredWriteBarriers::addImpl): 46 (JSC::DFG::DesiredWriteBarriers::trigger): 47 * dfg/DFGDesiredWriteBarriers.h: Added. 48 (JSC::DFG::DesiredWriteBarriers::add): 49 (JSC::DFG::initializeLazyWriteBarrier): 50 * dfg/DFGFixupPhase.cpp: 51 (JSC::DFG::FixupPhase::truncateConstantToInt32): 52 * dfg/DFGGraph.h: 53 (JSC::DFG::Graph::convertToConstant): 54 * dfg/DFGJITCompiler.h: 55 (JSC::DFG::JITCompiler::addWeakReference): 56 * dfg/DFGPlan.cpp: 57 (JSC::DFG::Plan::Plan): 58 (JSC::DFG::Plan::reallyAdd): 59 * dfg/DFGPlan.h: 60 * dfg/DFGSpeculativeJIT32_64.cpp: 61 (JSC::DFG::SpeculativeJIT::compile): 62 * dfg/DFGSpeculativeJIT64.cpp: 63 (JSC::DFG::SpeculativeJIT::compile): 64 * runtime/WriteBarrier.h: 65 (JSC::WriteBarrierBase::set): 66 (JSC::WriteBarrier::WriteBarrier): 67 1 68 2013-08-15 Benjamin Poulain <benjamin@webkit.org> 2 69 -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r154127 r154162 234 234 Source/JavaScriptCore/dfg/DFGDesiredStructureChains.cpp \ 235 235 Source/JavaScriptCore/dfg/DFGDesiredStructureChains.h \ 236 Source/JavaScriptCore/dfg/DFGDesiredTransitions.cpp \ 237 Source/JavaScriptCore/dfg/DFGDesiredTransitions.h \ 236 238 Source/JavaScriptCore/dfg/DFGDesiredWatchpoints.cpp \ 237 239 Source/JavaScriptCore/dfg/DFGDesiredWatchpoints.h \ 240 Source/JavaScriptCore/dfg/DFGDesiredWeakReferences.cpp \ 241 Source/JavaScriptCore/dfg/DFGDesiredWeakReferences.h \ 242 Source/JavaScriptCore/dfg/DFGDesiredWriteBarriers.cpp \ 243 Source/JavaScriptCore/dfg/DFGDesiredWriteBarriers.h \ 238 244 Source/JavaScriptCore/dfg/DFGDisassembler.cpp \ 239 245 Source/JavaScriptCore/dfg/DFGDisassembler.h \ -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r154127 r154162 1062 1062 C283190016FE4B7D00157BFD /* HandleBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C28318FF16FE4B7D00157BFD /* HandleBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1063 1063 C283190216FE533E00157BFD /* HandleBlockInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C283190116FE533E00157BFD /* HandleBlockInlines.h */; }; 1064 C2981FD817BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2981FD617BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp */; }; 1065 C2981FD917BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h in Headers */ = {isa = PBXBuildFile; fileRef = C2981FD717BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1066 C2981FDC17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2981FDA17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp */; }; 1067 C2981FDD17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.h in Headers */ = {isa = PBXBuildFile; fileRef = C2981FDB17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1064 1068 C2A7F688160432D400F76B98 /* JSDestructibleObject.h in Headers */ = {isa = PBXBuildFile; fileRef = C2A7F687160432D400F76B98 /* JSDestructibleObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1065 1069 C2B916C214DA014E00CBAC86 /* MarkedAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = C2B916C114DA014E00CBAC86 /* MarkedAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1066 1070 C2B916C514DA040C00CBAC86 /* MarkedAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2B916C414DA040C00CBAC86 /* MarkedAllocator.cpp */; }; 1071 C2C0F7CD17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C0F7CB17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp */; }; 1072 C2C0F7CE17BBFC5B00464FE4 /* DFGDesiredTransitions.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C0F7CC17BBFC5B00464FE4 /* DFGDesiredTransitions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1067 1073 C2C8D02D14A3C6E000578E65 /* CopiedSpaceInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02B14A3C6B200578E65 /* CopiedSpaceInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1068 1074 C2C8D03014A3CEFC00578E65 /* CopiedBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02E14A3CEFC00578E65 /* CopiedBlock.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 2197 2203 C28318FF16FE4B7D00157BFD /* HandleBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HandleBlock.h; sourceTree = "<group>"; }; 2198 2204 C283190116FE533E00157BFD /* HandleBlockInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HandleBlockInlines.h; sourceTree = "<group>"; }; 2205 C2981FD617BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredWeakReferences.cpp; path = dfg/DFGDesiredWeakReferences.cpp; sourceTree = "<group>"; }; 2206 C2981FD717BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDesiredWeakReferences.h; path = dfg/DFGDesiredWeakReferences.h; sourceTree = "<group>"; }; 2207 C2981FDA17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredWriteBarriers.cpp; path = dfg/DFGDesiredWriteBarriers.cpp; sourceTree = "<group>"; }; 2208 C2981FDB17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDesiredWriteBarriers.h; path = dfg/DFGDesiredWriteBarriers.h; sourceTree = "<group>"; }; 2199 2209 C2A7F687160432D400F76B98 /* JSDestructibleObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDestructibleObject.h; sourceTree = "<group>"; }; 2200 2210 C2B916C114DA014E00CBAC86 /* MarkedAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkedAllocator.h; sourceTree = "<group>"; }; 2201 2211 C2B916C414DA040C00CBAC86 /* MarkedAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkedAllocator.cpp; sourceTree = "<group>"; }; 2212 C2C0F7CB17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredTransitions.cpp; path = dfg/DFGDesiredTransitions.cpp; sourceTree = "<group>"; }; 2213 C2C0F7CC17BBFC5B00464FE4 /* DFGDesiredTransitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDesiredTransitions.h; path = dfg/DFGDesiredTransitions.h; sourceTree = "<group>"; }; 2202 2214 C2C8D02B14A3C6B200578E65 /* CopiedSpaceInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopiedSpaceInlines.h; sourceTree = "<group>"; }; 2203 2215 C2C8D02E14A3CEFC00578E65 /* CopiedBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopiedBlock.h; sourceTree = "<group>"; }; … … 3470 3482 0FDB2CE5174830A2007B3C1B /* DFGWorklist.cpp */, 3471 3483 0FDB2CE6174830A2007B3C1B /* DFGWorklist.h */, 3484 C2981FD617BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp */, 3485 C2981FD717BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h */, 3486 C2981FDA17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp */, 3487 C2981FDB17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.h */, 3488 C2C0F7CB17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp */, 3489 C2C0F7CC17BBFC5B00464FE4 /* DFGDesiredTransitions.h */, 3472 3490 ); 3473 3491 name = dfg; … … 3677 3695 0FB7F39515ED8E4600F167B2 /* ArrayConventions.h in Headers */, 3678 3696 0F63945515D07057006A597C /* ArrayProfile.h in Headers */, 3697 C2981FD917BAEE4B00A3BC98 /* DFGDesiredWeakReferences.h in Headers */, 3698 C2981FDD17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.h in Headers */, 3699 C2C0F7CE17BBFC5B00464FE4 /* DFGDesiredTransitions.h in Headers */, 3679 3700 BC18C3E70E16F5CD00B34460 /* ArrayPrototype.h in Headers */, 3680 3701 BC18C5240E16FC8A00B34460 /* ArrayPrototype.lut.h in Headers */, … … 4911 4932 14469DE1107EC7E700650446 /* NativeErrorPrototype.cpp in Sources */, 4912 4933 148F21B7107EC5470042EC2C /* Nodes.cpp in Sources */, 4934 C2981FD817BAEE4B00A3BC98 /* DFGDesiredWeakReferences.cpp in Sources */, 4913 4935 655EB29B10CE2581001A990E /* NodesCodegen.cpp in Sources */, 4914 4936 14469DE2107EC7E700650446 /* NumberConstructor.cpp in Sources */, … … 4952 4974 A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */, 4953 4975 8642C510151C06A90046D4EF /* RegExpCachedResult.cpp in Sources */, 4976 C2981FDC17BAFF4400A3BC98 /* DFGDesiredWriteBarriers.cpp in Sources */, 4954 4977 14280842107EC0930013E7B2 /* RegExpConstructor.cpp in Sources */, 4955 4978 0F2B66E617B6B5AB00A7AE3F /* JSArrayBufferPrototype.cpp in Sources */, … … 4992 5015 0FF42732158EBD58004CB9FF /* UDis86Disassembler.cpp in Sources */, 4993 5016 A76F279415F13C9600517D67 /* UnlinkedCodeBlock.cpp in Sources */, 5017 C2C0F7CD17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp in Sources */, 4994 5018 E18E3A590DF9278C00D90B34 /* VM.cpp in Sources */, 4995 5019 FE4A331F15BD2E07006F54F3 /* VMInspector.cpp in Sources */, -
trunk/Source/JavaScriptCore/Target.pri
r154127 r154162 138 138 dfg/DFGDesiredIdentifiers.cpp \ 139 139 dfg/DFGDesiredStructureChains.cpp \ 140 dfg/DFGDesiredTransitions.cpp \ 140 141 dfg/DFGDesiredWatchpoints.cpp \ 142 dfg/DFGDesiredWeakReferences.cpp \ 143 dfg/DFGDesiredWriteBarriers.cpp \ 141 144 dfg/DFGDisassembler.cpp \ 142 145 dfg/DFGDominators.cpp \ -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r154120 r154162 2490 2490 unsigned CodeBlock::addOrFindConstant(JSValue v) 2491 2491 { 2492 unsigned result; 2493 if (findConstant(v, result)) 2494 return result; 2495 return addConstant(v); 2496 } 2497 2498 bool CodeBlock::findConstant(JSValue v, unsigned& index) 2499 { 2492 2500 unsigned numberOfConstants = numberOfConstantRegisters(); 2493 2501 for (unsigned i = 0; i < numberOfConstants; ++i) { 2494 if (getConstant(FirstConstantRegisterIndex + i) == v) 2495 return i; 2496 } 2497 return addConstant(v); 2502 if (getConstant(FirstConstantRegisterIndex + i) == v) { 2503 index = i; 2504 return true; 2505 } 2506 } 2507 index = numberOfConstants; 2508 return false; 2498 2509 } 2499 2510 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r154038 r154162 687 687 } 688 688 689 689 WriteBarrier<Unknown>& addConstantLazily() 690 { 691 m_constantRegisters.append(WriteBarrier<Unknown>()); 692 return m_constantRegisters.last(); 693 } 694 695 bool findConstant(JSValue, unsigned& result); 690 696 unsigned addOrFindConstant(JSValue); 691 697 WriteBarrier<Unknown>& constantRegister(int index) { return m_constantRegisters[index - FirstConstantRegisterIndex]; } -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r154038 r154162 401 401 return findArgumentPositionForLocal(operand); 402 402 } 403 404 void addConstant(JSValue value) 405 { 406 initializeLazyWriteBarrier( 407 m_codeBlock->addConstantLazily(), 408 m_graph.m_plan.writeBarriers, 409 m_codeBlock->ownerExecutable(), 410 value); 411 } 403 412 404 413 void flush(int operand) … … 497 506 Node* getJSConstantForValue(JSValue constantValue) 498 507 { 499 unsigned constantIndex = m_codeBlock->addOrFindConstant(constantValue); 500 if (constantIndex >= m_constants.size()) 508 unsigned constantIndex; 509 if (!m_codeBlock->findConstant(constantValue, constantIndex)) { 510 addConstant(constantValue); 501 511 m_constants.append(ConstantRecord()); 512 } 502 513 503 514 ASSERT(m_constants.size() == m_codeBlock->numberOfConstantRegisters()); … … 568 579 // Add undefined to the CodeBlock's constants, and add a corresponding slot in m_constants. 569 580 ASSERT(m_constants.size() == numberOfConstants); 570 m_codeBlock->addConstant(jsUndefined());581 addConstant(jsUndefined()); 571 582 m_constants.append(ConstantRecord()); 572 583 ASSERT(m_constants.size() == m_codeBlock->numberOfConstantRegisters()); … … 593 604 // Add null to the CodeBlock's constants, and add a corresponding slot in m_constants. 594 605 ASSERT(m_constants.size() == numberOfConstants); 595 m_codeBlock->addConstant(jsNull());606 addConstant(jsNull()); 596 607 m_constants.append(ConstantRecord()); 597 608 ASSERT(m_constants.size() == m_codeBlock->numberOfConstantRegisters()); … … 618 629 // Add the value 1 to the CodeBlock's constants, and add a corresponding slot in m_constants. 619 630 ASSERT(m_constants.size() == numberOfConstants); 620 m_codeBlock->addConstant(jsNumber(1));631 addConstant(jsNumber(1)); 621 632 m_constants.append(ConstantRecord()); 622 633 ASSERT(m_constants.size() == m_codeBlock->numberOfConstantRegisters()); … … 646 657 // Add the value nan to the CodeBlock's constants, and add a corresponding slot in m_constants. 647 658 ASSERT(m_constants.size() == numberOfConstants); 648 m_codeBlock->addConstant(nan);659 addConstant(nan); 649 660 m_constants.append(ConstantRecord()); 650 661 ASSERT(m_constants.size() == m_codeBlock->numberOfConstantRegisters()); … … 3275 3286 3276 3287 InlineCallFrame inlineCallFrame; 3277 inlineCallFrame.executable.set(*byteCodeParser->m_vm, byteCodeParser->m_codeBlock->ownerExecutable(), codeBlock->ownerExecutable()); 3288 initializeLazyWriteBarrier( 3289 inlineCallFrame.executable, 3290 byteCodeParser->m_graph.m_plan.writeBarriers, 3291 byteCodeParser->m_codeBlock->ownerExecutable(), 3292 codeBlock->ownerExecutable()); 3278 3293 inlineCallFrame.stackOffset = inlineCallFrameStart + JSStack::CallFrameHeaderSize; 3279 if (callee) 3280 inlineCallFrame.callee.set(*byteCodeParser->m_vm, byteCodeParser->m_codeBlock->ownerExecutable(), callee); 3294 if (callee) { 3295 initializeLazyWriteBarrier( 3296 inlineCallFrame.callee, 3297 byteCodeParser->m_graph.m_plan.writeBarriers, 3298 byteCodeParser->m_codeBlock->ownerExecutable(), 3299 callee); 3300 } 3281 3301 inlineCallFrame.caller = byteCodeParser->currentCodeOrigin(); 3282 3302 inlineCallFrame.arguments.resize(argumentCountIncludingThis); // Set the number of arguments including this, but don't configure the value recoveries, yet. … … 3329 3349 if (byteCodeParser->m_emptyJSValueIndex == UINT_MAX) { 3330 3350 byteCodeParser->m_emptyJSValueIndex = byteCodeParser->m_codeBlock->numberOfConstantRegisters() + FirstConstantRegisterIndex; 3331 byteCodeParser-> m_codeBlock->addConstant(JSValue());3351 byteCodeParser->addConstant(JSValue()); 3332 3352 byteCodeParser->m_constants.append(ConstantRecord()); 3333 3353 } … … 3337 3357 JSValueMap::AddResult result = byteCodeParser->m_jsValueMap.add(JSValue::encode(value), byteCodeParser->m_codeBlock->numberOfConstantRegisters() + FirstConstantRegisterIndex); 3338 3358 if (result.isNewEntry) { 3339 byteCodeParser-> m_codeBlock->addConstant(value);3359 byteCodeParser->addConstant(value); 3340 3360 byteCodeParser->m_constants.append(ConstantRecord()); 3341 3361 } -
trunk/Source/JavaScriptCore/dfg/DFGCommonData.cpp
r153116 r154162 31 31 #include "CodeBlock.h" 32 32 #include "DFGNode.h" 33 #include "DFGPlan.h" 33 34 #include "Operations.h" 34 35 #include "VM.h" … … 36 37 namespace JSC { namespace DFG { 37 38 38 void CommonData::notifyCompilingStructureTransition( CodeBlock* codeBlock, Node* node)39 void CommonData::notifyCompilingStructureTransition(Plan& plan, CodeBlock* codeBlock, Node* node) 39 40 { 40 transitions.append( 41 WeakReferenceTransition( 42 *codeBlock->vm(), codeBlock->ownerExecutable(), 43 node->codeOrigin.codeOriginOwner(), 44 node->structureTransitionData().previousStructure, 45 node->structureTransitionData().newStructure)); 41 plan.transitions.addLazily( 42 codeBlock, 43 node->codeOrigin.codeOriginOwner(), 44 node->structureTransitionData().previousStructure, 45 node->structureTransitionData().newStructure); 46 46 } 47 47 -
trunk/Source/JavaScriptCore/dfg/DFGCommonData.h
r153963 r154162 43 43 44 44 struct Node; 45 struct Plan; 45 46 46 47 // CommonData holds the set of data that both DFG and FTL code blocks need to know … … 72 73 } 73 74 74 void notifyCompilingStructureTransition( CodeBlock*, Node*);75 void notifyCompilingStructureTransition(Plan&, CodeBlock*, Node*); 75 76 76 77 void shrinkToFit(); -
trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
r154157 r154162 1413 1413 value = jsNumber(JSC::toInt32(value.asNumber())); 1414 1414 ASSERT(value.isInt32()); 1415 unsigned constantRegister; 1416 if (!codeBlock()->findConstant(value, constantRegister)) { 1417 initializeLazyWriteBarrier( 1418 codeBlock()->addConstantLazily(), 1419 m_graph.m_plan.writeBarriers, 1420 codeBlock()->ownerExecutable(), 1421 value); 1422 } 1415 1423 edge.setNode(m_insertionSet.insertNode( 1416 1424 m_indexInBlock, SpecInt32, JSConstant, m_currentNode->codeOrigin, 1417 OpInfo(co deBlock()->addOrFindConstant(value))));1425 OpInfo(constantRegister))); 1418 1426 } 1419 1427 -
trunk/Source/JavaScriptCore/dfg/DFGGraph.h
r154038 r154162 154 154 void convertToConstant(Node* node, JSValue value) 155 155 { 156 convertToConstant(node, m_codeBlock->addOrFindConstant(value)); 156 unsigned constantRegister; 157 if (!m_codeBlock->findConstant(value, constantRegister)) { 158 initializeLazyWriteBarrier( 159 m_codeBlock->addConstantLazily(), 160 m_plan.writeBarriers, 161 m_codeBlock->ownerExecutable(), 162 value); 163 } 164 convertToConstant(node, constantRegister); 157 165 } 158 166 -
trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.h
r153267 r154162 412 412 void addWeakReference(JSCell* target) 413 413 { 414 m_ jitCode->common.weakReferences.append(WriteBarrier<JSCell>(m_graph.m_vm, codeBlock()->ownerExecutable(), target));414 m_graph.m_plan.weakReferences.addLazily(target); 415 415 } 416 416 -
trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp
r153967 r154162 91 91 , compilation(codeBlock->vm()->m_perBytecodeProfiler ? adoptRef(new Profiler::Compilation(codeBlock->vm()->m_perBytecodeProfiler->ensureBytecodesFor(codeBlock.get()), Profiler::DFG)) : 0) 92 92 , identifiers(codeBlock.get()) 93 , weakReferences(codeBlock.get()) 93 94 , isCompiled(false) 94 95 { … … 276 277 watchpoints.reallyAdd(); 277 278 identifiers.reallyAdd(vm, commonData); 279 weakReferences.reallyAdd(vm, commonData); 280 transitions.reallyAdd(vm, commonData); 281 writeBarriers.trigger(vm); 278 282 } 279 283 -
trunk/Source/JavaScriptCore/dfg/DFGPlan.h
r153967 r154162 32 32 #include "DFGDesiredIdentifiers.h" 33 33 #include "DFGDesiredStructureChains.h" 34 #include "DFGDesiredTransitions.h" 34 35 #include "DFGDesiredWatchpoints.h" 36 #include "DFGDesiredWeakReferences.h" 37 #include "DFGDesiredWriteBarriers.h" 35 38 #include "DFGFinalizer.h" 36 39 #include "Operands.h" … … 76 79 DesiredIdentifiers identifiers; 77 80 DesiredStructureChains chains; 78 81 DesiredWeakReferences weakReferences; 82 DesiredWriteBarriers writeBarriers; 83 DesiredTransitions transitions; 84 79 85 double beforeFTL; 80 86 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r154129 r154162 3976 3976 case PhantomPutStructure: { 3977 3977 ASSERT(isKnownCell(node->child1().node())); 3978 m_jit.jitCode()->common.notifyCompilingStructureTransition(m_jit. codeBlock(), node);3978 m_jit.jitCode()->common.notifyCompilingStructureTransition(m_jit.graph().m_plan, m_jit.codeBlock(), node); 3979 3979 noResult(node); 3980 3980 break; … … 3982 3982 3983 3983 case PutStructure: { 3984 m_jit.jitCode()->common.notifyCompilingStructureTransition(m_jit. codeBlock(), node);3984 m_jit.jitCode()->common.notifyCompilingStructureTransition(m_jit.graph().m_plan, m_jit.codeBlock(), node); 3985 3985 3986 3986 SpeculateCellOperand base(this, node->child1()); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r154127 r154162 3897 3897 case PhantomPutStructure: { 3898 3898 ASSERT(isKnownCell(node->child1().node())); 3899 m_jit.jitCode()->common.notifyCompilingStructureTransition(m_jit. codeBlock(), node);3899 m_jit.jitCode()->common.notifyCompilingStructureTransition(m_jit.graph().m_plan, m_jit.codeBlock(), node); 3900 3900 noResult(node); 3901 3901 break; … … 3903 3903 3904 3904 case PutStructure: { 3905 m_jit.jitCode()->common.notifyCompilingStructureTransition(m_jit. codeBlock(), node);3905 m_jit.jitCode()->common.notifyCompilingStructureTransition(m_jit.graph().m_plan, m_jit.codeBlock(), node); 3906 3906 3907 3907 SpeculateCellOperand base(this, node->child1()); -
trunk/Source/JavaScriptCore/runtime/WriteBarrier.h
r154038 r154162 35 35 namespace JSC { 36 36 37 namespace DFG { 38 class DesiredWriteBarrier; 39 } 40 37 41 class JSCell; 38 42 class VM; … … 72 76 { 73 77 ASSERT(value); 78 ASSERT(!Options::enableConcurrentJIT() || !isCompilationThread()); 74 79 validateCell(value); 75 80 setEarlyValue(vm, owner, value); … … 150 155 void set(VM&, const JSCell* owner, JSValue value) 151 156 { 157 ASSERT(!Options::enableConcurrentJIT() || !isCompilationThread()); 152 158 m_value = JSValue::encode(value); 153 159 Heap::writeBarrier(owner, value); … … 203 209 } 204 210 211 WriteBarrier(DFG::DesiredWriteBarrier&, T* value) 212 { 213 ASSERT(isCompilationThread()); 214 this->setWithoutWriteBarrier(value); 215 } 216 205 217 enum MayBeNullTag { MayBeNull }; 206 218 WriteBarrier(VM& vm, const JSCell* owner, T* value, MayBeNullTag) … … 221 233 this->set(vm, owner, value); 222 234 } 235 236 WriteBarrier(DFG::DesiredWriteBarrier&, JSValue value) 237 { 238 ASSERT(isCompilationThread()); 239 this->setWithoutWriteBarrier(value); 240 } 223 241 }; 224 242
Note: See TracChangeset
for help on using the changeset viewer.