Changeset 221954 in webkit for trunk/Source/JavaScriptCore/b3
- Timestamp:
- Sep 12, 2017, 6:31:07 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore/b3
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/b3/B3CheckSpecial.cpp
r216734 r221954 37 37 namespace JSC { namespace B3 { 38 38 39 using namespace Air; 39 using Inst = Air::Inst; 40 using Arg = Air::Arg; 41 using GenerationContext = Air::GenerationContext; 40 42 41 43 namespace { 42 44 43 unsigned numB3Args( B3::Kind kind)45 unsigned numB3Args(Kind kind) 44 46 { 45 47 switch (kind.opcode()) { … … 109 111 void CheckSpecial::forEachArg(Inst& inst, const ScopedLambda<Inst::EachArgCallback>& callback) 110 112 { 113 using namespace Air; 111 114 std::optional<Width> optionalDefArgWidth; 112 115 Inst hidden = hiddenBranch(inst); … … 157 160 CCallHelpers::Jump CheckSpecial::generate(Inst& inst, CCallHelpers& jit, GenerationContext& context) 158 161 { 162 using namespace Air; 159 163 CCallHelpers::Jump fail = hiddenBranch(inst).generate(jit, context); 160 164 ASSERT(fail.isSet()); -
trunk/Source/JavaScriptCore/b3/B3DuplicateTails.cpp
r214636 r221954 45 45 namespace { 46 46 47 const bool verbose = false; 47 namespace B3DuplicateTailsInternal { 48 static const bool verbose = false; 49 } 48 50 49 51 class DuplicateTails { … … 95 97 } 96 98 demoteValues(m_proc, valuesToDemote); 97 if ( verbose) {99 if (B3DuplicateTailsInternal::verbose) { 98 100 dataLog("Procedure after value demotion:\n"); 99 101 dataLog(m_proc); … … 117 119 candidates.remove(block); 118 120 119 if ( verbose)121 if (B3DuplicateTailsInternal::verbose) 120 122 dataLog("Duplicating ", *tail, " into ", *block, "\n"); 121 123 -
trunk/Source/JavaScriptCore/b3/B3EliminateCommonSubexpressions.cpp
r215407 r221954 54 54 namespace { 55 55 56 const bool verbose = false; 56 namespace B3EliminateCommonSubexpressionsInternal { 57 static const bool verbose = false; 58 } 57 59 58 60 // FIXME: We could treat Patchpoints with a non-empty set of reads as a "memory value" and somehow … … 161 163 bool run() 162 164 { 163 if ( verbose)165 if (B3EliminateCommonSubexpressionsInternal::verbose) 164 166 dataLog("B3 before CSE:\n", m_proc); 165 167 … … 189 191 } 190 192 191 if ( verbose)193 if (B3EliminateCommonSubexpressionsInternal::verbose) 192 194 dataLog("Block ", *block, ": ", data, "\n"); 193 195 } … … 197 199 for (unsigned i = postOrder.size(); i--;) { 198 200 m_block = postOrder[i]; 199 if ( verbose)201 if (B3EliminateCommonSubexpressionsInternal::verbose) 200 202 dataLog("Looking at ", *m_block, ":\n"); 201 203 … … 223 225 } 224 226 225 if ( verbose)227 if (B3EliminateCommonSubexpressionsInternal::verbose) 226 228 dataLog("B3 after CSE:\n", m_proc); 227 229 … … 488 490 // operation that interferes. 489 491 490 if ( verbose)492 if (B3EliminateCommonSubexpressionsInternal::verbose) 491 493 dataLog(*m_value, ": looking forward for stores to ", *ptr, "...\n"); 492 494 … … 558 560 return false; 559 561 560 if ( verbose)562 if (B3EliminateCommonSubexpressionsInternal::verbose) 561 563 dataLog("Eliminating ", *m_value, " due to ", pointerListDump(matches), "\n"); 562 564 … … 567 569 RELEASE_ASSERT(m_dominators.dominates(dominatingMatch->owner, m_block)); 568 570 569 if ( verbose)571 if (B3EliminateCommonSubexpressionsInternal::verbose) 570 572 dataLog(" Eliminating using ", *dominatingMatch, "\n"); 571 573 Vector<Value*> extraValues; … … 591 593 VariableValue* get = m_insertionSet.insert<VariableValue>( 592 594 m_index, Get, m_value->origin(), variable); 593 if ( verbose)595 if (B3EliminateCommonSubexpressionsInternal::verbose) 594 596 dataLog(" Inserting get of value: ", *get, "\n"); 595 597 m_value->replaceWithIdentity(get); … … 616 618 MemoryMatches findMemoryValue(Value* ptr, HeapRange range, const Filter& filter) 617 619 { 618 if ( verbose)620 if (B3EliminateCommonSubexpressionsInternal::verbose) 619 621 dataLog(*m_value, ": looking backward for ", *ptr, "...\n"); 620 622 621 623 if (m_value->as<MemoryValue>()->hasFence()) { 622 if ( verbose)624 if (B3EliminateCommonSubexpressionsInternal::verbose) 623 625 dataLog(" Giving up because fences.\n"); 624 626 return { }; … … 626 628 627 629 if (MemoryValue* match = m_data.memoryValuesAtTail.find(ptr, filter)) { 628 if ( verbose)630 if (B3EliminateCommonSubexpressionsInternal::verbose) 629 631 dataLog(" Found ", *match, " locally.\n"); 630 632 return { match }; … … 632 634 633 635 if (m_data.writes.overlaps(range)) { 634 if ( verbose)636 if (B3EliminateCommonSubexpressionsInternal::verbose) 635 637 dataLog(" Giving up because of writes.\n"); 636 638 return { }; … … 643 645 644 646 while (BasicBlock* block = worklist.pop()) { 645 if ( verbose)647 if (B3EliminateCommonSubexpressionsInternal::verbose) 646 648 dataLog(" Looking at ", *block, "\n"); 647 649 … … 650 652 MemoryValue* match = data.memoryValuesAtTail.find(ptr, filter); 651 653 if (match && match != m_value) { 652 if ( verbose)654 if (B3EliminateCommonSubexpressionsInternal::verbose) 653 655 dataLog(" Found match: ", *match, "\n"); 654 656 matches.append(match); … … 657 659 658 660 if (data.writes.overlaps(range)) { 659 if ( verbose)661 if (B3EliminateCommonSubexpressionsInternal::verbose) 660 662 dataLog(" Giving up because of writes.\n"); 661 663 return { }; … … 663 665 664 666 if (!block->numPredecessors()) { 665 if ( verbose)667 if (B3EliminateCommonSubexpressionsInternal::verbose) 666 668 dataLog(" Giving up because it's live at root.\n"); 667 669 // This essentially proves that this is live at the prologue. That means that we … … 673 675 } 674 676 675 if ( verbose)677 if (B3EliminateCommonSubexpressionsInternal::verbose) 676 678 dataLog(" Got matches: ", pointerListDump(matches), "\n"); 677 679 return matches; -
trunk/Source/JavaScriptCore/b3/B3FixSSA.cpp
r214917 r221954 49 49 namespace { 50 50 51 const bool verbose = false; 51 namespace B3FixSSAInternal { 52 static const bool verbose = false; 53 } 52 54 53 55 void killDeadVariables(Procedure& proc) … … 158 160 159 161 Value* phi = proc.add<Value>(Phi, variable->type(), block->at(0)->origin()); 160 if ( verbose) {162 if (B3FixSSAInternal::verbose) { 161 163 dataLog( 162 164 "Adding Phi for ", pointerDump(variable), " at ", *block, ": ", … … 232 234 233 235 Value* mappedValue = ensureMapping(variable, upsilonInsertionPoint, upsilonOrigin); 234 if ( verbose) {236 if (B3FixSSAInternal::verbose) { 235 237 dataLog( 236 238 "Mapped value for ", *variable, " with successor Phi ", *phi, … … 246 248 } 247 249 248 if ( verbose) {250 if (B3FixSSAInternal::verbose) { 249 251 dataLog("B3 after SSA conversion:\n"); 250 252 dataLog(proc); … … 267 269 } 268 270 269 if ( verbose) {271 if (B3FixSSAInternal::verbose) { 270 272 dataLog("Demoting values as follows:\n"); 271 273 dataLog(" map = "); -
trunk/Source/JavaScriptCore/b3/B3FoldPathConstants.cpp
r219648 r221954 42 42 namespace { 43 43 44 const bool verbose = false; 44 namespace B3FoldPathConstantsInternal { 45 static const bool verbose = false; 46 } 45 47 46 48 class FoldPathConstants { … … 56 58 bool changed = false; 57 59 58 if ( verbose)60 if (B3FoldPathConstantsInternal::verbose) 59 61 dataLog("B3 before folding path constants: \n", m_proc, "\n"); 60 62 … … 81 83 } 82 84 83 if ( verbose)85 if (B3FoldPathConstantsInternal::verbose) 84 86 dataLog("Overriding ", *value, " from ", *from, ": ", override, "\n"); 85 87 … … 150 152 } 151 153 152 if ( verbose)154 if (B3FoldPathConstantsInternal::verbose) 153 155 dataLog("In block ", *block, " getting override for ", *value, ": ", result, "\n"); 154 156 -
trunk/Source/JavaScriptCore/b3/B3InferSwitches.cpp
r219702 r221954 43 43 namespace { 44 44 45 const bool verbose = false; 45 namespace B3InferSwitchesInternal { 46 static const bool verbose = false; 47 } 46 48 47 49 class InferSwitches { … … 56 58 bool run() 57 59 { 58 if ( verbose)60 if (B3InferSwitchesInternal::verbose) 59 61 dataLog("B3 before inferSwitches:\n", m_proc); 60 62 … … 64 66 changed = false; 65 67 66 if ( verbose)68 if (B3InferSwitchesInternal::verbose) 67 69 dataLog("Performing fixpoint iteration:\n"); 68 70 … … 79 81 m_proc.deleteOrphans(); 80 82 81 if ( verbose)83 if (B3InferSwitchesInternal::verbose) 82 84 dataLog("B3 after inferSwitches:\n", m_proc); 83 85 return true; … … 97 99 98 100 SwitchDescription description = describe(block); 99 if ( verbose)101 if (B3InferSwitchesInternal::verbose) 100 102 dataLog("Description of primary block ", *block, ": ", description, "\n"); 101 103 if (!description) { 102 if ( verbose)104 if (B3InferSwitchesInternal::verbose) 103 105 dataLog(" Bailing because not switch-like.\n"); 104 106 return false; … … 116 118 if (value == description.branch) 117 119 continue; 118 if ( verbose)120 if (B3InferSwitchesInternal::verbose) 119 121 dataLog(" Bailing because of ", deepDump(m_proc, value), "\n"); 120 122 return false; … … 123 125 BasicBlock* predecessor = block->predecessor(0); 124 126 SwitchDescription predecessorDescription = describe(predecessor); 125 if ( verbose)127 if (B3InferSwitchesInternal::verbose) 126 128 dataLog(" Description of predecessor block ", *predecessor, ": ", predecessorDescription, "\n"); 127 129 if (!predecessorDescription) { 128 if ( verbose)130 if (B3InferSwitchesInternal::verbose) 129 131 dataLog(" Bailing because not switch-like.\n"); 130 132 return false; … … 134 136 // We may be switching on different values! 135 137 if (description.source != predecessorDescription.source) { 136 if ( verbose)138 if (B3InferSwitchesInternal::verbose) 137 139 dataLog(" Bailing because sources don't match.\n"); 138 140 return false; … … 144 146 // yet. 145 147 if (predecessorDescription.fallThrough.block() != block) { 146 if ( verbose)148 if (B3InferSwitchesInternal::verbose) 147 149 dataLog(" Bailing because fall-through of predecessor is not the primary block.\n"); 148 150 return false; … … 152 154 if (description.fallThrough.block() == block 153 155 || description.fallThrough.block() == predecessor) { 154 if ( verbose)156 if (B3InferSwitchesInternal::verbose) 155 157 dataLog(" Bailing because of fall-through loop.\n"); 156 158 return false; … … 159 161 if (switchCase.targetBlock() == block 160 162 || switchCase.targetBlock() == predecessor) { 161 if ( verbose)163 if (B3InferSwitchesInternal::verbose) 162 164 dataLog(" Bailing because of loop in primary cases.\n"); 163 165 return false; … … 167 169 if (switchCase.targetBlock() == block 168 170 || switchCase.targetBlock() == predecessor) { 169 if ( verbose)171 if (B3InferSwitchesInternal::verbose) 170 172 dataLog(" Bailing because of loop in predecessor cases.\n"); 171 173 return false; … … 173 175 } 174 176 175 if ( verbose)177 if (B3InferSwitchesInternal::verbose) 176 178 dataLog(" Doing it!\n"); 177 179 // We're committed to doing the thing. -
trunk/Source/JavaScriptCore/b3/B3LowerMacrosAfterOptimizations.cpp
r213714 r221954 29 29 #if ENABLE(B3_JIT) 30 30 31 #include "AirArg.h" 31 32 #include "B3BasicBlockInlines.h" 32 33 #include "B3BlockInsertionSet.h" … … 40 41 namespace JSC { namespace B3 { 41 42 43 using Arg = Air::Arg; 44 using Code = Air::Code; 45 using Tmp = Air::Tmp; 46 42 47 namespace { 43 48 44 class LowerMacros {49 class LowerMacrosAfterOptimizations { 45 50 public: 46 LowerMacros (Procedure& proc)51 LowerMacrosAfterOptimizations(Procedure& proc) 47 52 : m_proc(proc) 48 53 , m_blockInsertionSet(proc) … … 184 189 bool lowerMacrosImpl(Procedure& proc) 185 190 { 186 LowerMacros lowerMacros(proc);191 LowerMacrosAfterOptimizations lowerMacros(proc); 187 192 return lowerMacros.run(); 188 193 } -
trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp
r220823 r221954 70 70 namespace JSC { namespace B3 { 71 71 72 using namespace Air;73 74 72 namespace { 75 73 76 const bool verbose = false; 74 namespace B3LowerToAirInternal { 75 static const bool verbose = false; 76 } 77 78 using Arg = Air::Arg; 79 using Inst = Air::Inst; 80 using Code = Air::Code; 81 using Tmp = Air::Tmp; 77 82 78 83 // FIXME: We wouldn't need this if Air supported Width modifiers in Air::Kind. 79 84 // https://bugs.webkit.org/show_bug.cgi?id=169247 80 85 #define OPCODE_FOR_WIDTH(opcode, width) ( \ 81 (width) == Width8 ? opcode ## 8 : \82 (width) == Width16 ? opcode ## 16 :\83 (width) == Width32 ? opcode ## 32 :\84 opcode ## 64)86 (width) == Width8 ? Air::opcode ## 8 : \ 87 (width) == Width16 ? Air::opcode ## 16 : \ 88 (width) == Width32 ? Air::opcode ## 32 : \ 89 Air::opcode ## 64) 85 90 #define OPCODE_FOR_CANONICAL_WIDTH(opcode, width) ( \ 86 (width) == Width64 ? opcode ## 64 :opcode ## 32)91 (width) == Width64 ? Air::opcode ## 64 : Air::opcode ## 32) 87 92 88 93 class LowerToAir { … … 108 113 void run() 109 114 { 115 using namespace Air; 110 116 for (B3::BasicBlock* block : m_procedure) 111 117 m_blockToBlock[block] = m_code.addBlock(block->frequency()); … … 115 121 case Phi: { 116 122 m_phiToTmp[value] = m_code.newTmp(value->resultBank()); 117 if ( verbose)123 if (B3LowerToAirInternal::verbose) 118 124 dataLog("Phi tmp for ", *value, ": ", m_phiToTmp[value], "\n"); 119 125 break; … … 147 153 m_isRare = !m_fastWorklist.saw(block); 148 154 149 if ( verbose)155 if (B3LowerToAirInternal::verbose) 150 156 dataLog("Lowering Block ", *block, ":\n"); 151 157 … … 164 170 continue; 165 171 m_insts.append(Vector<Inst>()); 166 if ( verbose)172 if (B3LowerToAirInternal::verbose) 167 173 dataLog("Lowering ", deepDump(m_procedure, m_value), ":\n"); 168 174 lower(); 169 if ( verbose) {175 if (B3LowerToAirInternal::verbose) { 170 176 for (Inst& inst : m_insts.last()) 171 177 dataLog(" ", inst, "\n"); … … 380 386 if (m_procedure.isFastConstant(value->key())) 381 387 m_code.addFastTmp(realTmp); 382 if ( verbose)388 if (B3LowerToAirInternal::verbose) 383 389 dataLog("Tmp for ", *value, ": ", realTmp, "\n"); 384 390 } … … 907 913 void appendShift(Value* value, Value* amount) 908 914 { 915 using namespace Air; 909 916 Air::Opcode opcode = opcodeForType(opcode32, opcode64, value->type()); 910 917 … … 1020 1027 Inst createStore(Air::Kind move, Value* value, const Arg& dest) 1021 1028 { 1029 using namespace Air; 1022 1030 if (auto imm_value = imm(value)) { 1023 1031 if (isARM64() && imm_value.value() == 0) { … … 1044 1052 Air::Opcode storeOpcode(Width width, Bank bank) 1045 1053 { 1054 using namespace Air; 1046 1055 switch (width) { 1047 1056 case Width8: … … 1074 1083 void appendStore(Value* value, const Arg& dest) 1075 1084 { 1085 using namespace Air; 1076 1086 MemoryValue* memory = value->as<MemoryValue>(); 1077 1087 RELEASE_ASSERT(memory->isStore()); … … 1101 1111 Air::Opcode moveForType(Type type) 1102 1112 { 1113 using namespace Air; 1103 1114 switch (type) { 1104 1115 case Int32: … … 1120 1131 Air::Opcode relaxedMoveForType(Type type) 1121 1132 { 1133 using namespace Air; 1122 1134 switch (type) { 1123 1135 case Int32: … … 1163 1175 { 1164 1176 auto printList = Printer::makePrintRecordList(arguments...); 1165 auto printSpecial = static_cast< PrintSpecial*>(m_code.addSpecial(std::make_unique<PrintSpecial>(printList)));1166 Inst inst( Patch, origin, Arg::special(printSpecial));1177 auto printSpecial = static_cast<Air::PrintSpecial*>(m_code.addSpecial(std::make_unique<Air::PrintSpecial>(printList))); 1178 Inst inst(Air::Patch, origin, Arg::special(printSpecial)); 1167 1179 Printer::appendAirArgs(inst, std::forward<Arguments>(arguments)...); 1168 1180 append(WTFMove(inst)); … … 1763 1775 Inst createBranch(Value* value, bool inverted = false) 1764 1776 { 1777 using namespace Air; 1765 1778 return createGenericCompare( 1766 1779 value, … … 1846 1859 Inst createCompare(Value* value, bool inverted = false) 1847 1860 { 1861 using namespace Air; 1848 1862 return createGenericCompare( 1849 1863 value, … … 1925 1939 Inst createSelect(const MoveConditionallyConfig& config) 1926 1940 { 1941 using namespace Air; 1927 1942 auto createSelectInstruction = [&] (Air::Opcode opcode, const Arg& condition, ArgPromise& left, ArgPromise& right) -> Inst { 1928 1943 if (isValidForm(opcode, condition.kind(), left.kind(), right.kind(), Arg::Tmp, Arg::Tmp, Arg::Tmp)) { … … 1988 2003 bool tryAppendLea() 1989 2004 { 2005 using namespace Air; 1990 2006 Air::Opcode leaOpcode = tryOpcodeForType(Lea32, Lea64, m_value->type()); 1991 2007 if (!isValidForm(leaOpcode, Arg::Index, Arg::Tmp)) … … 2117 2133 void appendX86Div(B3::Opcode op) 2118 2134 { 2135 using namespace Air; 2119 2136 Air::Opcode convertToDoubleWord; 2120 2137 Air::Opcode div; … … 2144 2161 void appendX86UDiv(B3::Opcode op) 2145 2162 { 2163 using namespace Air; 2146 2164 Air::Opcode div = m_value->type() == Int32 ? X86UDiv32 : X86UDiv64; 2147 2165 … … 2179 2197 void appendCAS(Value* atomicValue, bool invert) 2180 2198 { 2199 using namespace Air; 2181 2200 AtomicValue* atomic = atomicValue->as<AtomicValue>(); 2182 2201 RELEASE_ASSERT(atomic); … … 2341 2360 void appendGeneralAtomic(Air::Opcode opcode, Commutativity commutativity = NotCommutative) 2342 2361 { 2362 using namespace Air; 2343 2363 AtomicValue* atomic = m_value->as<AtomicValue>(); 2344 2364 … … 2425 2445 void lower() 2426 2446 { 2447 using namespace Air; 2427 2448 switch (m_value->opcode()) { 2428 2449 case B3::Nop: { -
trunk/Source/JavaScriptCore/b3/B3PatchpointSpecial.cpp
r216306 r221954 35 35 namespace JSC { namespace B3 { 36 36 37 using namespace Air; 37 using Arg = Air::Arg; 38 using Inst = Air::Inst; 38 39 39 40 PatchpointSpecial::PatchpointSpecial() … … 136 137 } 137 138 138 CCallHelpers::Jump PatchpointSpecial::generate( 139 Inst& inst, CCallHelpers& jit, GenerationContext& context) 139 CCallHelpers::Jump PatchpointSpecial::generate(Inst& inst, CCallHelpers& jit, Air::GenerationContext& context) 140 140 { 141 141 PatchpointValue* value = inst.origin->as<PatchpointValue>(); -
trunk/Source/JavaScriptCore/b3/B3ReduceDoubleToFloat.cpp
r219026 r221954 40 40 namespace { 41 41 42 bool verbose = false; 42 namespace B3ReduceDoubleToFloatInternal { 43 static const bool verbose = false; 44 } 43 45 bool printRemainingConversions = false; 44 46 … … 129 131 } while (changedPhiState); 130 132 131 if ( verbose) {133 if (B3ReduceDoubleToFloatInternal::verbose) { 132 134 dataLog("Conversion candidates:\n"); 133 135 for (BasicBlock* block : m_procedure) { … … 193 195 } while (changedPhiState); 194 196 195 if ( verbose) {197 if (B3ReduceDoubleToFloatInternal::verbose) { 196 198 dataLog("Phis containing float values:\n"); 197 199 for (BasicBlock* block : m_procedure) { … … 490 492 PhaseScope phaseScope(procedure, "reduceDoubleToFloat"); 491 493 492 if ( verbose)494 if (B3ReduceDoubleToFloatInternal::verbose) 493 495 dataLog("Before DoubleToFloatReduction:\n", procedure, "\n"); 494 496 … … 496 498 doubleToFloatReduction.run(); 497 499 498 if ( verbose)500 if (B3ReduceDoubleToFloatInternal::verbose) 499 501 dataLog("After DoubleToFloatReduction:\n", procedure, "\n"); 500 502 -
trunk/Source/JavaScriptCore/b3/B3ReduceStrength.cpp
r220625 r221954 89 89 // canonical if x->index() <= y->index(). 90 90 91 bool verbose = false; 91 namespace B3ReduceStrengthInternal { 92 static const bool verbose = false; 93 } 92 94 93 95 // FIXME: This IntRange stuff should be refactored into a general constant propagator. It's weird … … 415 417 if (first) 416 418 first = false; 417 else if ( verbose) {419 else if (B3ReduceStrengthInternal::verbose) { 418 420 dataLog("B3 after iteration #", index - 1, " of reduceStrength:\n"); 419 421 dataLog(m_proc); … … 453 455 454 456 for (m_index = 0; m_index < block->size(); ++m_index) { 455 if ( verbose) {457 if (B3ReduceStrengthInternal::verbose) { 456 458 dataLog( 457 459 "Looking at ", *block, " #", m_index, ": ", … … 2036 2038 void specializeSelect(Value* source) 2037 2039 { 2038 if ( verbose)2040 if (B3ReduceStrengthInternal::verbose) 2039 2041 dataLog("Specializing select: ", deepDump(m_proc, source), "\n"); 2040 2042 … … 2277 2279 void simplifyCFG() 2278 2280 { 2279 if ( verbose) {2281 if (B3ReduceStrengthInternal::verbose) { 2280 2282 dataLog("Before simplifyCFG:\n"); 2281 2283 dataLog(m_proc); … … 2302 2304 2303 2305 for (BasicBlock* block : m_proc) { 2304 if ( verbose)2306 if (B3ReduceStrengthInternal::verbose) 2305 2307 dataLog("Considering block ", *block, ":\n"); 2306 2308 … … 2318 2320 BasicBlock* newSuccessor = successor->successorBlock(0); 2319 2321 if (newSuccessor != successor) { 2320 if ( verbose) {2322 if (B3ReduceStrengthInternal::verbose) { 2321 2323 dataLog( 2322 2324 "Replacing ", pointerDump(block), "->", pointerDump(successor), … … 2349 2351 } 2350 2352 if (allSame) { 2351 if ( verbose) {2353 if (B3ReduceStrengthInternal::verbose) { 2352 2354 dataLog( 2353 2355 "Changing ", pointerDump(block), "'s terminal to a Jump.\n"); … … 2388 2390 newSuccessor->replacePredecessor(successor, block); 2389 2391 2390 if ( verbose) {2392 if (B3ReduceStrengthInternal::verbose) { 2391 2393 dataLog( 2392 2394 "Merged ", pointerDump(block), "->", pointerDump(successor), "\n"); … … 2398 2400 } 2399 2401 2400 if (m_changedCFG && verbose) {2402 if (m_changedCFG && B3ReduceStrengthInternal::verbose) { 2401 2403 dataLog("B3 after simplifyCFG:\n"); 2402 2404 dataLog(m_proc); -
trunk/Source/JavaScriptCore/b3/B3StackmapGenerationParams.cpp
r215292 r221954 34 34 35 35 namespace JSC { namespace B3 { 36 37 using namespace Air;38 36 39 37 const RegisterSet& StackmapGenerationParams::usedRegisters() const -
trunk/Source/JavaScriptCore/b3/B3StackmapSpecial.cpp
r216306 r221954 35 35 namespace JSC { namespace B3 { 36 36 37 using namespace Air; 37 using Arg = Air::Arg; 38 using Inst = Air::Inst; 39 using Tmp = Air::Tmp; 38 40 39 41 StackmapSpecial::StackmapSpecial() … … 211 213 } 212 214 213 Vector<ValueRep> StackmapSpecial::repsImpl( 214 GenerationContext& context, unsigned numIgnoredB3Args, unsigned numIgnoredAirArgs, Inst& inst) 215 Vector<ValueRep> StackmapSpecial::repsImpl(Air::GenerationContext& context, unsigned numIgnoredB3Args, unsigned numIgnoredAirArgs, Inst& inst) 215 216 { 216 217 Vector<ValueRep> result; … … 268 269 } 269 270 270 ValueRep StackmapSpecial::repForArg( Code& code, const Arg& arg)271 ValueRep StackmapSpecial::repForArg(Air::Code& code, const Arg& arg) 271 272 { 272 273 switch (arg.kind()) { -
trunk/Source/JavaScriptCore/b3/air/AirAllocateStackByGraphColoring.cpp
r215310 r221954 43 43 namespace { 44 44 45 const bool verbose = false; 45 namespace AirAllocateStackByGraphColoringInternal { 46 static const bool verbose = false; 47 } 46 48 47 49 struct CoalescableMove { … … 154 156 155 157 auto interfere = [&] (unsigned instIndex) { 156 if ( verbose)158 if (AirAllocateStackByGraphColoringInternal::verbose) 157 159 dataLog("Interfering: ", WTF::pointerListDump(localCalc.live()), "\n"); 158 160 … … 186 188 187 189 for (unsigned instIndex = block->size(); instIndex--;) { 188 if ( verbose)190 if (AirAllocateStackByGraphColoringInternal::verbose) 189 191 dataLog("Analyzing: ", block->at(instIndex), "\n"); 190 192 … … 233 235 } 234 236 235 if ( verbose) {237 if (AirAllocateStackByGraphColoringInternal::verbose) { 236 238 for (StackSlot* slot : code.stackSlots()) 237 239 dataLog("Interference of ", pointerDump(slot), ": ", pointerListDump(interference[slot]), "\n"); -
trunk/Source/JavaScriptCore/b3/air/AirEmitShuffle.cpp
r219702 r221954 38 38 namespace { 39 39 40 bool verbose = false; 40 namespace AirEmitShuffleInternal { 41 static const bool verbose = false; 42 } 41 43 42 44 template<typename Functor> … … 126 128 Value* origin) 127 129 { 128 if ( verbose) {130 if (AirEmitShuffleInternal::verbose) { 129 131 dataLog( 130 132 "Dealing with pairs: ", listDump(pairs), " and scratches ", scratches[0], ", ", … … 186 188 Arg originalSrc = mapping.begin()->key; 187 189 ASSERT(!shifts.contains(originalSrc)); 188 if ( verbose)190 if (AirEmitShuffleInternal::verbose) 189 191 dataLog("Processing from ", originalSrc, "\n"); 190 192 … … 196 198 // With a shift it's possible that we previously built the tail of this shift. 197 199 // See if that's the case now. 198 if ( verbose)200 if (AirEmitShuffleInternal::verbose) 199 201 dataLog("Trying to append shift at ", src, "\n"); 200 202 currentPairs.appendVector(shifts.take(src)); … … 214 216 ASSERT(currentPairs[0].src() == originalSrc); 215 217 216 if ( verbose)218 if (AirEmitShuffleInternal::verbose) 217 219 dataLog("currentPairs = ", listDump(currentPairs), "\n"); 218 220 … … 226 228 227 229 if (isRotate) { 228 if ( verbose)230 if (AirEmitShuffleInternal::verbose) 229 231 dataLog("It's a rotate.\n"); 230 232 Rotate rotate; … … 278 280 currentPairs.shrink(0); 279 281 } else { 280 if ( verbose)282 if (AirEmitShuffleInternal::verbose) 281 283 dataLog("It's a shift.\n"); 282 284 shifts.add(originalSrc, WTFMove(currentPairs)); … … 285 287 } 286 288 287 if ( verbose) {289 if (AirEmitShuffleInternal::verbose) { 288 290 dataLog("Shifts:\n"); 289 291 for (auto& entry : shifts) -
trunk/Source/JavaScriptCore/b3/air/AirFixObviousSpills.cpp
r216027 r221954 40 40 namespace { 41 41 42 bool verbose = false; 42 namespace AirFixObviousSpillsInternal { 43 static const bool verbose = false; 44 } 43 45 44 46 class FixObviousSpills { … … 52 54 void run() 53 55 { 54 if ( verbose)56 if (AirFixObviousSpillsInternal::verbose) 55 57 dataLog("Code before fixObviousSpills:\n", m_code); 56 58 … … 74 76 continue; 75 77 76 if ( verbose)78 if (AirFixObviousSpillsInternal::verbose) 77 79 dataLog("Executing block ", *m_block, ": ", m_state, "\n"); 78 80 … … 170 172 Inst& inst = m_block->at(m_instIndex); 171 173 172 if ( verbose)174 if (AirFixObviousSpillsInternal::verbose) 173 175 dataLog(" Executing ", inst, ": ", m_state, "\n"); 174 176 … … 176 178 &inst, &inst, 177 179 [&] (const Arg& arg, Arg::Role, Bank, Width) { 178 if ( verbose)180 if (AirFixObviousSpillsInternal::verbose) 179 181 dataLog(" Clobbering ", arg, "\n"); 180 182 m_state.clobber(arg); … … 191 193 Inst& inst = m_block->at(m_instIndex); 192 194 193 if ( verbose)195 if (AirFixObviousSpillsInternal::verbose) 194 196 dataLog("Fixing inst ", inst, ": ", m_state, "\n"); 195 197 … … 268 270 if (alias->mode != RegSlot::AllBits) 269 271 return; 270 if ( verbose)272 if (AirFixObviousSpillsInternal::verbose) 271 273 dataLog(" Replacing ", arg, " with ", alias->reg, "\n"); 272 274 arg = Tmp(alias->reg); … … 274 276 return; 275 277 case Width32: 276 if ( verbose)278 if (AirFixObviousSpillsInternal::verbose) 277 279 dataLog(" Replacing ", arg, " with ", alias->reg, " (subwidth case)\n"); 278 280 arg = Tmp(alias->reg); … … 286 288 // Revert to immediate if that didn't work. 287 289 if (const SlotConst* alias = m_state.getSlotConst(arg.stackSlot())) { 288 if ( verbose)290 if (AirFixObviousSpillsInternal::verbose) 289 291 dataLog(" Replacing ", arg, " with constant ", alias->constant, "\n"); 290 292 if (Arg::isValidImmForm(alias->constant)) -
trunk/Source/JavaScriptCore/b3/air/AirLowerAfterRegAlloc.cpp
r219702 r221954 47 47 namespace { 48 48 49 bool verbose = false; 49 namespace AirLowerAfterRegAllocInternal { 50 static const bool verbose = false; 51 } 50 52 51 53 } // anonymous namespace … … 55 57 PhaseScope phaseScope(code, "lowerAfterRegAlloc"); 56 58 57 if ( verbose)59 if (AirLowerAfterRegAllocInternal::verbose) 58 60 dataLog("Code before lowerAfterRegAlloc:\n", code); 59 61 … … 222 224 }); 223 225 224 if ( verbose)226 if (AirLowerAfterRegAllocInternal::verbose) 225 227 dataLog("Pre-call pairs for ", inst, ": ", listDump(pairs), "\n"); 226 228 … … 274 276 } 275 277 276 if ( verbose)278 if (AirLowerAfterRegAllocInternal::verbose) 277 279 dataLog("Code after lowerAfterRegAlloc:\n", code); 278 280 } -
trunk/Source/JavaScriptCore/b3/air/AirStackAllocation.cpp
r215310 r221954 39 39 namespace { 40 40 41 const bool verbose = false; 41 namespace AirStackAllocationInternal { 42 static const bool verbose = false; 43 } 42 44 43 45 template<typename Collection> … … 55 57 StackSlot* slot, intptr_t offsetFromFP, const Vector<StackSlot*>& otherSlots) 56 58 { 57 if ( verbose)59 if (AirStackAllocationInternal::verbose) 58 60 dataLog("Attempting to assign ", pointerDump(slot), " to ", offsetFromFP, " with interference ", pointerListDump(otherSlots), "\n"); 59 61 … … 73 75 } 74 76 75 if ( verbose)77 if (AirStackAllocationInternal::verbose) 76 78 dataLog("Assigned ", pointerDump(slot), " to ", offsetFromFP, "\n"); 77 79 slot->setOffsetFromFP(offsetFromFP); … … 81 83 void assign(StackSlot* slot, const Vector<StackSlot*>& otherSlots) 82 84 { 83 if ( verbose)85 if (AirStackAllocationInternal::verbose) 84 86 dataLog("Attempting to assign ", pointerDump(slot), " with interference ", pointerListDump(otherSlots), "\n"); 85 87
Note:
See TracChangeset
for help on using the changeset viewer.