Changeset 195139 in webkit
- Timestamp:
- Jan 15, 2016 11:41:56 AM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 10 added
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r195138 r195139 74 74 b3/air/AirBasicBlock.cpp 75 75 b3/air/AirCCallSpecial.cpp 76 b3/air/AirCCallingConvention.cpp 76 77 b3/air/AirCode.cpp 78 b3/air/AirCustom.cpp 77 79 b3/air/AirEliminateDeadCode.cpp 80 b3/air/AirEmitShuffle.cpp 78 81 b3/air/AirFixPartialRegisterStalls.cpp 79 82 b3/air/AirGenerate.cpp … … 83 86 b3/air/AirInst.cpp 84 87 b3/air/AirIteratedRegisterCoalescing.cpp 88 b3/air/AirLowerAfterRegAlloc.cpp 89 b3/air/AirLowerMacros.cpp 85 90 b3/air/AirOptimizeBlockOrder.cpp 86 91 b3/air/AirPhaseScope.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r195138 r195139 1 2016-01-15 Filip Pizlo <fpizlo@apple.com> 2 3 Air needs a Shuffle instruction 4 https://bugs.webkit.org/show_bug.cgi?id=152952 5 6 Reviewed by Saam Barati. 7 8 This adds an instruction called Shuffle. Shuffle allows you to simultaneously perform 9 multiple moves to perform arbitrary permutations over registers and memory. We call these 10 rotations. It also allows you to perform "shifts", like (a => b, b => c): after the shift, 11 c will have b's old value, b will have a's old value, and a will be unchanged. Shifts can 12 use immediates as their source. 13 14 Shuffle is added as a custom instruction, since it has a variable number of arguments. It 15 takes any number of triplets of arguments, where each triplet describes one mapping of the 16 shuffle. For example, to represent (a => b, b => c), we might say: 17 18 Shuffle %a, %b, 64, %b, %c, 64 19 20 Note the "64"s, those are width arguments that describe how many bits of the register are 21 being moved. Each triplet is referred to as a "shuffle pair". We call it a pair because the 22 most relevant part of it is the pair of registers or memroy locations (i.e. %a, %b form one 23 of the pairs in the example). For GP arguments, the width follows ZDef semantics. 24 25 In the future, we will be able to use Shuffle for a lot of things. This patch is modest about 26 how to use it: 27 28 - C calling convention argument marshalling. Previously we used move instructions. But that's 29 problematic since it introduces artificial interference between the argument registers and 30 the inputs. Using Shuffle removes that interference. This helps a bit. 31 32 - Cold C calls. This is what really motivated me to write this patch. If we have a C call on 33 a cold path, then we want it to appear to the register allocator like it doesn't clobber 34 any registers. Only after register allocation should we handle the clobbering by simply 35 saving all of the live volatile registers to the stack. If you imagine the saving and the 36 argument marshalling, you can see how before the call, we want to have a Shuffle that does 37 both of those things. This is important. If argument marshalling was separate from the 38 saving, then we'd still appear to clobber argument registers. Doing them together as one 39 Shuffle means that the cold call doesn't appear to even clobber the argument registers. 40 41 Unfortunately, I was wrong about cold C calls being the dominant problem with our register 42 allocator right now. Fixing this revealed other problems in my current tuning benchmark, 43 Octane/encrypt. Nonetheless, this is a small speed-up across the board, and gives us some 44 functionality we will need to implement other optimizations. 45 46 Relanding after fixing production build. 47 48 * CMakeLists.txt: 49 * JavaScriptCore.xcodeproj/project.pbxproj: 50 * assembler/AbstractMacroAssembler.h: 51 (JSC::isX86_64): 52 (JSC::isIOS): 53 (JSC::optimizeForARMv7IDIVSupported): 54 * assembler/MacroAssemblerX86Common.h: 55 (JSC::MacroAssemblerX86Common::zeroExtend32ToPtr): 56 (JSC::MacroAssemblerX86Common::swap32): 57 (JSC::MacroAssemblerX86Common::moveConditionally32): 58 * assembler/MacroAssemblerX86_64.h: 59 (JSC::MacroAssemblerX86_64::store64WithAddressOffsetPatch): 60 (JSC::MacroAssemblerX86_64::swap64): 61 (JSC::MacroAssemblerX86_64::move64ToDouble): 62 * assembler/X86Assembler.h: 63 (JSC::X86Assembler::xchgl_rr): 64 (JSC::X86Assembler::xchgl_rm): 65 (JSC::X86Assembler::xchgq_rr): 66 (JSC::X86Assembler::xchgq_rm): 67 (JSC::X86Assembler::movl_rr): 68 * b3/B3CCallValue.h: 69 * b3/B3Compilation.cpp: 70 (JSC::B3::Compilation::Compilation): 71 (JSC::B3::Compilation::~Compilation): 72 * b3/B3Compilation.h: 73 (JSC::B3::Compilation::code): 74 * b3/B3LowerToAir.cpp: 75 (JSC::B3::Air::LowerToAir::run): 76 (JSC::B3::Air::LowerToAir::createSelect): 77 (JSC::B3::Air::LowerToAir::lower): 78 (JSC::B3::Air::LowerToAir::marshallCCallArgument): Deleted. 79 * b3/B3OpaqueByproducts.h: 80 (JSC::B3::OpaqueByproducts::count): 81 * b3/B3StackmapSpecial.cpp: 82 (JSC::B3::StackmapSpecial::isArgValidForValue): 83 (JSC::B3::StackmapSpecial::isArgValidForRep): 84 * b3/air/AirArg.cpp: 85 (JSC::B3::Air::Arg::isStackMemory): 86 (JSC::B3::Air::Arg::isRepresentableAs): 87 (JSC::B3::Air::Arg::usesTmp): 88 (JSC::B3::Air::Arg::canRepresent): 89 (JSC::B3::Air::Arg::isCompatibleType): 90 (JSC::B3::Air::Arg::dump): 91 (WTF::printInternal): 92 * b3/air/AirArg.h: 93 (JSC::B3::Air::Arg::forEachType): 94 (JSC::B3::Air::Arg::isWarmUse): 95 (JSC::B3::Air::Arg::cooled): 96 (JSC::B3::Air::Arg::isEarlyUse): 97 (JSC::B3::Air::Arg::imm64): 98 (JSC::B3::Air::Arg::immPtr): 99 (JSC::B3::Air::Arg::addr): 100 (JSC::B3::Air::Arg::special): 101 (JSC::B3::Air::Arg::widthArg): 102 (JSC::B3::Air::Arg::operator==): 103 (JSC::B3::Air::Arg::isImm64): 104 (JSC::B3::Air::Arg::isSomeImm): 105 (JSC::B3::Air::Arg::isAddr): 106 (JSC::B3::Air::Arg::isIndex): 107 (JSC::B3::Air::Arg::isMemory): 108 (JSC::B3::Air::Arg::isRelCond): 109 (JSC::B3::Air::Arg::isSpecial): 110 (JSC::B3::Air::Arg::isWidthArg): 111 (JSC::B3::Air::Arg::isAlive): 112 (JSC::B3::Air::Arg::base): 113 (JSC::B3::Air::Arg::hasOffset): 114 (JSC::B3::Air::Arg::offset): 115 (JSC::B3::Air::Arg::width): 116 (JSC::B3::Air::Arg::isGPTmp): 117 (JSC::B3::Air::Arg::isGP): 118 (JSC::B3::Air::Arg::isFP): 119 (JSC::B3::Air::Arg::isType): 120 (JSC::B3::Air::Arg::isGPR): 121 (JSC::B3::Air::Arg::isValidForm): 122 (JSC::B3::Air::Arg::forEachTmpFast): 123 * b3/air/AirBasicBlock.h: 124 (JSC::B3::Air::BasicBlock::insts): 125 (JSC::B3::Air::BasicBlock::appendInst): 126 (JSC::B3::Air::BasicBlock::append): 127 * b3/air/AirCCallingConvention.cpp: Added. 128 (JSC::B3::Air::computeCCallingConvention): 129 (JSC::B3::Air::cCallResult): 130 (JSC::B3::Air::buildCCall): 131 * b3/air/AirCCallingConvention.h: Added. 132 * b3/air/AirCode.h: 133 (JSC::B3::Air::Code::proc): 134 * b3/air/AirCustom.cpp: Added. 135 (JSC::B3::Air::CCallCustom::isValidForm): 136 (JSC::B3::Air::CCallCustom::generate): 137 (JSC::B3::Air::ShuffleCustom::isValidForm): 138 (JSC::B3::Air::ShuffleCustom::generate): 139 * b3/air/AirCustom.h: 140 (JSC::B3::Air::PatchCustom::forEachArg): 141 (JSC::B3::Air::PatchCustom::generate): 142 (JSC::B3::Air::CCallCustom::forEachArg): 143 (JSC::B3::Air::CCallCustom::isValidFormStatic): 144 (JSC::B3::Air::CCallCustom::admitsStack): 145 (JSC::B3::Air::CCallCustom::hasNonArgNonControlEffects): 146 (JSC::B3::Air::ColdCCallCustom::forEachArg): 147 (JSC::B3::Air::ShuffleCustom::forEachArg): 148 (JSC::B3::Air::ShuffleCustom::isValidFormStatic): 149 (JSC::B3::Air::ShuffleCustom::admitsStack): 150 (JSC::B3::Air::ShuffleCustom::hasNonArgNonControlEffects): 151 * b3/air/AirEmitShuffle.cpp: Added. 152 (JSC::B3::Air::ShufflePair::dump): 153 (JSC::B3::Air::emitShuffle): 154 * b3/air/AirEmitShuffle.h: Added. 155 (JSC::B3::Air::ShufflePair::ShufflePair): 156 (JSC::B3::Air::ShufflePair::src): 157 (JSC::B3::Air::ShufflePair::dst): 158 (JSC::B3::Air::ShufflePair::width): 159 * b3/air/AirGenerate.cpp: 160 (JSC::B3::Air::prepareForGeneration): 161 * b3/air/AirGenerate.h: 162 * b3/air/AirInsertionSet.cpp: 163 (JSC::B3::Air::InsertionSet::insertInsts): 164 (JSC::B3::Air::InsertionSet::execute): 165 * b3/air/AirInsertionSet.h: 166 (JSC::B3::Air::InsertionSet::insertInst): 167 (JSC::B3::Air::InsertionSet::insert): 168 * b3/air/AirInst.h: 169 (JSC::B3::Air::Inst::operator bool): 170 (JSC::B3::Air::Inst::append): 171 * b3/air/AirLowerAfterRegAlloc.cpp: Added. 172 (JSC::B3::Air::lowerAfterRegAlloc): 173 * b3/air/AirLowerAfterRegAlloc.h: Added. 174 * b3/air/AirLowerMacros.cpp: Added. 175 (JSC::B3::Air::lowerMacros): 176 * b3/air/AirLowerMacros.h: Added. 177 * b3/air/AirOpcode.opcodes: 178 * b3/air/AirRegisterPriority.h: 179 (JSC::B3::Air::regsInPriorityOrder): 180 * b3/air/testair.cpp: Added. 181 (hiddenTruthBecauseNoReturnIsStupid): 182 (usage): 183 (JSC::B3::Air::compile): 184 (JSC::B3::Air::invoke): 185 (JSC::B3::Air::compileAndRun): 186 (JSC::B3::Air::testSimple): 187 (JSC::B3::Air::loadConstantImpl): 188 (JSC::B3::Air::loadConstant): 189 (JSC::B3::Air::loadDoubleConstant): 190 (JSC::B3::Air::testShuffleSimpleSwap): 191 (JSC::B3::Air::testShuffleSimpleShift): 192 (JSC::B3::Air::testShuffleLongShift): 193 (JSC::B3::Air::testShuffleLongShiftBackwards): 194 (JSC::B3::Air::testShuffleSimpleRotate): 195 (JSC::B3::Air::testShuffleSimpleBroadcast): 196 (JSC::B3::Air::testShuffleBroadcastAllRegs): 197 (JSC::B3::Air::testShuffleTreeShift): 198 (JSC::B3::Air::testShuffleTreeShiftBackward): 199 (JSC::B3::Air::testShuffleTreeShiftOtherBackward): 200 (JSC::B3::Air::testShuffleMultipleShifts): 201 (JSC::B3::Air::testShuffleRotateWithFringe): 202 (JSC::B3::Air::testShuffleRotateWithLongFringe): 203 (JSC::B3::Air::testShuffleMultipleRotates): 204 (JSC::B3::Air::testShuffleShiftAndRotate): 205 (JSC::B3::Air::testShuffleShiftAllRegs): 206 (JSC::B3::Air::testShuffleRotateAllRegs): 207 (JSC::B3::Air::testShuffleSimpleSwap64): 208 (JSC::B3::Air::testShuffleSimpleShift64): 209 (JSC::B3::Air::testShuffleSwapMixedWidth): 210 (JSC::B3::Air::testShuffleShiftMixedWidth): 211 (JSC::B3::Air::testShuffleShiftMemory): 212 (JSC::B3::Air::testShuffleShiftMemoryLong): 213 (JSC::B3::Air::testShuffleShiftMemoryAllRegs): 214 (JSC::B3::Air::testShuffleShiftMemoryAllRegs64): 215 (JSC::B3::Air::combineHiLo): 216 (JSC::B3::Air::testShuffleShiftMemoryAllRegsMixedWidth): 217 (JSC::B3::Air::testShuffleRotateMemory): 218 (JSC::B3::Air::testShuffleRotateMemory64): 219 (JSC::B3::Air::testShuffleRotateMemoryMixedWidth): 220 (JSC::B3::Air::testShuffleRotateMemoryAllRegs64): 221 (JSC::B3::Air::testShuffleRotateMemoryAllRegsMixedWidth): 222 (JSC::B3::Air::testShuffleSwapDouble): 223 (JSC::B3::Air::testShuffleShiftDouble): 224 (JSC::B3::Air::run): 225 (run): 226 (main): 227 * b3/testb3.cpp: 228 (JSC::B3::testCallSimple): 229 (JSC::B3::testCallRare): 230 (JSC::B3::testCallRareLive): 231 (JSC::B3::testCallSimplePure): 232 (JSC::B3::run): 233 1 234 2016-01-15 Andy VanWagoner <thetalecrafter@gmail.com> 2 235 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r195138 r195139 26 26 ); 27 27 dependencies = ( 28 0F6183471C45F67A0072450B /* PBXTargetDependency */, 28 29 0F93275D1C20BF3A00CF6564 /* PBXTargetDependency */, 29 30 0FEC85B11BDB5D8F0080FF74 /* PBXTargetDependency */, … … 343 344 0F3E01AA19D353A500F61B7F /* DFGPrePostNumbering.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3E01A819D353A500F61B7F /* DFGPrePostNumbering.cpp */; }; 344 345 0F3E01AB19D353A500F61B7F /* DFGPrePostNumbering.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3E01A919D353A500F61B7F /* DFGPrePostNumbering.h */; }; 346 0F40E4A71C497F7400A577FA /* AirOpcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6183321C45F35C0072450B /* AirOpcode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 347 0F40E4A81C497F7400A577FA /* AirOpcodeGenerated.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6183341C45F3B60072450B /* AirOpcodeGenerated.h */; settings = {ATTRIBUTES = (Private, ); }; }; 348 0F40E4A91C497F7400A577FA /* AirOpcodeUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6183351C45F3B60072450B /* AirOpcodeUtils.h */; settings = {ATTRIBUTES = (Private, ); }; }; 345 349 0F426A481460CBB300131F8F /* ValueRecovery.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A451460CBAB00131F8F /* ValueRecovery.h */; settings = {ATTRIBUTES = (Private, ); }; }; 346 350 0F426A491460CBB700131F8F /* VirtualRegister.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A461460CBAB00131F8F /* VirtualRegister.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 401 405 0F5EF91F16878F7D003E5C25 /* JITThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5EF91C16878F78003E5C25 /* JITThunks.h */; settings = {ATTRIBUTES = (Private, ); }; }; 402 406 0F5F08CF146C7633000472A9 /* UnconditionalFinalizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5F08CE146C762F000472A9 /* UnconditionalFinalizer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 407 0F6183291C45BF070072450B /* AirCCallingConvention.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6183201C45BF070072450B /* AirCCallingConvention.cpp */; }; 408 0F61832A1C45BF070072450B /* AirCCallingConvention.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6183211C45BF070072450B /* AirCCallingConvention.h */; }; 409 0F61832B1C45BF070072450B /* AirCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6183221C45BF070072450B /* AirCustom.cpp */; }; 410 0F61832C1C45BF070072450B /* AirEmitShuffle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6183231C45BF070072450B /* AirEmitShuffle.cpp */; }; 411 0F61832D1C45BF070072450B /* AirEmitShuffle.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6183241C45BF070072450B /* AirEmitShuffle.h */; }; 412 0F61832E1C45BF070072450B /* AirLowerAfterRegAlloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6183251C45BF070072450B /* AirLowerAfterRegAlloc.cpp */; }; 413 0F61832F1C45BF070072450B /* AirLowerAfterRegAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6183261C45BF070072450B /* AirLowerAfterRegAlloc.h */; }; 414 0F6183301C45BF070072450B /* AirLowerMacros.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6183271C45BF070072450B /* AirLowerMacros.cpp */; }; 415 0F6183311C45BF070072450B /* AirLowerMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6183281C45BF070072450B /* AirLowerMacros.h */; }; 416 0F61833C1C45F62A0072450B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */; }; 417 0F61833D1C45F62A0072450B /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* JavaScriptCore.framework */; }; 418 0F6183451C45F6600072450B /* testair.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6183441C45F6600072450B /* testair.cpp */; }; 403 419 0F620174143FCD330068B77C /* DFGVariableAccessData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F620172143FCD2F0068B77C /* DFGVariableAccessData.h */; }; 404 420 0F620176143FCD3B0068B77C /* DFGBasicBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F620170143FCD2F0068B77C /* DFGBasicBlock.h */; }; … … 2080 2096 2081 2097 /* Begin PBXContainerItemProxy section */ 2098 0F6183461C45F67A0072450B /* PBXContainerItemProxy */ = { 2099 isa = PBXContainerItemProxy; 2100 containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; 2101 proxyType = 1; 2102 remoteGlobalIDString = 0F6183381C45F62A0072450B; 2103 remoteInfo = testair; 2104 }; 2082 2105 0F93275C1C20BF3A00CF6564 /* PBXContainerItemProxy */ = { 2083 2106 isa = PBXContainerItemProxy; … … 2543 2566 0F5EF91C16878F78003E5C25 /* JITThunks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITThunks.h; sourceTree = "<group>"; }; 2544 2567 0F5F08CE146C762F000472A9 /* UnconditionalFinalizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnconditionalFinalizer.h; sourceTree = "<group>"; }; 2568 0F6183201C45BF070072450B /* AirCCallingConvention.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AirCCallingConvention.cpp; path = b3/air/AirCCallingConvention.cpp; sourceTree = "<group>"; }; 2569 0F6183211C45BF070072450B /* AirCCallingConvention.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AirCCallingConvention.h; path = b3/air/AirCCallingConvention.h; sourceTree = "<group>"; }; 2570 0F6183221C45BF070072450B /* AirCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AirCustom.cpp; path = b3/air/AirCustom.cpp; sourceTree = "<group>"; }; 2571 0F6183231C45BF070072450B /* AirEmitShuffle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AirEmitShuffle.cpp; path = b3/air/AirEmitShuffle.cpp; sourceTree = "<group>"; }; 2572 0F6183241C45BF070072450B /* AirEmitShuffle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AirEmitShuffle.h; path = b3/air/AirEmitShuffle.h; sourceTree = "<group>"; }; 2573 0F6183251C45BF070072450B /* AirLowerAfterRegAlloc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AirLowerAfterRegAlloc.cpp; path = b3/air/AirLowerAfterRegAlloc.cpp; sourceTree = "<group>"; }; 2574 0F6183261C45BF070072450B /* AirLowerAfterRegAlloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AirLowerAfterRegAlloc.h; path = b3/air/AirLowerAfterRegAlloc.h; sourceTree = "<group>"; }; 2575 0F6183271C45BF070072450B /* AirLowerMacros.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AirLowerMacros.cpp; path = b3/air/AirLowerMacros.cpp; sourceTree = "<group>"; }; 2576 0F6183281C45BF070072450B /* AirLowerMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AirLowerMacros.h; path = b3/air/AirLowerMacros.h; sourceTree = "<group>"; }; 2577 0F6183321C45F35C0072450B /* AirOpcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AirOpcode.h; sourceTree = "<group>"; }; 2578 0F6183341C45F3B60072450B /* AirOpcodeGenerated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AirOpcodeGenerated.h; sourceTree = "<group>"; }; 2579 0F6183351C45F3B60072450B /* AirOpcodeUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AirOpcodeUtils.h; sourceTree = "<group>"; }; 2580 0F6183431C45F62A0072450B /* testair */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testair; sourceTree = BUILT_PRODUCTS_DIR; }; 2581 0F6183441C45F6600072450B /* testair.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testair.cpp; path = b3/air/testair.cpp; sourceTree = "<group>"; }; 2545 2582 0F62016F143FCD2F0068B77C /* DFGAbstractValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGAbstractValue.h; path = dfg/DFGAbstractValue.h; sourceTree = "<group>"; }; 2546 2583 0F620170143FCD2F0068B77C /* DFGBasicBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGBasicBlock.h; path = dfg/DFGBasicBlock.h; sourceTree = "<group>"; }; … … 3373 3410 7035587C1C418419004BD7BF /* MapPrototype.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = MapPrototype.js; sourceTree = "<group>"; }; 3374 3411 7035587D1C418419004BD7BF /* SetPrototype.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = SetPrototype.js; sourceTree = "<group>"; }; 3375 7035587E1C418458004BD7BF /* MapPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MapPrototype.lut.h;path = MapPrototype.lut.h; sourceTree = "<group>"; };3376 7035587F1C418458004BD7BF /* SetPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SetPrototype.lut.h;path = SetPrototype.lut.h; sourceTree = "<group>"; };3412 7035587E1C418458004BD7BF /* MapPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapPrototype.lut.h; sourceTree = "<group>"; }; 3413 7035587F1C418458004BD7BF /* SetPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SetPrototype.lut.h; sourceTree = "<group>"; }; 3377 3414 704FD35305697E6D003DBED9 /* BooleanObject.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = BooleanObject.h; sourceTree = "<group>"; tabWidth = 8; }; 3378 3415 705B41A31A6E501E00716757 /* Symbol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Symbol.cpp; sourceTree = "<group>"; }; … … 4308 4345 4309 4346 /* Begin PBXFrameworksBuildPhase section */ 4347 0F61833B1C45F62A0072450B /* Frameworks */ = { 4348 isa = PBXFrameworksBuildPhase; 4349 buildActionMask = 2147483647; 4350 files = ( 4351 0F61833C1C45F62A0072450B /* Foundation.framework in Frameworks */, 4352 0F61833D1C45F62A0072450B /* JavaScriptCore.framework in Frameworks */, 4353 ); 4354 runOnlyForDeploymentPostprocessing = 0; 4355 }; 4310 4356 0F9327511C20BCBA00CF6564 /* Frameworks */ = { 4311 4357 isa = PBXFrameworksBuildPhase; … … 4405 4451 6511230514046A4C002B101D /* testRegExp */, 4406 4452 0F9327591C20BCBA00CF6564 /* dynbench */, 4453 0F6183431C45F62A0072450B /* testair */, 4407 4454 ); 4408 4455 name = Products; … … 4795 4842 0FEC854D1BDACDC70080FF74 /* AirBasicBlock.h */, 4796 4843 0FB3878B1BFBC44D00E3AB1E /* AirBlockWorklist.h */, 4844 0F6183201C45BF070072450B /* AirCCallingConvention.cpp */, 4845 0F6183211C45BF070072450B /* AirCCallingConvention.h */, 4797 4846 0FEC854E1BDACDC70080FF74 /* AirCCallSpecial.cpp */, 4798 4847 0FEC854F1BDACDC70080FF74 /* AirCCallSpecial.h */, 4799 4848 0FEC85501BDACDC70080FF74 /* AirCode.cpp */, 4800 4849 0FEC85511BDACDC70080FF74 /* AirCode.h */, 4850 0F6183221C45BF070072450B /* AirCustom.cpp */, 4801 4851 0F10F1A21C420BF0001C07D2 /* AirCustom.h */, 4802 4852 0F4570361BE44C910062A629 /* AirEliminateDeadCode.cpp */, 4803 4853 0F4570371BE44C910062A629 /* AirEliminateDeadCode.h */, 4854 0F6183231C45BF070072450B /* AirEmitShuffle.cpp */, 4855 0F6183241C45BF070072450B /* AirEmitShuffle.h */, 4804 4856 262D85B41C0D650F006ACB61 /* AirFixPartialRegisterStalls.cpp */, 4805 4857 262D85B51C0D650F006ACB61 /* AirFixPartialRegisterStalls.h */, … … 4820 4872 26718BA31BE99F780052017B /* AirIteratedRegisterCoalescing.h */, 4821 4873 2684D4371C00161C0081D663 /* AirLiveness.h */, 4874 0F6183251C45BF070072450B /* AirLowerAfterRegAlloc.cpp */, 4875 0F6183261C45BF070072450B /* AirLowerAfterRegAlloc.h */, 4876 0F6183271C45BF070072450B /* AirLowerMacros.cpp */, 4877 0F6183281C45BF070072450B /* AirLowerMacros.h */, 4822 4878 264091FA1BE2FD4100684DB2 /* AirOpcode.opcodes */, 4823 4879 0FB3878C1BFBC44D00E3AB1E /* AirOptimizeBlockOrder.cpp */, … … 4845 4901 0FEC856B1BDACDC70080FF74 /* AirValidate.cpp */, 4846 4902 0FEC856C1BDACDC70080FF74 /* AirValidate.h */, 4903 0F6183441C45F6600072450B /* testair.cpp */, 4847 4904 ); 4848 4905 name = air; … … 5302 5359 isa = PBXGroup; 5303 5360 children = ( 5361 0F6183321C45F35C0072450B /* AirOpcode.h */, 5362 0F6183341C45F3B60072450B /* AirOpcodeGenerated.h */, 5363 0F6183351C45F3B60072450B /* AirOpcodeUtils.h */, 5304 5364 996B73151BDA05AA00331B84 /* ArrayConstructor.lut.h */, 5305 5365 996B73161BDA05AA00331B84 /* ArrayIteratorPrototype.lut.h */, … … 6902 6962 79CFC6F01C33B10000C768EA /* LLIntPCRanges.h in Headers */, 6903 6963 79D5CD5B1C1106A900CECA07 /* SamplingProfiler.h in Headers */, 6964 0F6183311C45BF070072450B /* AirLowerMacros.h in Headers */, 6904 6965 0FEC85771BDACDC70080FF74 /* AirFrequentedBlock.h in Headers */, 6905 6966 0FEC85791BDACDC70080FF74 /* AirGenerate.h in Headers */, … … 6964 7025 0FEC85C11BE167A00080FF74 /* B3Effects.h in Headers */, 6965 7026 0FEC85161BDACDAC0080FF74 /* B3FrequencyClass.h in Headers */, 7027 0F61832F1C45BF070072450B /* AirLowerAfterRegAlloc.h in Headers */, 6966 7028 0FEC85171BDACDAC0080FF74 /* B3FrequentedBlock.h in Headers */, 6967 7029 0FEC85191BDACDAC0080FF74 /* B3Generate.h in Headers */, … … 7157 7219 0F37308D1C0BD29100052BFA /* B3PhiChildren.h in Headers */, 7158 7220 A77A424217A0BBFD00A8DB81 /* DFGClobberSet.h in Headers */, 7221 0F61832D1C45BF070072450B /* AirEmitShuffle.h in Headers */, 7159 7222 0F3C1F1B1B868E7900ABB08B /* DFGClobbersExitState.h in Headers */, 7160 7223 0F04396E1B03DC0B009598B7 /* DFGCombinedLiveness.h in Headers */, … … 7240 7303 A7D89CFE17A0B8CC00773AD8 /* DFGOSRAvailabilityAnalysisPhase.h in Headers */, 7241 7304 0FD82E57141DAF1000179C94 /* DFGOSREntry.h in Headers */, 7305 0F40E4A71C497F7400A577FA /* AirOpcode.h in Headers */, 7242 7306 0FD8A32617D51F5700CA2C40 /* DFGOSREntrypointCreationPhase.h in Headers */, 7243 7307 0FC0976A1468A6F700CF2442 /* DFGOSRExit.h in Headers */, … … 7248 7312 0F392C8A1B46188400844728 /* DFGOSRExitFuzz.h in Headers */, 7249 7313 0FEFC9AB1681A3B600567F53 /* DFGOSRExitJumpPlaceholder.h in Headers */, 7314 0F40E4A81C497F7400A577FA /* AirOpcodeGenerated.h in Headers */, 7250 7315 0F235BEE17178E7300690C7F /* DFGOSRExitPreparation.h in Headers */, 7251 7316 0F6237981AE45CA700D402EA /* DFGPhantomInsertionPhase.h in Headers */, … … 7631 7696 A76C51761182748D00715B05 /* JSInterfaceJIT.h in Headers */, 7632 7697 E33F50811B8429A400413856 /* JSInternalPromise.h in Headers */, 7698 0F61832A1C45BF070072450B /* AirCCallingConvention.h in Headers */, 7633 7699 E33F50791B84225700413856 /* JSInternalPromiseConstructor.h in Headers */, 7634 7700 E33F50871B8449EF00413856 /* JSInternalPromiseConstructor.lut.h in Headers */, … … 7661 7727 996B731F1BDA08EF00331B84 /* JSPromisePrototype.lut.h in Headers */, 7662 7728 2A05ABD61961DF2400341750 /* JSPropertyNameEnumerator.h in Headers */, 7729 0F40E4A91C497F7400A577FA /* AirOpcodeUtils.h in Headers */, 7663 7730 E3EF88751B66DF23003F26CB /* JSPropertyNameIterator.h in Headers */, 7664 7731 862553D216136E1A009F17D0 /* JSProxy.h in Headers */, … … 8053 8120 8054 8121 /* Begin PBXNativeTarget section */ 8122 0F6183381C45F62A0072450B /* testair */ = { 8123 isa = PBXNativeTarget; 8124 buildConfigurationList = 0F61833E1C45F62A0072450B /* Build configuration list for PBXNativeTarget "testair" */; 8125 buildPhases = ( 8126 0F6183391C45F62A0072450B /* Sources */, 8127 0F61833B1C45F62A0072450B /* Frameworks */, 8128 ); 8129 buildRules = ( 8130 ); 8131 dependencies = ( 8132 ); 8133 name = testair; 8134 productName = testapi; 8135 productReference = 0F6183431C45F62A0072450B /* testair */; 8136 productType = "com.apple.product-type.tool"; 8137 }; 8055 8138 0F93274E1C20BCBA00CF6564 /* dynbench */ = { 8056 8139 isa = PBXNativeTarget; … … 8260 8343 5D6B2A47152B9E17005231DE /* Test Tools */, 8261 8344 0F93274E1C20BCBA00CF6564 /* dynbench */, 8345 0F6183381C45F62A0072450B /* testair */, 8262 8346 ); 8263 8347 }; … … 8496 8580 8497 8581 /* Begin PBXSourcesBuildPhase section */ 8582 0F6183391C45F62A0072450B /* Sources */ = { 8583 isa = PBXSourcesBuildPhase; 8584 buildActionMask = 2147483647; 8585 files = ( 8586 0F6183451C45F6600072450B /* testair.cpp in Sources */, 8587 ); 8588 runOnlyForDeploymentPostprocessing = 0; 8589 }; 8498 8590 0F93274F1C20BCBA00CF6564 /* Sources */ = { 8499 8591 isa = PBXSourcesBuildPhase; … … 8700 8792 0FBADF541BD1F4B800E073C1 /* CopiedBlock.cpp in Sources */, 8701 8793 C240305514B404E60079EB64 /* CopiedSpace.cpp in Sources */, 8794 0F6183301C45BF070072450B /* AirLowerMacros.cpp in Sources */, 8702 8795 C2239D1716262BDD005AC5FD /* CopyVisitor.cpp in Sources */, 8703 8796 2A111245192FCE79005EE18D /* CustomGetterSetter.cpp in Sources */, … … 8748 8841 0FBE0F7216C1DB030082C5E8 /* DFGCPSRethreadingPhase.cpp in Sources */, 8749 8842 A7D89CF517A0B8CC00773AD8 /* DFGCriticalEdgeBreakingPhase.cpp in Sources */, 8843 0F6183291C45BF070072450B /* AirCCallingConvention.cpp in Sources */, 8750 8844 0FFFC95914EF90A600C72532 /* DFGCSEPhase.cpp in Sources */, 8751 8845 0F2FC77216E12F710038D976 /* DFGDCEPhase.cpp in Sources */, … … 8764 8858 A78A9776179738B8009DF744 /* DFGFinalizer.cpp in Sources */, 8765 8859 0F2BDC15151C5D4D00CD8910 /* DFGFixupPhase.cpp in Sources */, 8860 0F61832C1C45BF070072450B /* AirEmitShuffle.cpp in Sources */, 8766 8861 0F9D339617FFC4E60073C2BC /* DFGFlushedAt.cpp in Sources */, 8767 8862 A7D89CF717A0B8CC00773AD8 /* DFGFlushFormat.cpp in Sources */, … … 9075 9170 E33F50741B8421C000413856 /* JSInternalPromisePrototype.cpp in Sources */, 9076 9171 A503FA1B188E0FB000110F14 /* JSJavaScriptCallFrame.cpp in Sources */, 9172 0F61832E1C45BF070072450B /* AirLowerAfterRegAlloc.cpp in Sources */, 9077 9173 A503FA1D188E0FB000110F14 /* JSJavaScriptCallFramePrototype.cpp in Sources */, 9078 9174 7013CA8B1B491A9400CAE613 /* JSJob.cpp in Sources */, … … 9217 9313 0FB1058B1675483100F8AB6E /* ProfilerOSRExit.cpp in Sources */, 9218 9314 0FB1058D1675483700F8AB6E /* ProfilerOSRExitSite.cpp in Sources */, 9315 0F61832B1C45BF070072450B /* AirCustom.cpp in Sources */, 9219 9316 0F13912B16771C3A009CCB07 /* ProfilerProfiledBytecodes.cpp in Sources */, 9220 9317 0FD3E40D1B618B6600C80E1E /* PropertyCondition.cpp in Sources */, … … 9369 9466 9370 9467 /* Begin PBXTargetDependency section */ 9468 0F6183471C45F67A0072450B /* PBXTargetDependency */ = { 9469 isa = PBXTargetDependency; 9470 target = 0F6183381C45F62A0072450B /* testair */; 9471 targetProxy = 0F6183461C45F67A0072450B /* PBXContainerItemProxy */; 9472 }; 9371 9473 0F93275D1C20BF3A00CF6564 /* PBXTargetDependency */ = { 9372 9474 isa = PBXTargetDependency; … … 9477 9579 buildSettings = { 9478 9580 PRODUCT_NAME = "Derived Sources copy"; 9581 }; 9582 name = Production; 9583 }; 9584 0F61833F1C45F62A0072450B /* Debug */ = { 9585 isa = XCBuildConfiguration; 9586 baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; 9587 buildSettings = { 9588 CODE_SIGN_ENTITLEMENTS_ios_testair = entitlements.plist; 9589 PRODUCT_NAME = testair; 9590 }; 9591 name = Debug; 9592 }; 9593 0F6183401C45F62A0072450B /* Release */ = { 9594 isa = XCBuildConfiguration; 9595 baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; 9596 buildSettings = { 9597 CODE_SIGN_ENTITLEMENTS_ios_testair = entitlements.plist; 9598 PRODUCT_NAME = testair; 9599 }; 9600 name = Release; 9601 }; 9602 0F6183411C45F62A0072450B /* Profiling */ = { 9603 isa = XCBuildConfiguration; 9604 baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; 9605 buildSettings = { 9606 CODE_SIGN_ENTITLEMENTS_ios_testair = entitlements.plist; 9607 PRODUCT_NAME = testair; 9608 }; 9609 name = Profiling; 9610 }; 9611 0F6183421C45F62A0072450B /* Production */ = { 9612 isa = XCBuildConfiguration; 9613 baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */; 9614 buildSettings = { 9615 CODE_SIGN_ENTITLEMENTS_ios_testair = entitlements.plist; 9616 PRODUCT_NAME = testair; 9479 9617 }; 9480 9618 name = Production; … … 9909 10047 defaultConfigurationName = Production; 9910 10048 }; 10049 0F61833E1C45F62A0072450B /* Build configuration list for PBXNativeTarget "testair" */ = { 10050 isa = XCConfigurationList; 10051 buildConfigurations = ( 10052 0F61833F1C45F62A0072450B /* Debug */, 10053 0F6183401C45F62A0072450B /* Release */, 10054 0F6183411C45F62A0072450B /* Profiling */, 10055 0F6183421C45F62A0072450B /* Production */, 10056 ); 10057 defaultConfigurationIsVisible = 0; 10058 defaultConfigurationName = Production; 10059 }; 9911 10060 0F9327541C20BCBA00CF6564 /* Build configuration list for PBXNativeTarget "dynbench" */ = { 9912 10061 isa = XCConfigurationList; -
trunk/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h
r195133 r195139 1 1 /* 2 * Copyright (C) 2008, 2012, 2014 , 2015Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2012, 2014-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 77 77 } 78 78 79 inline bool isIOS() 80 { 81 #if PLATFORM(IOS) 82 return true; 83 #else 84 return false; 85 #endif 86 } 87 79 88 inline bool optimizeForARMv7IDIVSupported() 80 89 { -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h
r195133 r195139 1411 1411 } 1412 1412 #endif 1413 1414 void swap32(RegisterID src, RegisterID dest) 1415 { 1416 m_assembler.xchgl_rr(src, dest); 1417 } 1418 1419 void swap32(RegisterID src, Address dest) 1420 { 1421 m_assembler.xchgl_rm(src, dest.offset, dest.base); 1422 } 1413 1423 1414 1424 void moveConditionally32(RelationalCondition cond, RegisterID left, RegisterID right, RegisterID src, RegisterID dest) -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h
r195133 r195139 1 1 /* 2 * Copyright (C) 2008, 2012, 2014 , 2015Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2012, 2014-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 656 656 } 657 657 658 void swap64(RegisterID src, RegisterID dest) 659 { 660 m_assembler.xchgq_rr(src, dest); 661 } 662 663 void swap64(RegisterID src, Address dest) 664 { 665 m_assembler.xchgq_rm(src, dest.offset, dest.base); 666 } 667 658 668 void move64ToDouble(RegisterID src, FPRegisterID dest) 659 669 { -
trunk/Source/JavaScriptCore/assembler/X86Assembler.h
r195133 r195139 1 1 /* 2 * Copyright (C) 2008, 2012-201 5Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2012-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1432 1432 } 1433 1433 1434 void xchgl_rm(RegisterID src, int offset, RegisterID base) 1435 { 1436 m_formatter.oneByteOp(OP_XCHG_EvGv, src, base, offset); 1437 } 1438 1434 1439 #if CPU(X86_64) 1435 1440 void xchgq_rr(RegisterID src, RegisterID dst) … … 1441 1446 else 1442 1447 m_formatter.oneByteOp64(OP_XCHG_EvGv, src, dst); 1448 } 1449 1450 void xchgq_rm(RegisterID src, int offset, RegisterID base) 1451 { 1452 m_formatter.oneByteOp64(OP_XCHG_EvGv, src, base, offset); 1443 1453 } 1444 1454 #endif -
trunk/Source/JavaScriptCore/b3/B3CCallValue.h
r195133 r195139 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 40 40 ~CCallValue(); 41 41 42 Effects effects ;42 Effects effects { Effects::forCall() }; 43 43 44 44 private: … … 48 48 CCallValue(unsigned index, Type type, Origin origin, Arguments... arguments) 49 49 : Value(index, CheckedOpcode, CCall, type, origin, arguments...) 50 , effects(Effects::forCall())51 50 { 52 51 RELEASE_ASSERT(numChildren() >= 1); -
trunk/Source/JavaScriptCore/b3/B3Compilation.cpp
r195133 r195139 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 53 53 } 54 54 55 Compilation::Compilation(MacroAssemblerCodeRef codeRef, std::unique_ptr<OpaqueByproducts> byproducts) 56 : m_codeRef(codeRef) 57 , m_byproducts(WTFMove(byproducts)) 58 { 59 } 60 55 61 Compilation::~Compilation() 56 62 { -
trunk/Source/JavaScriptCore/b3/B3Compilation.h
r195133 r195139 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 56 56 public: 57 57 JS_EXPORT_PRIVATE Compilation(VM&, Procedure&, unsigned optLevel = 1); 58 59 // This constructor allows you to manually create a Compilation. It's currently only used by test 60 // code. Probably best to keep it that way. 61 JS_EXPORT_PRIVATE Compilation(MacroAssemblerCodeRef, std::unique_ptr<OpaqueByproducts>); 62 58 63 JS_EXPORT_PRIVATE ~Compilation(); 59 64 -
trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp
r195133 r195139 36 36 #include "B3ArgumentRegValue.h" 37 37 #include "B3BasicBlockInlines.h" 38 #include "B3BlockWorklist.h" 38 39 #include "B3CCallValue.h" 39 40 #include "B3CheckSpecial.h" … … 100 101 } 101 102 103 // Figure out which blocks are not rare. 104 m_fastWorklist.push(m_procedure[0]); 105 while (B3::BasicBlock* block = m_fastWorklist.pop()) { 106 for (B3::FrequentedBlock& successor : block->successors()) { 107 if (!successor.isRare()) 108 m_fastWorklist.push(successor.block()); 109 } 110 } 111 102 112 m_procedure.resetValueOwners(); // Used by crossesInterference(). 103 113 … … 108 118 // Reset some state. 109 119 m_insts.resize(0); 120 121 m_isRare = !m_fastWorklist.saw(block); 110 122 111 123 if (verbose) … … 1553 1565 } 1554 1566 1555 template<typename BankInfo>1556 Arg marshallCCallArgument(unsigned& argumentCount, unsigned& stackOffset, Value* child)1557 {1558 unsigned argumentIndex = argumentCount++;1559 if (argumentIndex < BankInfo::numberOfArgumentRegisters) {1560 Tmp result = Tmp(BankInfo::toArgumentRegister(argumentIndex));1561 append(relaxedMoveForType(child->type()), immOrTmp(child), result);1562 return result;1563 }1564 1565 #if CPU(ARM64) && PLATFORM(IOS)1566 // iOS does not follow the ARM64 ABI regarding function calls.1567 // Arguments must be packed.1568 unsigned slotSize = sizeofType(child->type());1569 stackOffset = WTF::roundUpToMultipleOf(slotSize, stackOffset);1570 #else1571 unsigned slotSize = sizeof(void*);1572 #endif1573 Arg result = Arg::callArg(stackOffset);1574 stackOffset += slotSize;1575 1576 // Put the code for storing the argument before anything else. This significantly eases the1577 // burden on the register allocator. If we could, we'd hoist these stores as far as1578 // possible.1579 // FIXME: Add a phase to hoist stores as high as possible to relieve register pressure.1580 // https://bugs.webkit.org/show_bug.cgi?id=1510631581 m_insts.last().insert(0, createStore(child, result));1582 1583 return result;1584 }1585 1586 1567 void lower() 1587 1568 { … … 1935 1916 } 1936 1917 1937 case CCall: {1918 case B3::CCall: { 1938 1919 CCallValue* cCall = m_value->as<CCallValue>(); 1939 Inst inst(Patch, cCall, Arg::special(m_code.cCallSpecial())); 1940 1941 // This is a bit weird - we have a super intense contract with Arg::CCallSpecial. It might 1942 // be better if we factored Air::CCallSpecial out of the Air namespace and made it a B3 1943 // thing. 1944 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=151045 1920 1921 Inst inst(m_isRare ? Air::ColdCCall : Air::CCall, cCall); 1945 1922 1946 1923 // We have a ton of flexibility regarding the callee argument, but currently, we don't … … 1955 1932 inst.args.append(tmp(cCall->child(0))); 1956 1933 1957 // We need to tell Air what registers this defines. 1958 inst.args.append(Tmp(GPRInfo::returnValueGPR)); 1959 inst.args.append(Tmp(GPRInfo::returnValueGPR2)); 1960 inst.args.append(Tmp(FPRInfo::returnValueFPR)); 1961 1962 // Now marshall the arguments. This is where we implement the C calling convention. After 1963 // this, Air does not know what the convention is; it just takes our word for it. 1964 unsigned gpArgumentCount = 0; 1965 unsigned fpArgumentCount = 0; 1966 unsigned stackOffset = 0; 1967 for (unsigned i = 1; i < cCall->numChildren(); ++i) { 1968 Value* argChild = cCall->child(i); 1969 Arg arg; 1970 1971 switch (Arg::typeForB3Type(argChild->type())) { 1972 case Arg::GP: 1973 arg = marshallCCallArgument<GPRInfo>(gpArgumentCount, stackOffset, argChild); 1974 break; 1975 1976 case Arg::FP: 1977 arg = marshallCCallArgument<FPRInfo>(fpArgumentCount, stackOffset, argChild); 1978 break; 1979 } 1980 1981 if (arg.isTmp()) 1982 inst.args.append(arg); 1983 } 1984 1934 if (cCall->type() != Void) 1935 inst.args.append(tmp(cCall)); 1936 1937 for (unsigned i = 1; i < cCall->numChildren(); ++i) 1938 inst.args.append(immOrTmp(cCall->child(i))); 1939 1985 1940 m_insts.last().append(WTFMove(inst)); 1986 1987 switch (cCall->type()) {1988 case Void:1989 break;1990 case Int32:1991 case Int64:1992 append(Move, Tmp(GPRInfo::returnValueGPR), tmp(cCall));1993 break;1994 case Float:1995 case Double:1996 append(MoveDouble, Tmp(FPRInfo::returnValueFPR), tmp(cCall));1997 break;1998 }1999 1941 return; 2000 1942 } … … 2288 2230 UseCounts m_useCounts; 2289 2231 PhiChildren m_phiChildren; 2232 BlockWorklist m_fastWorklist; 2290 2233 2291 2234 Vector<Vector<Inst, 4>> m_insts; … … 2293 2236 2294 2237 B3::BasicBlock* m_block; 2238 bool m_isRare; 2295 2239 unsigned m_index; 2296 2240 Value* m_value; -
trunk/Source/JavaScriptCore/b3/B3OpaqueByproducts.h
r195133 r195139 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 40 40 public: 41 41 OpaqueByproducts(); 42 ~OpaqueByproducts();42 JS_EXPORT_PRIVATE ~OpaqueByproducts(); 43 43 44 44 size_t count() const { return m_byproducts.size(); } -
trunk/Source/JavaScriptCore/b3/B3StackmapSpecial.cpp
r195133 r195139 201 201 case Arg::Imm: 202 202 case Arg::Imm64: 203 case Arg::Stack: 204 case Arg::CallArg: 205 break; // OK 206 case Arg::Addr: 207 if (arg.base() != Tmp(GPRInfo::callFrameRegister) 208 && arg.base() != Tmp(MacroAssembler::stackPointerRegister)) 203 break; 204 default: 205 if (!arg.isStackMemory()) 209 206 return false; 210 207 break; 211 default: 212 return false; 213 } 214 215 Arg::Type type = Arg::typeForB3Type(value->type()); 216 217 return arg.isType(type); 208 } 209 210 return arg.canRepresent(value); 218 211 } 219 212 -
trunk/Source/JavaScriptCore/b3/air/AirArg.cpp
r195133 r195139 31 31 #include "AirSpecial.h" 32 32 #include "AirStackSlot.h" 33 #include "B3Value.h" 34 #include "FPRInfo.h" 35 #include "GPRInfo.h" 33 36 34 37 #if COMPILER(GCC) && ASSERT_DISABLED … … 38 41 39 42 namespace JSC { namespace B3 { namespace Air { 43 44 bool Arg::isStackMemory() const 45 { 46 switch (kind()) { 47 case Addr: 48 return base() == Air::Tmp(GPRInfo::callFrameRegister) 49 || base() == Air::Tmp(MacroAssembler::stackPointerRegister); 50 case Stack: 51 case CallArg: 52 return true; 53 default: 54 return false; 55 } 56 } 40 57 41 58 bool Arg::isRepresentableAs(Width width, Signedness signedness) const … … 68 85 } 69 86 87 bool Arg::usesTmp(Air::Tmp tmp) const 88 { 89 bool uses = false; 90 const_cast<Arg*>(this)->forEachTmpFast( 91 [&] (Air::Tmp otherTmp) { 92 if (otherTmp == tmp) 93 uses = true; 94 }); 95 return uses; 96 } 97 98 bool Arg::canRepresent(Value* value) const 99 { 100 return isType(typeForB3Type(value->type())); 101 } 102 103 bool Arg::isCompatibleType(const Arg& other) const 104 { 105 if (hasType()) 106 return other.isType(type()); 107 if (other.hasType()) 108 return isType(other.type()); 109 return true; 110 } 111 70 112 void Arg::dump(PrintStream& out) const 71 113 { … … 118 160 out.print(pointerDump(special())); 119 161 return; 162 case WidthArg: 163 out.print(width()); 164 return; 120 165 } 121 166 … … 168 213 out.print("Special"); 169 214 return; 215 case Arg::WidthArg: 216 out.print("WidthArg"); 217 return; 170 218 } 171 219 … … 232 280 switch (width) { 233 281 case Arg::Width8: 234 out.print(" Width8");282 out.print("8"); 235 283 return; 236 284 case Arg::Width16: 237 out.print(" Width16");285 out.print("16"); 238 286 return; 239 287 case Arg::Width32: 240 out.print(" Width32");288 out.print("32"); 241 289 return; 242 290 case Arg::Width64: 243 out.print(" Width64");291 out.print("64"); 244 292 return; 245 293 } -
trunk/Source/JavaScriptCore/b3/air/AirArg.h
r195133 r195139 39 39 #endif // COMPILER(GCC) && ASSERT_DISABLED 40 40 41 namespace JSC { namespace B3 { namespace Air { 41 namespace JSC { namespace B3 { 42 43 class Value; 44 45 namespace Air { 42 46 43 47 class Special; … … 75 79 ResCond, 76 80 DoubleCond, 77 Special 81 Special, 82 WidthArg 78 83 }; 79 84 … … 162 167 static const unsigned numTypes = 2; 163 168 169 template<typename Functor> 170 static void forEachType(const Functor& functor) 171 { 172 functor(GP); 173 functor(FP); 174 } 175 164 176 enum Width : int8_t { 165 177 Width8, … … 226 238 { 227 239 return isAnyUse(role) && !isColdUse(role); 240 } 241 242 static Role cooled(Role role) 243 { 244 switch (role) { 245 case ColdUse: 246 case LateColdUse: 247 case UseDef: 248 case UseZDef: 249 case Def: 250 case ZDef: 251 case UseAddr: 252 case Scratch: 253 case EarlyDef: 254 return role; 255 case Use: 256 return ColdUse; 257 case LateUse: 258 return LateColdUse; 259 } 228 260 } 229 261 … … 448 480 result.m_offset = value; 449 481 return result; 482 } 483 484 static Arg immPtr(const void* address) 485 { 486 return imm64(bitwise_cast<intptr_t>(address)); 450 487 } 451 488 … … 564 601 } 565 602 603 static Arg widthArg(Width width) 604 { 605 Arg result; 606 result.m_kind = WidthArg; 607 result.m_offset = width; 608 return result; 609 } 610 566 611 bool operator==(const Arg& other) const 567 612 { … … 600 645 } 601 646 647 bool isSomeImm() const 648 { 649 return isImm() || isImm64(); 650 } 651 602 652 bool isAddr() const 603 653 { … … 620 670 } 621 671 622 bool isRelCond() const 623 { 624 return kind() == RelCond; 625 } 626 627 bool isResCond() const 628 { 629 return kind() == ResCond; 630 } 631 632 bool isDoubleCond() const 633 { 634 return kind() == DoubleCond; 635 } 636 637 bool isCondition() const 638 { 639 switch (kind()) { 640 case RelCond: 641 case ResCond: 642 case DoubleCond: 643 return true; 644 default: 645 return false; 646 } 647 } 648 649 bool isSpecial() const 650 { 651 return kind() == Special; 652 } 653 654 bool isAlive() const 655 { 656 return isTmp() || isStack(); 657 } 658 659 Air::Tmp tmp() const 660 { 661 ASSERT(kind() == Tmp); 662 return m_base; 663 } 664 665 int64_t value() const 666 { 667 ASSERT(kind() == Imm || kind() == Imm64); 668 return m_offset; 669 } 670 671 template<typename T> 672 bool isRepresentableAs() const 673 { 674 return B3::isRepresentableAs<T>(value()); 675 } 676 677 bool isRepresentableAs(Width, Signedness) const; 678 679 template<typename T> 680 T asNumber() const 681 { 682 return static_cast<T>(value()); 683 } 684 685 void* pointerValue() const 686 { 687 ASSERT(kind() == Imm64); 688 return bitwise_cast<void*>(static_cast<intptr_t>(m_offset)); 689 } 690 691 Air::Tmp base() const 692 { 693 ASSERT(kind() == Addr || kind() == Index); 694 return m_base; 695 } 696 697 bool hasOffset() const 672 bool isMemory() const 698 673 { 699 674 switch (kind()) { … … 707 682 } 708 683 } 684 685 bool isStackMemory() const; 686 687 bool isRelCond() const 688 { 689 return kind() == RelCond; 690 } 691 692 bool isResCond() const 693 { 694 return kind() == ResCond; 695 } 696 697 bool isDoubleCond() const 698 { 699 return kind() == DoubleCond; 700 } 701 702 bool isCondition() const 703 { 704 switch (kind()) { 705 case RelCond: 706 case ResCond: 707 case DoubleCond: 708 return true; 709 default: 710 return false; 711 } 712 } 713 714 bool isSpecial() const 715 { 716 return kind() == Special; 717 } 718 719 bool isWidthArg() const 720 { 721 return kind() == WidthArg; 722 } 723 724 bool isAlive() const 725 { 726 return isTmp() || isStack(); 727 } 728 729 Air::Tmp tmp() const 730 { 731 ASSERT(kind() == Tmp); 732 return m_base; 733 } 734 735 int64_t value() const 736 { 737 ASSERT(kind() == Imm || kind() == Imm64); 738 return m_offset; 739 } 740 741 template<typename T> 742 bool isRepresentableAs() const 743 { 744 return B3::isRepresentableAs<T>(value()); 745 } 746 747 bool isRepresentableAs(Width, Signedness) const; 748 749 template<typename T> 750 T asNumber() const 751 { 752 return static_cast<T>(value()); 753 } 754 755 void* pointerValue() const 756 { 757 ASSERT(kind() == Imm64); 758 return bitwise_cast<void*>(static_cast<intptr_t>(m_offset)); 759 } 760 761 Air::Tmp base() const 762 { 763 ASSERT(kind() == Addr || kind() == Index); 764 return m_base; 765 } 766 767 bool hasOffset() const { return isMemory(); } 709 768 710 769 int32_t offset() const … … 743 802 ASSERT(kind() == Special); 744 803 return bitwise_cast<Air::Special*>(m_offset); 804 } 805 806 Width width() const 807 { 808 ASSERT(kind() == WidthArg); 809 return static_cast<Width>(m_offset); 745 810 } 746 811 … … 769 834 case DoubleCond: 770 835 case Special: 836 case WidthArg: 771 837 return true; 772 838 case Tmp: … … 787 853 case DoubleCond: 788 854 case Special: 855 case WidthArg: 789 856 case Invalid: 790 857 return false; … … 829 896 ASSERT_NOT_REACHED(); 830 897 } 898 899 bool canRepresent(Value* value) const; 900 901 bool isCompatibleType(const Arg& other) const; 831 902 832 903 bool isGPR() const … … 971 1042 case DoubleCond: 972 1043 case Special: 1044 case WidthArg: 973 1045 return true; 974 1046 } … … 992 1064 } 993 1065 } 1066 1067 bool usesTmp(Air::Tmp tmp) const; 994 1068 995 1069 // This is smart enough to know that an address arg in a Def or UseDef rule will use its -
trunk/Source/JavaScriptCore/b3/air/AirBasicBlock.h
r195133 r195139 79 79 80 80 template<typename Inst> 81 voidappendInst(Inst&& inst)81 Inst& appendInst(Inst&& inst) 82 82 { 83 83 m_insts.append(std::forward<Inst>(inst)); 84 return m_insts.last(); 84 85 } 85 86 86 87 template<typename... Arguments> 87 voidappend(Arguments&&... arguments)88 Inst& append(Arguments&&... arguments) 88 89 { 89 90 m_insts.append(Inst(std::forward<Arguments>(arguments)...)); 91 return m_insts.last(); 90 92 } 91 93 -
trunk/Source/JavaScriptCore/b3/air/AirCode.h
r195133 r195139 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 61 61 Procedure& proc() { return m_proc; } 62 62 63 BasicBlock* addBlock(double frequency = 1);63 JS_EXPORT_PRIVATE BasicBlock* addBlock(double frequency = 1); 64 64 65 65 // Note that you can rely on stack slots always getting indices that are larger than the index 66 66 // of any prior stack slot. In fact, all stack slots you create in the future will have an index 67 67 // that is >= stackSlots().size(). 68 StackSlot* addStackSlot(unsigned byteSize, StackSlotKind, StackSlotValue* = nullptr); 68 JS_EXPORT_PRIVATE StackSlot* addStackSlot( 69 unsigned byteSize, StackSlotKind, StackSlotValue* = nullptr); 69 70 StackSlot* addStackSlot(StackSlotValue*); 70 71 -
trunk/Source/JavaScriptCore/b3/air/AirCustom.h
r195133 r195139 31 31 #include "AirInst.h" 32 32 #include "AirSpecial.h" 33 #include "B3Value.h" 33 34 34 35 namespace JSC { namespace B3 { namespace Air { … … 52 53 // always have access to Code& even in methods that don't take a GenerationContext. 53 54 55 // Definition of Patch instruction. Patch is used to delegate the behavior of the instruction to the 56 // Special object, which will be the first argument to the instruction. 54 57 struct PatchCustom { 55 58 template<typename Functor> … … 97 100 }; 98 101 102 // Definition of CCall instruction. CCall is used for hot path C function calls. It's lowered to a 103 // Patch with an Air CCallSpecial along with code to marshal instructions. The lowering happens 104 // before register allocation, so that the register allocator sees the clobbers. 105 struct CCallCustom { 106 template<typename Functor> 107 static void forEachArg(Inst& inst, const Functor& functor) 108 { 109 Value* value = inst.origin; 110 111 unsigned index = 0; 112 113 functor(inst.args[index++], Arg::Use, Arg::GP, Arg::pointerWidth()); // callee 114 115 if (value->type() != Void) { 116 functor( 117 inst.args[index++], Arg::Def, 118 Arg::typeForB3Type(value->type()), 119 Arg::widthForB3Type(value->type())); 120 } 121 122 for (unsigned i = 1; i < value->numChildren(); ++i) { 123 Value* child = value->child(i); 124 functor( 125 inst.args[index++], Arg::Use, 126 Arg::typeForB3Type(child->type()), 127 Arg::widthForB3Type(child->type())); 128 } 129 } 130 131 template<typename... Arguments> 132 static bool isValidFormStatic(Arguments...) 133 { 134 return false; 135 } 136 137 static bool isValidForm(Inst&); 138 139 static bool admitsStack(Inst&, unsigned) 140 { 141 return true; 142 } 143 144 static bool hasNonArgNonControlEffects(Inst&) 145 { 146 return true; 147 } 148 149 // This just crashes, since we expect C calls to be lowered before generation. 150 static CCallHelpers::Jump generate(Inst&, CCallHelpers&, GenerationContext&); 151 }; 152 153 struct ColdCCallCustom : CCallCustom { 154 template<typename Functor> 155 static void forEachArg(Inst& inst, const Functor& functor) 156 { 157 // This is just like a call, but uses become cold. 158 CCallCustom::forEachArg( 159 inst, 160 [&] (Arg& arg, Arg::Role role, Arg::Type type, Arg::Width width) { 161 functor(arg, Arg::cooled(role), type, width); 162 }); 163 } 164 }; 165 166 struct ShuffleCustom { 167 template<typename Functor> 168 static void forEachArg(Inst& inst, const Functor& functor) 169 { 170 unsigned limit = inst.args.size() / 3 * 3; 171 for (unsigned i = 0; i < limit; i += 3) { 172 Arg& src = inst.args[i + 0]; 173 Arg& dst = inst.args[i + 1]; 174 Arg& widthArg = inst.args[i + 2]; 175 Arg::Width width = widthArg.width(); 176 Arg::Type type = src.isGP() && dst.isGP() ? Arg::GP : Arg::FP; 177 functor(src, Arg::Use, type, width); 178 functor(dst, Arg::Def, type, width); 179 functor(widthArg, Arg::Use, Arg::GP, Arg::Width8); 180 } 181 } 182 183 template<typename... Arguments> 184 static bool isValidFormStatic(Arguments...) 185 { 186 return false; 187 } 188 189 static bool isValidForm(Inst&); 190 191 static bool admitsStack(Inst&, unsigned index) 192 { 193 switch (index % 3) { 194 case 0: 195 case 1: 196 return true; 197 default: 198 return false; 199 } 200 } 201 202 static bool hasNonArgNonControlEffects(Inst&) 203 { 204 return false; 205 } 206 207 static CCallHelpers::Jump generate(Inst&, CCallHelpers&, GenerationContext&); 208 }; 209 99 210 } } } // namespace JSC::B3::Air 100 211 -
trunk/Source/JavaScriptCore/b3/air/AirGenerate.cpp
r195133 r195139 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 36 36 #include "AirHandleCalleeSaves.h" 37 37 #include "AirIteratedRegisterCoalescing.h" 38 #include "AirLowerAfterRegAlloc.h" 39 #include "AirLowerMacros.h" 38 40 #include "AirOpcodeUtils.h" 39 41 #include "AirOptimizeBlockOrder.h" … … 66 68 } 67 69 70 lowerMacros(code); 71 68 72 // This is where we run our optimizations and transformations. 69 73 // FIXME: Add Air optimizations. … … 80 84 else 81 85 iteratedRegisterCoalescing(code); 86 87 lowerAfterRegAlloc(code); 82 88 83 89 // Prior to this point the prologue and epilogue is implicit. This makes it explicit. It also -
trunk/Source/JavaScriptCore/b3/air/AirGenerate.h
r195133 r195139 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 39 39 // This takes an Air::Code that hasn't had any stack allocation and optionally hasn't had any 40 40 // register allocation and does both of those things. 41 void prepareForGeneration(Code&);41 JS_EXPORT_PRIVATE void prepareForGeneration(Code&); 42 42 43 43 // This generates the code using the given CCallHelpers instance. Note that this may call callbacks 44 44 // in the supplied code as it is generating. 45 void generate(Code&, CCallHelpers&);45 JS_EXPORT_PRIVATE void generate(Code&, CCallHelpers&); 46 46 47 47 } } } // namespace JSC::B3::Air -
trunk/Source/JavaScriptCore/b3/air/AirInsertionSet.cpp
r195133 r195139 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 34 34 namespace JSC { namespace B3 { namespace Air { 35 35 36 void InsertionSet::insertInsts(size_t index, const Vector<Inst>& insts) 37 { 38 for (const Inst& inst : insts) 39 insertInst(index, inst); 40 } 41 42 void InsertionSet::insertInsts(size_t index, Vector<Inst>&& insts) 43 { 44 for (Inst& inst : insts) 45 insertInst(index, WTFMove(inst)); 46 } 47 36 48 void InsertionSet::execute(BasicBlock* block) 37 49 { -
trunk/Source/JavaScriptCore/b3/air/AirInsertionSet.h
r195133 r195139 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 60 60 appendInsertion(Insertion(index, std::forward<Inst>(inst))); 61 61 } 62 63 void insertInsts(size_t index, const Vector<Inst>&); 64 void insertInsts(size_t index, Vector<Inst>&&); 62 65 63 66 template<typename... Arguments> -
trunk/Source/JavaScriptCore/b3/air/AirInst.h
r195133 r195139 85 85 86 86 explicit operator bool() const { return origin || opcode != Nop || args.size(); } 87 88 void append() { } 89 90 template<typename... Arguments> 91 void append(Arg arg, Arguments... arguments) 92 { 93 args.append(arg); 94 append(arguments...); 95 } 87 96 88 97 // Note that these functors all avoid using "const" because we want to use them for things that -
trunk/Source/JavaScriptCore/b3/air/AirOpcode.opcodes
r195133 r195139 418 418 x86: Imm, Addr as storePtr 419 419 420 x86: Swap32 UD:G:32, UD:G:32 421 Tmp, Tmp 422 Tmp, Addr 423 424 x86_64: Swap64 UD:G:64, UD:G:64 425 Tmp, Tmp 426 Tmp, Addr 427 420 428 Move32 U:G:32, ZD:G:32 421 429 Tmp, Tmp as zeroExtend32ToPtr … … 683 691 Oops /terminal 684 692 693 # A Shuffle is a multi-source, multi-destination move. It simultaneously does multiple moves at once. 694 # The moves are specified as triplets of src, dst, and width. For example you can request a swap this 695 # way: 696 # Shuffle %tmp1, %tmp2, 64, %tmp2, %tmp1, 64 697 custom Shuffle 698 685 699 # Air allows for exotic behavior. A Patch's behavior is determined entirely by the Special operand, 686 700 # which must be the first operand. 687 701 custom Patch 688 702 703 # Instructions used for lowering C calls. These don't make it to Air generation. They get lowered to 704 # something else first. The origin Value must be a CCallValue. 705 custom CCall 706 custom ColdCCall 707 708 -
trunk/Source/JavaScriptCore/b3/air/AirRegisterPriority.h
r195133 r195139 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 53 53 } 54 54 55 const Vector<Reg>& regsInPriorityOrder(Arg::Type);55 JS_EXPORT_PRIVATE const Vector<Reg>& regsInPriorityOrder(Arg::Type); 56 56 57 57 } } } // namespace JSC::B3::Air -
trunk/Source/JavaScriptCore/b3/testb3.cpp
r195133 r195139 7774 7774 7775 7775 CHECK(compileAndRun<int>(proc, a, b) == a + b); 7776 } 7777 7778 void testCallRare(int a, int b) 7779 { 7780 Procedure proc; 7781 BasicBlock* root = proc.addBlock(); 7782 BasicBlock* common = proc.addBlock(); 7783 BasicBlock* rare = proc.addBlock(); 7784 7785 root->appendNew<ControlValue>( 7786 proc, Branch, Origin(), 7787 root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0), 7788 FrequentedBlock(rare, FrequencyClass::Rare), 7789 FrequentedBlock(common)); 7790 7791 common->appendNew<ControlValue>( 7792 proc, Return, Origin(), common->appendNew<Const32Value>(proc, Origin(), 0)); 7793 7794 rare->appendNew<ControlValue>( 7795 proc, Return, Origin(), 7796 rare->appendNew<CCallValue>( 7797 proc, Int32, Origin(), 7798 rare->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(simpleFunction)), 7799 rare->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1), 7800 rare->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR2))); 7801 7802 CHECK(compileAndRun<int>(proc, true, a, b) == a + b); 7803 } 7804 7805 void testCallRareLive(int a, int b, int c) 7806 { 7807 Procedure proc; 7808 BasicBlock* root = proc.addBlock(); 7809 BasicBlock* common = proc.addBlock(); 7810 BasicBlock* rare = proc.addBlock(); 7811 7812 root->appendNew<ControlValue>( 7813 proc, Branch, Origin(), 7814 root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0), 7815 FrequentedBlock(rare, FrequencyClass::Rare), 7816 FrequentedBlock(common)); 7817 7818 common->appendNew<ControlValue>( 7819 proc, Return, Origin(), common->appendNew<Const32Value>(proc, Origin(), 0)); 7820 7821 rare->appendNew<ControlValue>( 7822 proc, Return, Origin(), 7823 rare->appendNew<Value>( 7824 proc, Add, Origin(), 7825 rare->appendNew<CCallValue>( 7826 proc, Int32, Origin(), 7827 rare->appendNew<ConstPtrValue>(proc, Origin(), bitwise_cast<void*>(simpleFunction)), 7828 rare->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1), 7829 rare->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR2)), 7830 rare->appendNew<Value>( 7831 proc, Trunc, Origin(), 7832 rare->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR3)))); 7833 7834 CHECK(compileAndRun<int>(proc, true, a, b, c) == a + b + c); 7776 7835 } 7777 7836 … … 10070 10129 10071 10130 RUN(testCallSimple(1, 2)); 10131 RUN(testCallRare(1, 2)); 10132 RUN(testCallRareLive(1, 2, 3)); 10072 10133 RUN(testCallSimplePure(1, 2)); 10073 10134 RUN(testCallFunctionWithHellaArguments()); -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp
r195133 r195139 3541 3541 m_out.aboveOrEqual( 3542 3542 prevLength, m_out.load32(storage, m_heaps.Butterfly_vectorLength)), 3543 rarely(slowPath), usually(fastPath));3543 unsure(slowPath), unsure(fastPath)); 3544 3544 3545 3545 LBasicBlock lastNext = m_out.appendTo(fastPath, slowPath); … … 8226 8226 FTL_NEW_BLOCK(m_out, ("PutByVal hole case")); 8227 8227 8228 m_out.branch(isOutOfBounds, unsure(outOfBoundsCase), unsure(holeCase));8228 m_out.branch(isOutOfBounds, rarely(outOfBoundsCase), usually(holeCase)); 8229 8229 8230 8230 LBasicBlock innerLastNext = m_out.appendTo(outOfBoundsCase, holeCase); -
trunk/Source/JavaScriptCore/ftl/FTLOSRExit.cpp
r195133 r195139 74 74 RefPtr<OSRExitHandle> handle = 75 75 prepareOSRExitHandle(state, exitKind, nodeOrigin, params, offset, isExceptionHandler); 76 handle->emitExitThunk( jit);76 handle->emitExitThunk(state, jit); 77 77 return handle; 78 78 } … … 85 85 prepareOSRExitHandle(state, exitKind, nodeOrigin, params, offset, isExceptionHandler); 86 86 params.addLatePath( 87 [handle ] (CCallHelpers& jit) {88 handle->emitExitThunk( jit);87 [handle, &state] (CCallHelpers& jit) { 88 handle->emitExitThunk(state, jit); 89 89 }); 90 90 return handle; -
trunk/Source/JavaScriptCore/ftl/FTLOSRExitHandle.cpp
r195133 r195139 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 31 31 #include "FTLOSRExit.h" 32 #include "FTLState.h" 32 33 #include "FTLThunks.h" 33 34 #include "LinkBuffer.h" 35 #include "ProfilerCompilation.h" 34 36 35 37 namespace JSC { namespace FTL { 36 38 37 void OSRExitHandle::emitExitThunk( CCallHelpers& jit)39 void OSRExitHandle::emitExitThunk(State& state, CCallHelpers& jit) 38 40 { 39 label = jit.label(); 41 Profiler::Compilation* compilation = state.graph.compilation(); 42 CCallHelpers::Label myLabel = jit.label(); 43 label = myLabel; 40 44 jit.pushToSaveImmediateWithoutTouchingRegisters(CCallHelpers::TrustedImm32(index)); 41 45 CCallHelpers::PatchableJump jump = jit.patchableJump(); 42 46 RefPtr<OSRExitHandle> self = this; 43 47 jit.addLinkTask( 44 [self, jump ] (LinkBuffer& linkBuffer) {48 [self, jump, myLabel, compilation] (LinkBuffer& linkBuffer) { 45 49 self->exit.m_patchableJump = CodeLocationJump(linkBuffer.locationOf(jump)); 46 50 … … 48 52 jump.m_jump, 49 53 CodeLocationLabel(linkBuffer.vm().getCTIStub(osrExitGenerationThunkGenerator).code())); 54 if (compilation) 55 compilation->addOSRExitSite({ linkBuffer.locationOf(myLabel).executableAddress() }); 50 56 }); 51 57 } -
trunk/Source/JavaScriptCore/ftl/FTLOSRExitHandle.h
r195133 r195139 36 36 namespace JSC { namespace FTL { 37 37 38 class State; 38 39 struct OSRExit; 39 40 … … 56 57 57 58 // This emits the exit thunk and populates 'label'. 58 void emitExitThunk( CCallHelpers&);59 void emitExitThunk(State&, CCallHelpers&); 59 60 }; 60 61
Note: See TracChangeset
for help on using the changeset viewer.