Changeset 102694 in webkit
- Timestamp:
- Dec 13, 2011 11:49:49 AM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 added
- 20 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r101052 r102694 36 36 37 37 bytecode/CodeBlock.cpp 38 bytecode/DFGExitProfile.cpp 38 39 bytecode/JumpTable.cpp 39 40 bytecode/Opcode.cpp -
trunk/Source/JavaScriptCore/ChangeLog
r102692 r102694 1 2011-12-13 Filip Pizlo <fpizlo@apple.com> 2 3 DFG should know exactly why recompilation was triggered 4 https://bugs.webkit.org/show_bug.cgi?id=74362 5 6 Reviewed by Oliver Hunt. 7 8 Each OSR exit is now individually counted, as well as counting the total number 9 of OSR exits that occurred in a code block. If recompilation is triggered, we 10 check to see if there are OSR exit sites that make up a sufficiently large 11 portion of the total OSR exits that occurred. For any such OSR exit sites, we 12 add a description of the site (bytecode index, kind) to a data structure in the 13 corresponding baseline CodeBlock. Then, when we recompile the code, we immediately 14 know which speculations would be unwise based on the fact that previous such 15 speculations proved to be fruitless. 16 17 This means 2% win on two of the SunSpider string tests, a 4% win on V8's deltablue, 18 and 5% on Kraken's imaging-darkroom. It is only a minor win in the averages, less 19 than 0.5%. 20 21 * CMakeLists.txt: 22 * GNUmakefile.list.am: 23 * JavaScriptCore.xcodeproj/project.pbxproj: 24 * Target.pri: 25 * bytecode/CodeBlock.cpp: 26 (JSC::CodeBlock::tallyFrequentExitSites): 27 * bytecode/CodeBlock.h: 28 (JSC::CodeBlock::addFrequentExitSite): 29 (JSC::CodeBlock::exitProfile): 30 (JSC::CodeBlock::reoptimize): 31 (JSC::CodeBlock::tallyFrequentExitSites): 32 * bytecode/DFGExitProfile.cpp: Added. 33 (JSC::DFG::ExitProfile::ExitProfile): 34 (JSC::DFG::ExitProfile::~ExitProfile): 35 (JSC::DFG::ExitProfile::add): 36 (JSC::DFG::QueryableExitProfile::QueryableExitProfile): 37 (JSC::DFG::QueryableExitProfile::~QueryableExitProfile): 38 * bytecode/DFGExitProfile.h: Added. 39 (JSC::DFG::exitKindToString): 40 (JSC::DFG::exitKindIsCountable): 41 (JSC::DFG::FrequentExitSite::FrequentExitSite): 42 (JSC::DFG::FrequentExitSite::operator!): 43 (JSC::DFG::FrequentExitSite::operator==): 44 (JSC::DFG::FrequentExitSite::hash): 45 (JSC::DFG::FrequentExitSite::bytecodeOffset): 46 (JSC::DFG::FrequentExitSite::kind): 47 (JSC::DFG::FrequentExitSite::isHashTableDeletedValue): 48 (JSC::DFG::FrequentExitSiteHash::hash): 49 (JSC::DFG::FrequentExitSiteHash::equal): 50 (JSC::DFG::QueryableExitProfile::hasExitSite): 51 * dfg/DFGAssemblyHelpers.h: 52 (JSC::DFG::AssemblyHelpers::baselineCodeBlockForOriginAndBaselineCodeBlock): 53 (JSC::DFG::AssemblyHelpers::baselineCodeBlockFor): 54 * dfg/DFGByteCodeParser.cpp: 55 (JSC::DFG::ByteCodeParser::makeSafe): 56 (JSC::DFG::ByteCodeParser::makeDivSafe): 57 (JSC::DFG::ByteCodeParser::handleCall): 58 (JSC::DFG::ByteCodeParser::handleIntrinsic): 59 (JSC::DFG::ByteCodeParser::parseBlock): 60 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): 61 * dfg/DFGOSRExit.cpp: 62 (JSC::DFG::OSRExit::OSRExit): 63 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow): 64 * dfg/DFGOSRExit.h: 65 (JSC::DFG::OSRExit::considerAddingAsFrequentExitSite): 66 * dfg/DFGOSRExitCompiler.cpp: 67 * dfg/DFGOSRExitCompiler32_64.cpp: 68 (JSC::DFG::OSRExitCompiler::compileExit): 69 * dfg/DFGOSRExitCompiler64.cpp: 70 (JSC::DFG::OSRExitCompiler::compileExit): 71 * dfg/DFGSpeculativeJIT.cpp: 72 (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality): 73 (JSC::DFG::SpeculativeJIT::checkArgumentTypes): 74 (JSC::DFG::SpeculativeJIT::compileGetCharCodeAt): 75 (JSC::DFG::SpeculativeJIT::compileGetByValOnString): 76 (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray): 77 (JSC::DFG::SpeculativeJIT::compileGetByValOnByteArray): 78 (JSC::DFG::SpeculativeJIT::compileGetTypedArrayLength): 79 (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray): 80 (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): 81 (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray): 82 (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray): 83 (JSC::DFG::SpeculativeJIT::compileInstanceOfForObject): 84 (JSC::DFG::SpeculativeJIT::compileSoftModulo): 85 (JSC::DFG::SpeculativeJIT::compileArithMul): 86 (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage): 87 * dfg/DFGSpeculativeJIT.h: 88 (JSC::DFG::SpeculativeJIT::speculationCheck): 89 (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution): 90 * dfg/DFGSpeculativeJIT32_64.cpp: 91 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): 92 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): 93 (JSC::DFG::SpeculativeJIT::fillSpeculateCell): 94 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): 95 (JSC::DFG::SpeculativeJIT::compileObjectEquality): 96 (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): 97 (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): 98 (JSC::DFG::SpeculativeJIT::compile): 99 * dfg/DFGSpeculativeJIT64.cpp: 100 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): 101 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): 102 (JSC::DFG::SpeculativeJIT::fillSpeculateCell): 103 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): 104 (JSC::DFG::SpeculativeJIT::compileObjectEquality): 105 (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot): 106 (JSC::DFG::SpeculativeJIT::compileLogicalNot): 107 (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch): 108 (JSC::DFG::SpeculativeJIT::emitBranch): 109 (JSC::DFG::SpeculativeJIT::compile): 110 * runtime/Heuristics.cpp: 111 (JSC::Heuristics::initializeHeuristics): 112 * runtime/Heuristics.h: 113 1 114 2011-12-13 Michael Saboff <msaboff@apple.com> 2 115 -
trunk/Source/JavaScriptCore/GNUmakefile.list.am
r102564 r102694 86 86 Source/JavaScriptCore/bytecode/CodeOrigin.h \ 87 87 Source/JavaScriptCore/bytecode/DataFormat.h \ 88 Source/JavaScriptCore/bytecode/DFGExitProfile.cpp \ 89 Source/JavaScriptCore/bytecode/DFGExitProfile.h \ 88 90 Source/JavaScriptCore/bytecode/EvalCodeCache.h \ 89 91 Source/JavaScriptCore/bytecode/Instruction.h \ -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r102167 r102694 73 73 0F963B2F13FC66BB0002D9B2 /* MetaAllocatorHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F963B2E13FC66AE0002D9B2 /* MetaAllocatorHandle.h */; settings = {ATTRIBUTES = (Private, ); }; }; 74 74 0F963B3813FC6FE90002D9B2 /* ValueProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; 75 0FBC0AE71496C7C400D4FBDD /* DFGExitProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FBC0AE41496C7C100D4FBDD /* DFGExitProfile.cpp */; }; 76 0FBC0AE81496C7C700D4FBDD /* DFGExitProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBC0AE51496C7C100D4FBDD /* DFGExitProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; 75 77 0FBD7E691447999600481315 /* CodeOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBD7E671447998F00481315 /* CodeOrigin.h */; settings = {ATTRIBUTES = (Private, ); }; }; 76 78 0FC0976A1468A6F700CF2442 /* DFGOSRExit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC097681468A6EF00CF2442 /* DFGOSRExit.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 852 854 0F963B2E13FC66AE0002D9B2 /* MetaAllocatorHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MetaAllocatorHandle.h; sourceTree = "<group>"; }; 853 855 0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueProfile.h; sourceTree = "<group>"; }; 856 0FBC0AE41496C7C100D4FBDD /* DFGExitProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DFGExitProfile.cpp; sourceTree = "<group>"; }; 857 0FBC0AE51496C7C100D4FBDD /* DFGExitProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFGExitProfile.h; sourceTree = "<group>"; }; 854 858 0FBD7E671447998F00481315 /* CodeOrigin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeOrigin.h; sourceTree = "<group>"; }; 855 859 0FC097681468A6EF00CF2442 /* DFGOSRExit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGOSRExit.h; path = dfg/DFGOSRExit.h; sourceTree = "<group>"; }; … … 2461 2465 isa = PBXGroup; 2462 2466 children = ( 2467 0FBC0AE41496C7C100D4FBDD /* DFGExitProfile.cpp */, 2468 0FBC0AE51496C7C100D4FBDD /* DFGExitProfile.h */, 2463 2469 0F426A4A1460CD6B00131F8F /* DataFormat.h */, 2464 2470 0F426A451460CBAB00131F8F /* ValueRecovery.h */, … … 2982 2988 A73BE180148420A80091204B /* IntegralTypedArrayBase.h in Headers */, 2983 2989 860BD801148EA6F200112B2F /* Intrinsic.h in Headers */, 2990 0FBC0AE81496C7C700D4FBDD /* DFGExitProfile.h in Headers */, 2984 2991 ); 2985 2992 runOnlyForDeploymentPostprocessing = 0; … … 3519 3526 A73BE168148420520091204B /* ArrayBuffer.cpp in Sources */, 3520 3527 A73BE16A148420520091204B /* ArrayBufferView.cpp in Sources */, 3528 0FBC0AE71496C7C400D4FBDD /* DFGExitProfile.cpp in Sources */, 3521 3529 ); 3522 3530 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/JavaScriptCore/Target.pri
r101253 r102694 56 56 assembler/MacroAssemblerSH4.cpp \ 57 57 bytecode/CodeBlock.cpp \ 58 bytecode/DFGExitProfile.cpp \ 58 59 bytecode/JumpTable.cpp \ 59 60 bytecode/Opcode.cpp \ -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r102489 r102694 2242 2242 #endif 2243 2243 2244 #if ENABLE(DFG_JIT) 2245 void CodeBlock::tallyFrequentExitSites() 2246 { 2247 ASSERT(getJITType() == JITCode::DFGJIT); 2248 ASSERT(alternative()->getJITType() == JITCode::BaselineJIT); 2249 ASSERT(!!m_dfgData); 2250 2251 CodeBlock* profiledBlock = alternative(); 2252 2253 for (unsigned i = 0; i < m_dfgData->osrExit.size(); ++i) { 2254 DFG::OSRExit& exit = m_dfgData->osrExit[i]; 2255 2256 if (!exit.considerAddingAsFrequentExitSite(this, profiledBlock)) 2257 continue; 2258 2259 #if DFG_ENABLE(DEBUG_VERBOSE) 2260 fprintf(stderr, "OSR exit #%u (bc#%u, @%u, %s) for code block %p occurred frequently; counting as frequent exit site.\n", i, exit.m_codeOrigin.bytecodeIndex, exit.m_nodeIndex, DFG::exitKindToString(exit.m_kind), this); 2261 #endif 2262 } 2263 } 2264 #endif // ENABLE(DFG_JIT) 2265 2244 2266 #if ENABLE(VERBOSE_VALUE_PROFILE) 2245 2267 void CodeBlock::dumpValueProfiles() -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r102545 r102694 34 34 #include "CompactJITCodeMap.h" 35 35 #include "DFGCodeBlocks.h" 36 #include "DFGExitProfile.h" 36 37 #include "DFGOSREntry.h" 37 38 #include "DFGOSRExit.h" … … 797 798 return binarySearch<CodeOriginAtCallReturnOffset, unsigned, getCallReturnOffsetForCodeOrigin>(codeOrigins().begin(), codeOrigins().size(), getJITCode().offsetOf(returnAddress.value()))->codeOrigin; 798 799 } 800 801 bool addFrequentExitSite(const DFG::FrequentExitSite& site) 802 { 803 ASSERT(getJITType() == JITCode::BaselineJIT); 804 return m_exitProfile.add(site); 805 } 806 807 DFG::ExitProfile& exitProfile() { return m_exitProfile; } 799 808 #endif 800 809 … … 1066 1075 { 1067 1076 ASSERT(replacement() != this); 1077 ASSERT(replacement()->alternative() == this); 1078 replacement()->tallyFrequentExitSites(); 1068 1079 replacement()->jettison(); 1069 1080 countReoptimization(); … … 1093 1104 private: 1094 1105 friend class DFGCodeBlocks; 1106 1107 #if ENABLE(DFG_JIT) 1108 void tallyFrequentExitSites(); 1109 #else 1110 void tallyFrequentExitSites() { } 1111 #endif 1095 1112 1096 1113 #if !defined(NDEBUG) || ENABLE(OPCODE_SAMPLING) … … 1213 1230 1214 1231 OwnPtr<DFGData> m_dfgData; 1232 1233 // This is relevant to non-DFG code blocks that serve as the profiled code block 1234 // for DFG code blocks. 1235 DFG::ExitProfile m_exitProfile; 1215 1236 #endif 1216 1237 #if ENABLE(VALUE_PROFILER) -
trunk/Source/JavaScriptCore/bytecode/DFGExitProfile.cpp
r102693 r102694 25 25 26 26 #include "config.h" 27 #include "DFG OSRExit.h"27 #include "DFGExitProfile.h" 28 28 29 #if ENABLE(DFG_JIT) 30 31 #include "DFGSpeculativeJIT.h" 29 #include <wtf/PassOwnPtr.h> 32 30 33 31 namespace JSC { namespace DFG { 34 32 35 OSRExit::OSRExit(JSValueSource jsValueSource, ValueProfile* valueProfile, MacroAssembler::Jump check, SpeculativeJIT* jit, unsigned recoveryIndex) 36 : m_jsValueSource(jsValueSource) 37 , m_valueProfile(valueProfile) 38 , m_check(check) 39 , m_nodeIndex(jit->m_compileIndex) 40 , m_codeOrigin(jit->m_codeOriginForOSR) 41 , m_recoveryIndex(recoveryIndex) 42 , m_arguments(jit->m_arguments.size()) 43 , m_variables(jit->m_variables.size()) 44 , m_lastSetOperand(jit->m_lastSetOperand) 33 ExitProfile::ExitProfile() { } 34 ExitProfile::~ExitProfile() { } 35 36 bool ExitProfile::add(const FrequentExitSite& site) 45 37 { 46 ASSERT(m_codeOrigin.isSet()); 47 for (unsigned argument = 0; argument < m_arguments.size(); ++argument) 48 m_arguments[argument] = jit->computeValueRecoveryFor(jit->m_arguments[argument]); 49 for (unsigned variable = 0; variable < m_variables.size(); ++variable) 50 m_variables[variable] = jit->computeValueRecoveryFor(jit->m_variables[variable]); 38 // If we've never seen any frequent exits then create the list and put this site 39 // into it. 40 if (!m_frequentExitSites) { 41 m_frequentExitSites = adoptPtr(new Vector<FrequentExitSite>()); 42 m_frequentExitSites->append(site); 43 return true; 44 } 45 46 // Don't add it if it's already there. This is O(n), but that's OK, because we 47 // know that the total number of places where code exits tends to not be large, 48 // and this code is only used when recompilation is triggered. 49 for (unsigned i = 0; i < m_frequentExitSites->size(); ++i) { 50 if (m_frequentExitSites->at(i) == site) 51 return false; 52 } 53 54 m_frequentExitSites->append(site); 55 return true; 51 56 } 52 57 53 #ifndef NDEBUG 54 void OSRExit::dump(FILE* out) const 58 QueryableExitProfile::QueryableExitProfile(const ExitProfile& profile) 55 59 { 56 for (unsigned argument = 0; argument < m_arguments.size(); ++argument)57 m_arguments[argument].dump(out);58 fprintf(out, " : ");59 for (unsigned variable = 0; variable < m_variables.size(); ++variable)60 m_ variables[variable].dump(out);60 if (!profile.m_frequentExitSites) 61 return; 62 63 for (unsigned i = 0; i < profile.m_frequentExitSites->size(); ++i) 64 m_frequentExitSites.add(profile.m_frequentExitSites->at(i)); 61 65 } 62 #endif 66 67 QueryableExitProfile::~QueryableExitProfile() { } 63 68 64 69 } } // namespace JSC::DFG 65 66 #endif // ENABLE(DFG_JIT) -
trunk/Source/JavaScriptCore/dfg/DFGAssemblyHelpers.h
r101334 r102694 285 285 } 286 286 287 CodeBlock* baselineCodeBlockFor(const CodeOrigin& codeOrigin)287 static CodeBlock* baselineCodeBlockForOriginAndBaselineCodeBlock(const CodeOrigin& codeOrigin, CodeBlock* baselineCodeBlock) 288 288 { 289 289 if (codeOrigin.inlineCallFrame) { … … 292 292 return static_cast<FunctionExecutable*>(executable)->baselineCodeBlockFor(codeOrigin.inlineCallFrame->isCall ? CodeForCall : CodeForConstruct); 293 293 } 294 return baselineCodeBlock(); 294 return baselineCodeBlock; 295 } 296 297 CodeBlock* baselineCodeBlockFor(const CodeOrigin& codeOrigin) 298 { 299 return baselineCodeBlockForOriginAndBaselineCodeBlock(codeOrigin, baselineCodeBlock()); 295 300 } 296 301 -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r102545 r102694 632 632 NodeIndex makeSafe(NodeIndex nodeIndex) 633 633 { 634 if (!m_inlineStackTop->m_profiledBlock->likelyToTakeSlowCase(m_currentIndex)) 634 if (!m_inlineStackTop->m_profiledBlock->likelyToTakeSlowCase(m_currentIndex) 635 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow) 636 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, NegativeZero)) 635 637 return nodeIndex; 636 638 637 639 #if DFG_ENABLE(DEBUG_VERBOSE) 638 printf("Making %s @%u safe at bc#%u because slow-case counter is at %u \n", Graph::opName(m_graph[nodeIndex].op), nodeIndex, m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter);640 printf("Making %s @%u safe at bc#%u because slow-case counter is at %u and exit profiles say %d, %d\n", Graph::opName(m_graph[nodeIndex].op), nodeIndex, m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter, m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow), m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, NegativeZero)); 639 641 #endif 640 642 … … 649 651 650 652 case ArithMul: 651 if (m_inlineStackTop->m_profiledBlock->likelyToTakeDeepestSlowCase(m_currentIndex)) { 653 if (m_inlineStackTop->m_profiledBlock->likelyToTakeDeepestSlowCase(m_currentIndex) 654 || m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow)) { 652 655 #if DFG_ENABLE(DEBUG_VERBOSE) 653 656 printf("Making ArithMul @%u take deepest slow case.\n", nodeIndex); 654 657 #endif 655 658 m_graph[nodeIndex].mergeArithNodeFlags(NodeMayOverflow | NodeMayNegZero); 656 } else { 659 } else if (m_inlineStackTop->m_profiledBlock->likelyToTakeSlowCase(m_currentIndex) 660 || m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, NegativeZero)) { 657 661 #if DFG_ENABLE(DEBUG_VERBOSE) 658 662 printf("Making ArithMul @%u take faster slow case.\n", nodeIndex); … … 680 684 // is what the special fast case counter tells us. 681 685 682 if (!m_inlineStackTop->m_profiledBlock->likelyToTakeSpecialFastCase(m_currentIndex)) 686 if (!m_inlineStackTop->m_profiledBlock->likelyToTakeSpecialFastCase(m_currentIndex) 687 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow) 688 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, NegativeZero)) 683 689 return nodeIndex; 684 690 685 691 #if DFG_ENABLE(DEBUG_VERBOSE) 686 printf("Making %s @%u safe at bc#%u because special fast-case counter is at %u\n", Graph::opName(m_graph[nodeIndex].op), nodeIndex, m_currentIndex, m_inlineStackTop->m_profiledBlock->specialFastCaseProfileForBytecodeOffset(m_currentIndex)->m_counter); 687 #endif 688 692 printf("Making %s @%u safe at bc#%u because special fast-case counter is at %u and exit profiles say %d, %d\n", Graph::opName(m_graph[nodeIndex].op), nodeIndex, m_currentIndex, m_inlineStackTop->m_profiledBlock->specialFastCaseProfileForBytecodeOffset(m_currentIndex)->m_counter, m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow), m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, NegativeZero)); 693 #endif 694 695 // FIXME: It might be possible to make this more granular. The DFG certainly can 696 // distinguish between negative zero and overflow in its exit profiles. 689 697 m_graph[nodeIndex].mergeArithNodeFlags(NodeMayOverflow | NodeMayNegZero); 690 698 … … 794 802 ScriptExecutable* executable() { return m_codeBlock->ownerExecutable(); } 795 803 804 QueryableExitProfile m_exitProfile; 805 796 806 // Remapping of identifier and constant numbers from the code block being 797 807 // inlined (inline callee) to the code block that we're inlining into … … 888 898 889 899 #if DFG_ENABLE(DEBUG_VERBOSE) 890 printf("Slow case count for call at @%lu bc#%u: %u/%u .\n", m_graph.size(), m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter, m_inlineStackTop->m_profiledBlock->executionEntryCount());900 printf("Slow case count for call at @%lu bc#%u: %u/%u; exit profile: %d.\n", m_graph.size(), m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter, m_inlineStackTop->m_profiledBlock->executionEntryCount(), m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)); 891 901 #endif 892 902 893 903 if (m_graph.isFunctionConstant(m_codeBlock, callTarget)) 894 904 callType = ConstantFunction; 895 else if (!!m_inlineStackTop->m_profiledBlock->getCallLinkInfo(m_currentIndex).lastSeenCallee && !m_inlineStackTop->m_profiledBlock->couldTakeSlowCase(m_currentIndex)) 905 else if (!!m_inlineStackTop->m_profiledBlock->getCallLinkInfo(m_currentIndex).lastSeenCallee 906 && !m_inlineStackTop->m_profiledBlock->couldTakeSlowCase(m_currentIndex) 907 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)) 896 908 callType = LinkedFunction; 897 909 else … … 1168 1180 return false; 1169 1181 1170 set(resultOperand, addToGraph(ArithAbs, OpInfo(NodeUseBottom), getToNumber(registerOffset + argumentToOperand(1)))); 1182 NodeIndex nodeIndex = addToGraph(ArithAbs, OpInfo(NodeUseBottom), getToNumber(registerOffset + argumentToOperand(1))); 1183 if (m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow)) 1184 m_graph[nodeIndex].mergeArithNodeFlags(NodeMayOverflow); 1185 set(resultOperand, nodeIndex); 1171 1186 return true; 1172 1187 } … … 1669 1684 MethodCallLinkInfo& methodCall = m_inlineStackTop->m_profiledBlock->getMethodCallLinkInfo(m_currentIndex); 1670 1685 1671 if (methodCall.seen && !!methodCall.cachedStructure && !stubInfo.seen) { 1686 if (methodCall.seen 1687 && !!methodCall.cachedStructure 1688 && !stubInfo.seen 1689 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)) { 1672 1690 // It's monomorphic as far as we can tell, since the method_check was linked 1673 1691 // but the slow path (i.e. the normal get_by_id) never fired. … … 1712 1730 1713 1731 #if DFG_ENABLE(DEBUG_VERBOSE) 1714 printf("Slow case count for GetById @%lu bc#%u: %u \n", m_graph.size(), m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter);1732 printf("Slow case count for GetById @%lu bc#%u: %u; exit profile: %d\n", m_graph.size(), m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter, m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)); 1715 1733 #endif 1716 1734 1717 1735 size_t offset = notFound; 1718 1736 StructureSet structureSet; 1719 if (stubInfo.seen && !m_inlineStackTop->m_profiledBlock->likelyToTakeSlowCase(m_currentIndex)) { 1737 if (stubInfo.seen 1738 && !m_inlineStackTop->m_profiledBlock->likelyToTakeSlowCase(m_currentIndex) 1739 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)) { 1720 1740 switch (stubInfo.accessType) { 1721 1741 case access_get_by_id_self: { … … 1806 1826 1807 1827 #if DFG_ENABLE(DEBUG_VERBOSE) 1808 printf("Slow case count for PutById @%lu bc#%u: %u \n", m_graph.size(), m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter);1828 printf("Slow case count for PutById @%lu bc#%u: %u; exit profile: %d\n", m_graph.size(), m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter, m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)); 1809 1829 #endif 1810 1830 1811 if (stubInfo.seen && !m_inlineStackTop->m_profiledBlock->likelyToTakeSlowCase(m_currentIndex)) { 1831 if (stubInfo.seen 1832 && !m_inlineStackTop->m_profiledBlock->likelyToTakeSlowCase(m_currentIndex) 1833 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)) { 1812 1834 switch (stubInfo.accessType) { 1813 1835 case access_put_by_id_replace: { … … 2426 2448 , m_profiledBlock(profiledBlock) 2427 2449 , m_calleeVR(calleeVR) 2450 , m_exitProfile(profiledBlock->exitProfile()) 2428 2451 , m_callsiteBlockHead(callsiteBlockHead) 2429 2452 , m_returnValue(returnValueVR) -
trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp
r99787 r102694 29 29 #if ENABLE(DFG_JIT) 30 30 31 #include "DFGAssemblyHelpers.h" 31 32 #include "DFGSpeculativeJIT.h" 32 33 33 34 namespace JSC { namespace DFG { 34 35 35 OSRExit::OSRExit( JSValueSource jsValueSource, ValueProfile* valueProfile, MacroAssembler::Jump check, SpeculativeJIT* jit, unsigned recoveryIndex)36 OSRExit::OSRExit(ExitKind kind, JSValueSource jsValueSource, ValueProfile* valueProfile, MacroAssembler::Jump check, SpeculativeJIT* jit, unsigned recoveryIndex) 36 37 : m_jsValueSource(jsValueSource) 37 38 , m_valueProfile(valueProfile) … … 40 41 , m_codeOrigin(jit->m_codeOriginForOSR) 41 42 , m_recoveryIndex(recoveryIndex) 43 , m_kind(kind) 44 , m_count(0) 42 45 , m_arguments(jit->m_arguments.size()) 43 46 , m_variables(jit->m_variables.size()) … … 62 65 #endif 63 66 67 bool OSRExit::considerAddingAsFrequentExitSiteSlow(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock) 68 { 69 if (static_cast<double>(m_count) / dfgCodeBlock->speculativeFailCounter() <= Heuristics::osrExitProminenceForFrequentExitSite) 70 return false; 71 72 return AssemblyHelpers::baselineCodeBlockForOriginAndBaselineCodeBlock(m_codeOrigin, profiledCodeBlock)->addFrequentExitSite(FrequentExitSite(m_codeOrigin.bytecodeIndex, m_kind)); 73 } 74 64 75 } } // namespace JSC::DFG 65 76 -
trunk/Source/JavaScriptCore/dfg/DFGOSRExit.h
r102545 r102694 34 34 #include "DFGCommon.h" 35 35 #include "DFGCorrectableJumpPoint.h" 36 #include "DFGExitProfile.h" 36 37 #include "DFGGPRInfo.h" 37 38 #include "DFGOperands.h" … … 82 83 // going into baseline code. 83 84 struct OSRExit { 84 OSRExit( JSValueSource, ValueProfile*, MacroAssembler::Jump, SpeculativeJIT*, unsigned recoveryIndex = 0);85 OSRExit(ExitKind, JSValueSource, ValueProfile*, MacroAssembler::Jump, SpeculativeJIT*, unsigned recoveryIndex = 0); 85 86 86 87 MacroAssemblerCodeRef m_code; … … 94 95 95 96 unsigned m_recoveryIndex; 97 98 ExitKind m_kind; 99 uint32_t m_count; 96 100 97 101 // Convenient way of iterating over ValueRecoveries while being … … 121 125 } 122 126 127 bool considerAddingAsFrequentExitSite(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock) 128 { 129 if (!m_count || !exitKindIsCountable(m_kind)) 130 return false; 131 return considerAddingAsFrequentExitSiteSlow(dfgCodeBlock, profiledCodeBlock); 132 } 133 123 134 #ifndef NDEBUG 124 135 void dump(FILE* out) const; … … 128 139 Vector<ValueRecovery, 0> m_variables; 129 140 int m_lastSetOperand; 141 142 private: 143 bool considerAddingAsFrequentExitSiteSlow(CodeBlock* dfgCodeBlock, CodeBlock* profiledCodeBlock); 130 144 }; 131 145 -
trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp
r100975 r102694 54 54 55 55 #if DFG_ENABLE(DEBUG_VERBOSE) 56 fprintf(stderr, "Generating OSR exit #%u for code block %p.\n", exitIndex, codeBlock);56 fprintf(stderr, "Generating OSR exit #%u (bc#%u, @%u, %s) for code block %p.\n", exitIndex, exit.m_codeOrigin.bytecodeIndex, exit.m_nodeIndex, exitKindToString(exit.m_kind), codeBlock); 57 57 #endif 58 58 -
trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp
r100820 r102694 452 452 // counterValueForOptimizeAfterWarmUp(). 453 453 454 m_jit.add32(AssemblyHelpers::Imm32(1), AssemblyHelpers::AbsoluteAddress(&exit.m_count)); 455 454 456 m_jit.move(AssemblyHelpers::TrustedImmPtr(m_jit.codeBlock()), GPRInfo::regT0); 455 457 -
trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp
r100363 r102694 462 462 // counterValueForOptimizeAfterWarmUp(). 463 463 464 m_jit.add32(AssemblyHelpers::Imm32(1), AssemblyHelpers::AbsoluteAddress(&exit.m_count)); 465 464 466 m_jit.move(AssemblyHelpers::TrustedImmPtr(m_jit.codeBlock()), GPRInfo::regT0); 465 467 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r102629 r102694 825 825 826 826 if (!predictionCheck(m_state.forNode(node.child1()).m_type)) 827 speculationCheck( JSValueSource::unboxedCell(op1GPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(op1GPR), MacroAssembler::TrustedImmPtr(vptr)));827 speculationCheck(BadType, JSValueSource::unboxedCell(op1GPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(op1GPR), MacroAssembler::TrustedImmPtr(vptr))); 828 828 if (!predictionCheck(m_state.forNode(node.child2()).m_type)) 829 speculationCheck( JSValueSource::unboxedCell(op2GPR), node.child2(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(op2GPR), MacroAssembler::TrustedImmPtr(vptr)));829 speculationCheck(BadType, JSValueSource::unboxedCell(op2GPR), node.child2(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(op2GPR), MacroAssembler::TrustedImmPtr(vptr))); 830 830 831 831 addBranch(m_jit.branchPtr(condition, op1GPR, op2GPR), taken); … … 1060 1060 #if USE(JSVALUE64) 1061 1061 if (isInt32Prediction(predictedType)) 1062 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::Below, JITCompiler::addressFor(virtualRegister), GPRInfo::tagTypeNumberRegister));1062 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::Below, JITCompiler::addressFor(virtualRegister), GPRInfo::tagTypeNumberRegister)); 1063 1063 else if (isArrayPrediction(predictedType)) { 1064 1064 GPRTemporary temp(this); 1065 1065 m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), temp.gpr()); 1066 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister));1067 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr)));1066 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister)); 1067 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr))); 1068 1068 } else if (isByteArrayPrediction(predictedType)) { 1069 1069 GPRTemporary temp(this); 1070 1070 m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), temp.gpr()); 1071 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister));1072 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr)));1071 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister)); 1072 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr))); 1073 1073 } else if (isBooleanPrediction(predictedType)) { 1074 1074 GPRTemporary temp(this); 1075 1075 m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), temp.gpr()); 1076 1076 m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), temp.gpr()); 1077 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), TrustedImm32(static_cast<int32_t>(~1))));1077 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), TrustedImm32(static_cast<int32_t>(~1)))); 1078 1078 } else if (isInt8ArrayPrediction(predictedType)) { 1079 1079 GPRTemporary temp(this); 1080 1080 m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), temp.gpr()); 1081 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister));1082 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->int8ArrayDescriptor().m_vptr)));1081 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister)); 1082 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->int8ArrayDescriptor().m_vptr))); 1083 1083 } else if (isInt16ArrayPrediction(predictedType)) { 1084 1084 GPRTemporary temp(this); 1085 1085 m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), temp.gpr()); 1086 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister));1087 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->int16ArrayDescriptor().m_vptr)));1086 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister)); 1087 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->int16ArrayDescriptor().m_vptr))); 1088 1088 } else if (isInt32ArrayPrediction(predictedType)) { 1089 1089 GPRTemporary temp(this); 1090 1090 m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), temp.gpr()); 1091 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister));1092 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->int32ArrayDescriptor().m_vptr)));1091 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister)); 1092 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->int32ArrayDescriptor().m_vptr))); 1093 1093 } else if (isUint8ArrayPrediction(predictedType)) { 1094 1094 GPRTemporary temp(this); 1095 1095 m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), temp.gpr()); 1096 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister));1097 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->uint8ArrayDescriptor().m_vptr)));1096 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister)); 1097 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->uint8ArrayDescriptor().m_vptr))); 1098 1098 } else if (isUint16ArrayPrediction(predictedType)) { 1099 1099 GPRTemporary temp(this); 1100 1100 m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), temp.gpr()); 1101 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister));1102 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->uint16ArrayDescriptor().m_vptr)));1101 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister)); 1102 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->uint16ArrayDescriptor().m_vptr))); 1103 1103 } else if (isUint32ArrayPrediction(predictedType)) { 1104 1104 GPRTemporary temp(this); 1105 1105 m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), temp.gpr()); 1106 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister));1107 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->uint32ArrayDescriptor().m_vptr)));1106 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister)); 1107 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->uint32ArrayDescriptor().m_vptr))); 1108 1108 } else if (isFloat32ArrayPrediction(predictedType)) { 1109 1109 GPRTemporary temp(this); 1110 1110 m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), temp.gpr()); 1111 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister));1112 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->float32ArrayDescriptor().m_vptr)));1111 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister)); 1112 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->float32ArrayDescriptor().m_vptr))); 1113 1113 } else if (isFloat64ArrayPrediction(predictedType)) { 1114 1114 GPRTemporary temp(this); 1115 1115 m_jit.loadPtr(JITCompiler::addressFor(virtualRegister), temp.gpr()); 1116 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister));1117 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->float64ArrayDescriptor().m_vptr)));1116 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::NonZero, temp.gpr(), GPRInfo::tagMaskRegister)); 1117 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->float64ArrayDescriptor().m_vptr))); 1118 1118 } 1119 1119 #else 1120 1120 if (isInt32Prediction(predictedType)) 1121 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::Int32Tag)));1121 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::Int32Tag))); 1122 1122 else if (isArrayPrediction(predictedType)) { 1123 1123 GPRTemporary temp(this); 1124 1124 m_jit.load32(JITCompiler::tagFor(virtualRegister), temp.gpr()); 1125 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag)));1125 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag))); 1126 1126 m_jit.load32(JITCompiler::payloadFor(virtualRegister), temp.gpr()); 1127 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr)));1127 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr))); 1128 1128 } else if (isByteArrayPrediction(predictedType)) { 1129 1129 GPRTemporary temp(this); 1130 1130 m_jit.load32(JITCompiler::tagFor(virtualRegister), temp.gpr()); 1131 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag)));1131 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag))); 1132 1132 m_jit.load32(JITCompiler::payloadFor(virtualRegister), temp.gpr()); 1133 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr)));1133 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr))); 1134 1134 } else if (isBooleanPrediction(predictedType)) 1135 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::BooleanTag)));1135 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::BooleanTag))); 1136 1136 else if (isInt8ArrayPrediction(predictedType)) { 1137 1137 GPRTemporary temp(this); 1138 1138 m_jit.load32(JITCompiler::tagFor(virtualRegister), temp.gpr()); 1139 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag)));1139 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag))); 1140 1140 m_jit.load32(JITCompiler::payloadFor(virtualRegister), temp.gpr()); 1141 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->int8ArrayDescriptor().m_vptr)));1141 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->int8ArrayDescriptor().m_vptr))); 1142 1142 } else if (isInt16ArrayPrediction(predictedType)) { 1143 1143 GPRTemporary temp(this); 1144 1144 m_jit.load32(JITCompiler::tagFor(virtualRegister), temp.gpr()); 1145 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag)));1145 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag))); 1146 1146 m_jit.load32(JITCompiler::payloadFor(virtualRegister), temp.gpr()); 1147 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->int16ArrayDescriptor().m_vptr)));1147 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->int16ArrayDescriptor().m_vptr))); 1148 1148 } else if (isInt32ArrayPrediction(predictedType)) { 1149 1149 GPRTemporary temp(this); 1150 1150 m_jit.load32(JITCompiler::tagFor(virtualRegister), temp.gpr()); 1151 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag)));1151 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag))); 1152 1152 m_jit.load32(JITCompiler::payloadFor(virtualRegister), temp.gpr()); 1153 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->int32ArrayDescriptor().m_vptr)));1153 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->int32ArrayDescriptor().m_vptr))); 1154 1154 } else if (isUint8ArrayPrediction(predictedType)) { 1155 1155 GPRTemporary temp(this); 1156 1156 m_jit.load32(JITCompiler::tagFor(virtualRegister), temp.gpr()); 1157 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag)));1157 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag))); 1158 1158 m_jit.load32(JITCompiler::payloadFor(virtualRegister), temp.gpr()); 1159 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->uint8ArrayDescriptor().m_vptr)));1159 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->uint8ArrayDescriptor().m_vptr))); 1160 1160 } else if (isUint16ArrayPrediction(predictedType)) { 1161 1161 GPRTemporary temp(this); 1162 1162 m_jit.load32(JITCompiler::tagFor(virtualRegister), temp.gpr()); 1163 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag)));1163 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag))); 1164 1164 m_jit.load32(JITCompiler::payloadFor(virtualRegister), temp.gpr()); 1165 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->uint16ArrayDescriptor().m_vptr)));1165 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->uint16ArrayDescriptor().m_vptr))); 1166 1166 } else if (isUint32ArrayPrediction(predictedType)) { 1167 1167 GPRTemporary temp(this); 1168 1168 m_jit.load32(JITCompiler::tagFor(virtualRegister), temp.gpr()); 1169 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag)));1169 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag))); 1170 1170 m_jit.load32(JITCompiler::payloadFor(virtualRegister), temp.gpr()); 1171 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->uint32ArrayDescriptor().m_vptr)));1171 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->uint32ArrayDescriptor().m_vptr))); 1172 1172 } else if (isFloat32ArrayPrediction(predictedType)) { 1173 1173 GPRTemporary temp(this); 1174 1174 m_jit.load32(JITCompiler::tagFor(virtualRegister), temp.gpr()); 1175 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag)));1175 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag))); 1176 1176 m_jit.load32(JITCompiler::payloadFor(virtualRegister), temp.gpr()); 1177 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->float32ArrayDescriptor().m_vptr)));1177 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->float32ArrayDescriptor().m_vptr))); 1178 1178 } else if (isFloat64ArrayPrediction(predictedType)) { 1179 1179 GPRTemporary temp(this); 1180 1180 m_jit.load32(JITCompiler::tagFor(virtualRegister), temp.gpr()); 1181 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag)));1181 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, temp.gpr(), TrustedImm32(JSValue::CellTag))); 1182 1182 m_jit.load32(JITCompiler::payloadFor(virtualRegister), temp.gpr()); 1183 speculationCheck( JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->float64ArrayDescriptor().m_vptr)));1183 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(temp.gpr()), MacroAssembler::TrustedImmPtr(m_jit.globalData()->float64ArrayDescriptor().m_vptr))); 1184 1184 } 1185 1185 #endif … … 1355 1355 if (!isStringPrediction(m_state.forNode(node.child1()).m_type)) { 1356 1356 ASSERT(!(at(node.child1()).prediction() & PredictString)); 1357 terminateSpeculativeExecution( JSValueRegs(), NoNode);1357 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1358 1358 noResult(m_compileIndex); 1359 1359 return; … … 1361 1361 1362 1362 // unsigned comparison so we can filter out negative indices and indices that are too large 1363 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, indexReg, MacroAssembler::Address(stringReg, JSString::offsetOfLength())));1363 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, indexReg, MacroAssembler::Address(stringReg, JSString::offsetOfLength()))); 1364 1364 1365 1365 GPRTemporary scratch(this); … … 1394 1394 if (!isStringPrediction(m_state.forNode(node.child1()).m_type)) { 1395 1395 ASSERT(!(at(node.child1()).prediction() & PredictString)); 1396 terminateSpeculativeExecution( JSValueRegs(), NoNode);1396 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1397 1397 noResult(m_compileIndex); 1398 1398 return; … … 1400 1400 1401 1401 // unsigned comparison so we can filter out negative indices and indices that are too large 1402 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, JSString::offsetOfLength())));1402 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, JSString::offsetOfLength()))); 1403 1403 1404 1404 GPRTemporary scratch(this); … … 1418 1418 1419 1419 // We only support ascii characters 1420 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, scratchReg, TrustedImm32(0x100)));1420 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, scratchReg, TrustedImm32(0x100))); 1421 1421 1422 1422 // 8 bit string values don't need the isASCII check. … … 1427 1427 m_jit.move(MacroAssembler::TrustedImmPtr(m_jit.globalData()->smallStrings.singleCharacterStrings()), smallStringsReg); 1428 1428 m_jit.loadPtr(MacroAssembler::BaseIndex(smallStringsReg, scratchReg, MacroAssembler::ScalePtr, 0), scratchReg); 1429 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTest32(MacroAssembler::Zero, scratchReg));1429 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTest32(MacroAssembler::Zero, scratchReg)); 1430 1430 cellResult(scratchReg, m_compileIndex); 1431 1431 } … … 1496 1496 1497 1497 if (!isByteArrayPrediction(m_state.forNode(baseIndex).m_type)) 1498 speculationCheck( JSValueSource::unboxedCell(base), baseIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(base), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr)));1498 speculationCheck(BadType, JSValueSource::unboxedCell(base), baseIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(base), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr))); 1499 1499 GPRTemporary value; 1500 1500 GPRReg valueGPR; … … 1503 1503 JSValue jsValue = valueOfJSConstant(valueIndex); 1504 1504 if (!jsValue.isNumber()) { 1505 terminateSpeculativeExecution( JSValueRegs(), NoNode);1505 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1506 1506 noResult(m_compileIndex); 1507 1507 return; … … 1564 1564 1565 1565 if (!isByteArrayPrediction(m_state.forNode(node.child1()).m_type)) { 1566 terminateSpeculativeExecution( JSValueRegs(), NoNode);1566 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1567 1567 noResult(m_compileIndex); 1568 1568 return; … … 1575 1575 1576 1576 // unsigned comparison so we can filter out negative indices and indices that are too large 1577 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(storageReg, ByteArray::offsetOfSize())));1577 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(storageReg, ByteArray::offsetOfSize()))); 1578 1578 1579 1579 m_jit.load8(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesOne, ByteArray::offsetOfData()), storageReg); … … 1590 1590 1591 1591 if (needsSpeculationCheck) 1592 speculationCheck( JSValueSource::unboxedCell(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(descriptor.m_vptr)));1592 speculationCheck(BadType, JSValueSource::unboxedCell(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(descriptor.m_vptr))); 1593 1593 1594 1594 m_jit.load32(MacroAssembler::Address(baseGPR, descriptor.m_lengthOffset), resultGPR); … … 1612 1612 if (speculationRequirements != NoTypedArrayTypeSpecCheck) { 1613 1613 ASSERT_NOT_REACHED(); 1614 terminateSpeculativeExecution( JSValueRegs(), NoNode);1614 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1615 1615 noResult(m_compileIndex); 1616 1616 return; … … 1653 1653 1654 1654 if (speculationRequirements != NoTypedArrayTypeSpecCheck) 1655 speculationCheck( JSValueSource::unboxedCell(base), baseIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(base), MacroAssembler::TrustedImmPtr(descriptor.m_vptr)));1655 speculationCheck(BadType, JSValueSource::unboxedCell(base), baseIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(base), MacroAssembler::TrustedImmPtr(descriptor.m_vptr))); 1656 1656 GPRTemporary value; 1657 1657 GPRReg valueGPR; … … 1660 1660 JSValue jsValue = valueOfJSConstant(valueIndex); 1661 1661 if (!jsValue.isNumber()) { 1662 terminateSpeculativeExecution( JSValueRegs(), NoNode);1662 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1663 1663 noResult(m_compileIndex); 1664 1664 return; … … 1735 1735 if (speculationRequirements != NoTypedArrayTypeSpecCheck) { 1736 1736 ASSERT_NOT_REACHED(); 1737 terminateSpeculativeExecution( JSValueRegs(), NoNode);1737 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1738 1738 noResult(m_compileIndex); 1739 1739 return; … … 1776 1776 1777 1777 if (speculationRequirements != NoTypedArrayTypeSpecCheck) 1778 speculationCheck( JSValueSource::unboxedCell(base), baseIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(base), MacroAssembler::TrustedImmPtr(descriptor.m_vptr)));1778 speculationCheck(BadType, JSValueSource::unboxedCell(base), baseIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(base), MacroAssembler::TrustedImmPtr(descriptor.m_vptr))); 1779 1779 1780 1780 GPRTemporary result(this); … … 1811 1811 // Check that prototype is an object. 1812 1812 m_jit.loadPtr(MacroAssembler::Address(prototypeReg, JSCell::structureOffset()), scratchReg); 1813 speculationCheck( JSValueRegs(), NoNode, m_jit.branchIfNotObject(scratchReg));1813 speculationCheck(BadType, JSValueRegs(), NoNode, m_jit.branchIfNotObject(scratchReg)); 1814 1814 1815 1815 // Initialize scratchReg with the value being checked. … … 1965 1965 GPRReg op2Gpr = op2.gpr(); 1966 1966 1967 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTest32(JITCompiler::Zero, op2Gpr));1967 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branchTest32(JITCompiler::Zero, op2Gpr)); 1968 1968 1969 1969 #if CPU(X86) || CPU(X86_64) … … 2093 2093 // domain. 2094 2094 2095 speculationCheck( JSValueRegs(), NoNode, m_jit.branchMul32(MacroAssembler::Overflow, reg1, reg2, result.gpr()));2095 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branchMul32(MacroAssembler::Overflow, reg1, reg2, result.gpr())); 2096 2096 2097 2097 // Check for negative zero, if the users of this node care about such things. 2098 2098 if (!nodeCanIgnoreNegativeZero(node.arithNodeFlags())) { 2099 2099 MacroAssembler::Jump resultNonZero = m_jit.branchTest32(MacroAssembler::NonZero, result.gpr()); 2100 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, reg1, TrustedImm32(0)));2101 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, reg2, TrustedImm32(0)));2100 speculationCheck(NegativeZero, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, reg1, TrustedImm32(0))); 2101 speculationCheck(NegativeZero, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, reg2, TrustedImm32(0))); 2102 2102 resultNonZero.link(&m_jit); 2103 2103 } … … 2323 2323 if (!(basePrediction & PredictInt32) && basePrediction) { 2324 2324 ASSERT_NOT_REACHED(); 2325 terminateSpeculativeExecution( JSValueRegs(), NoNode);2325 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 2326 2326 noResult(m_compileIndex); 2327 2327 return; … … 2332 2332 if (at(node.child1()).prediction() == PredictString) { 2333 2333 if (!isStringPrediction(m_state.forNode(node.child1()).m_type)) 2334 speculationCheck( JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsStringVPtr)));2334 speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsStringVPtr))); 2335 2335 2336 2336 m_jit.loadPtr(MacroAssembler::Address(baseReg, JSString::offsetOfValue()), storageReg); 2337 2337 2338 2338 // Speculate that we're not accessing a rope 2339 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTest32(MacroAssembler::Zero, storageReg));2339 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTest32(MacroAssembler::Zero, storageReg)); 2340 2340 2341 2341 m_jit.loadPtr(MacroAssembler::Address(storageReg, StringImpl::dataOffset()), storageReg); 2342 2342 } else if (at(node.child1()).shouldSpeculateByteArray()) { 2343 2343 if (!isByteArrayPrediction(m_state.forNode(node.child1()).m_type)) 2344 speculationCheck( JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr)));2344 speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr))); 2345 2345 m_jit.loadPtr(MacroAssembler::Address(baseReg, JSByteArray::offsetOfStorage()), storageReg); 2346 2346 } else if (at(node.child1()).shouldSpeculateInt8Array()) { 2347 2347 const TypedArrayDescriptor& descriptor = m_jit.globalData()->int8ArrayDescriptor(); 2348 2348 if (!isInt8ArrayPrediction(m_state.forNode(node.child1()).m_type)) 2349 speculationCheck( JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr)));2349 speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr))); 2350 2350 m_jit.loadPtr(MacroAssembler::Address(baseReg, descriptor.m_storageOffset), storageReg); 2351 2351 } else if (at(node.child1()).shouldSpeculateInt16Array()) { 2352 2352 const TypedArrayDescriptor& descriptor = m_jit.globalData()->int16ArrayDescriptor(); 2353 2353 if (!isInt16ArrayPrediction(m_state.forNode(node.child1()).m_type)) 2354 speculationCheck( JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr)));2354 speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr))); 2355 2355 m_jit.loadPtr(MacroAssembler::Address(baseReg, descriptor.m_storageOffset), storageReg); 2356 2356 } else if (at(node.child1()).shouldSpeculateInt32Array()) { 2357 2357 const TypedArrayDescriptor& descriptor = m_jit.globalData()->int32ArrayDescriptor(); 2358 2358 if (!isInt32ArrayPrediction(m_state.forNode(node.child1()).m_type)) 2359 speculationCheck( JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr)));2359 speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr))); 2360 2360 m_jit.loadPtr(MacroAssembler::Address(baseReg, descriptor.m_storageOffset), storageReg); 2361 2361 } else if (at(node.child1()).shouldSpeculateUint8Array()) { 2362 2362 const TypedArrayDescriptor& descriptor = m_jit.globalData()->uint8ArrayDescriptor(); 2363 2363 if (!isUint8ArrayPrediction(m_state.forNode(node.child1()).m_type)) 2364 speculationCheck( JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr)));2364 speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr))); 2365 2365 m_jit.loadPtr(MacroAssembler::Address(baseReg, descriptor.m_storageOffset), storageReg); 2366 2366 } else if (at(node.child1()).shouldSpeculateUint16Array()) { 2367 2367 const TypedArrayDescriptor& descriptor = m_jit.globalData()->uint16ArrayDescriptor(); 2368 2368 if (!isUint16ArrayPrediction(m_state.forNode(node.child1()).m_type)) 2369 speculationCheck( JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr)));2369 speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr))); 2370 2370 m_jit.loadPtr(MacroAssembler::Address(baseReg, descriptor.m_storageOffset), storageReg); 2371 2371 } else if (at(node.child1()).shouldSpeculateUint32Array()) { 2372 2372 const TypedArrayDescriptor& descriptor = m_jit.globalData()->uint32ArrayDescriptor(); 2373 2373 if (!isUint32ArrayPrediction(m_state.forNode(node.child1()).m_type)) 2374 speculationCheck( JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr)));2374 speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr))); 2375 2375 m_jit.loadPtr(MacroAssembler::Address(baseReg, descriptor.m_storageOffset), storageReg); 2376 2376 } else if (at(node.child1()).shouldSpeculateFloat32Array()) { 2377 2377 const TypedArrayDescriptor& descriptor = m_jit.globalData()->float32ArrayDescriptor(); 2378 2378 if (!isFloat32ArrayPrediction(m_state.forNode(node.child1()).m_type)) 2379 speculationCheck( JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr)));2379 speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr))); 2380 2380 m_jit.loadPtr(MacroAssembler::Address(baseReg, descriptor.m_storageOffset), storageReg); 2381 2381 } else if (at(node.child1()).shouldSpeculateFloat64Array()) { 2382 2382 const TypedArrayDescriptor& descriptor = m_jit.globalData()->float64ArrayDescriptor(); 2383 2383 if (!isFloat64ArrayPrediction(m_state.forNode(node.child1()).m_type)) 2384 speculationCheck( JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr)));2384 speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(descriptor.m_vptr))); 2385 2385 m_jit.loadPtr(MacroAssembler::Address(baseReg, descriptor.m_storageOffset), storageReg); 2386 2386 } else { 2387 2387 if (!isArrayPrediction(m_state.forNode(node.child1()).m_type)) 2388 speculationCheck( JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr)));2388 speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr))); 2389 2389 m_jit.loadPtr(MacroAssembler::Address(baseReg, JSArray::storageOffset()), storageReg); 2390 2390 } -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
r102545 r102694 2030 2030 2031 2031 // Add a speculation check without additional recovery. 2032 void speculationCheck( JSValueSource jsValueSource, NodeIndex nodeIndex, MacroAssembler::Jump jumpToFail)2032 void speculationCheck(ExitKind kind, JSValueSource jsValueSource, NodeIndex nodeIndex, MacroAssembler::Jump jumpToFail) 2033 2033 { 2034 2034 if (!m_compileOkay) 2035 2035 return; 2036 m_jit.codeBlock()->appendOSRExit(OSRExit( jsValueSource, m_jit.valueProfileFor(nodeIndex), jumpToFail, this));2036 m_jit.codeBlock()->appendOSRExit(OSRExit(kind, jsValueSource, m_jit.valueProfileFor(nodeIndex), jumpToFail, this)); 2037 2037 } 2038 2038 // Add a set of speculation checks without additional recovery. 2039 void speculationCheck( JSValueSource jsValueSource, NodeIndex nodeIndex, MacroAssembler::JumpList& jumpsToFail)2039 void speculationCheck(ExitKind kind, JSValueSource jsValueSource, NodeIndex nodeIndex, MacroAssembler::JumpList& jumpsToFail) 2040 2040 { 2041 2041 Vector<MacroAssembler::Jump, 16> JumpVector = jumpsToFail.jumps(); 2042 2042 for (unsigned i = 0; i < JumpVector.size(); ++i) 2043 speculationCheck( jsValueSource, nodeIndex, JumpVector[i]);2043 speculationCheck(kind, jsValueSource, nodeIndex, JumpVector[i]); 2044 2044 } 2045 2045 // Add a speculation check with additional recovery. 2046 void speculationCheck( JSValueSource jsValueSource, NodeIndex nodeIndex, MacroAssembler::Jump jumpToFail, const SpeculationRecovery& recovery)2046 void speculationCheck(ExitKind kind, JSValueSource jsValueSource, NodeIndex nodeIndex, MacroAssembler::Jump jumpToFail, const SpeculationRecovery& recovery) 2047 2047 { 2048 2048 if (!m_compileOkay) 2049 2049 return; 2050 2050 m_jit.codeBlock()->appendSpeculationRecovery(recovery); 2051 m_jit.codeBlock()->appendOSRExit(OSRExit( jsValueSource, m_jit.valueProfileFor(nodeIndex), jumpToFail, this, m_jit.codeBlock()->numberOfSpeculationRecoveries()));2051 m_jit.codeBlock()->appendOSRExit(OSRExit(kind, jsValueSource, m_jit.valueProfileFor(nodeIndex), jumpToFail, this, m_jit.codeBlock()->numberOfSpeculationRecoveries())); 2052 2052 } 2053 2053 2054 2054 // Called when we statically determine that a speculation will fail. 2055 void terminateSpeculativeExecution( JSValueRegs jsValueRegs, NodeIndex nodeIndex)2055 void terminateSpeculativeExecution(ExitKind kind, JSValueRegs jsValueRegs, NodeIndex nodeIndex) 2056 2056 { 2057 2057 #if DFG_ENABLE(DEBUG_VERBOSE) … … 2060 2060 if (!m_compileOkay) 2061 2061 return; 2062 speculationCheck( jsValueRegs, nodeIndex, m_jit.jump());2062 speculationCheck(kind, jsValueRegs, nodeIndex, m_jit.jump()); 2063 2063 m_compileOkay = false; 2064 2064 } -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r102545 r102694 1342 1342 return gpr; 1343 1343 } 1344 terminateSpeculativeExecution( JSValueRegs(), NoNode);1344 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1345 1345 returnFormat = DataFormatInteger; 1346 1346 return allocate(); … … 1354 1354 // If we know this was spilled as an integer we can fill without checking. 1355 1355 if (spillFormat != DataFormatJSInteger) 1356 speculationCheck( JSValueSource(JITCompiler::addressFor(virtualRegister)), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::Int32Tag)));1356 speculationCheck(BadType, JSValueSource(JITCompiler::addressFor(virtualRegister)), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::Int32Tag))); 1357 1357 1358 1358 m_jit.load32(JITCompiler::payloadFor(virtualRegister), gpr); … … 1370 1370 m_gprs.lock(payloadGPR); 1371 1371 if (info.registerFormat() != DataFormatJSInteger) 1372 speculationCheck( JSValueRegs(tagGPR, payloadGPR), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, tagGPR, TrustedImm32(JSValue::Int32Tag)));1372 speculationCheck(BadType, JSValueRegs(tagGPR, payloadGPR), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, tagGPR, TrustedImm32(JSValue::Int32Tag))); 1373 1373 m_gprs.unlock(tagGPR); 1374 1374 m_gprs.release(tagGPR); … … 1394 1394 case DataFormatJSCell: 1395 1395 case DataFormatJSBoolean: { 1396 terminateSpeculativeExecution( JSValueRegs(), NoNode);1396 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1397 1397 returnFormat = DataFormatInteger; 1398 1398 return allocate(); … … 1445 1445 return fpr; 1446 1446 } else { 1447 terminateSpeculativeExecution( JSValueRegs(), NoNode);1447 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1448 1448 return fprAllocate(); 1449 1449 } … … 1461 1461 FPRReg fpr = fprAllocate(); 1462 1462 JITCompiler::Jump isInteger = m_jit.branch32(MacroAssembler::Equal, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::Int32Tag)); 1463 speculationCheck( JSValueSource(JITCompiler::addressFor(virtualRegister)), nodeIndex, m_jit.branch32(MacroAssembler::AboveOrEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::LowestTag)));1463 speculationCheck(BadType, JSValueSource(JITCompiler::addressFor(virtualRegister)), nodeIndex, m_jit.branch32(MacroAssembler::AboveOrEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::LowestTag))); 1464 1464 m_jit.loadDouble(JITCompiler::addressFor(virtualRegister), fpr); 1465 1465 JITCompiler::Jump hasUnboxedDouble = m_jit.jump(); … … 1483 1483 1484 1484 case DataFormatCell: 1485 terminateSpeculativeExecution( JSValueRegs(), NoNode);1485 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1486 1486 return fprAllocate(); 1487 1487 … … 1502 1502 FPRTemporary scratch(this); 1503 1503 JITCompiler::Jump isInteger = m_jit.branch32(MacroAssembler::Equal, tagGPR, TrustedImm32(JSValue::Int32Tag)); 1504 speculationCheck( JSValueRegs(tagGPR, payloadGPR), nodeIndex, m_jit.branch32(MacroAssembler::AboveOrEqual, tagGPR, TrustedImm32(JSValue::LowestTag)));1504 speculationCheck(BadType, JSValueRegs(tagGPR, payloadGPR), nodeIndex, m_jit.branch32(MacroAssembler::AboveOrEqual, tagGPR, TrustedImm32(JSValue::LowestTag))); 1505 1505 unboxDouble(tagGPR, payloadGPR, fpr, scratch.fpr()); 1506 1506 hasUnboxedDouble = m_jit.jump(); … … 1565 1565 return gpr; 1566 1566 } 1567 terminateSpeculativeExecution( JSValueRegs(), NoNode);1567 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1568 1568 return gpr; 1569 1569 } 1570 1570 ASSERT(info.spillFormat() & DataFormatJS); 1571 1571 if (info.spillFormat() != DataFormatJSCell) 1572 speculationCheck( JSValueSource(JITCompiler::addressFor(virtualRegister)), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::CellTag)));1572 speculationCheck(BadType, JSValueSource(JITCompiler::addressFor(virtualRegister)), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::CellTag))); 1573 1573 m_jit.load32(JITCompiler::payloadFor(virtualRegister), gpr); 1574 1574 m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled); … … 1590 1590 m_gprs.lock(payloadGPR); 1591 1591 if (info.spillFormat() != DataFormatJSCell) 1592 speculationCheck( JSValueRegs(tagGPR, payloadGPR), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, tagGPR, TrustedImm32(JSValue::CellTag)));1592 speculationCheck(BadType, JSValueRegs(tagGPR, payloadGPR), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, tagGPR, TrustedImm32(JSValue::CellTag))); 1593 1593 m_gprs.unlock(tagGPR); 1594 1594 m_gprs.release(tagGPR); … … 1605 1605 case DataFormatJSBoolean: 1606 1606 case DataFormatBoolean: { 1607 terminateSpeculativeExecution( JSValueRegs(), NoNode);1607 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1608 1608 return allocate(); 1609 1609 } … … 1638 1638 return gpr; 1639 1639 } 1640 terminateSpeculativeExecution( JSValueRegs(), NoNode);1640 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1641 1641 return gpr; 1642 1642 } … … 1645 1645 1646 1646 if (info.spillFormat() != DataFormatJSBoolean) 1647 speculationCheck( JSValueSource(JITCompiler::addressFor(virtualRegister)), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::BooleanTag)));1647 speculationCheck(BadType, JSValueSource(JITCompiler::addressFor(virtualRegister)), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::BooleanTag))); 1648 1648 1649 1649 m_jit.load32(JITCompiler::payloadFor(virtualRegister), gpr); … … 1665 1665 m_gprs.lock(payloadGPR); 1666 1666 if (info.registerFormat() != DataFormatJSBoolean) 1667 speculationCheck( JSValueRegs(tagGPR, payloadGPR), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, tagGPR, TrustedImm32(JSValue::BooleanTag)));1667 speculationCheck(BadType, JSValueRegs(tagGPR, payloadGPR), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, tagGPR, TrustedImm32(JSValue::BooleanTag))); 1668 1668 1669 1669 m_gprs.unlock(tagGPR); … … 1681 1681 case DataFormatJSCell: 1682 1682 case DataFormatCell: { 1683 terminateSpeculativeExecution( JSValueRegs(), NoNode);1683 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1684 1684 return allocate(); 1685 1685 } … … 1722 1722 1723 1723 if (!predictionCheck(m_state.forNode(node.child1()).m_type)) 1724 speculationCheck( JSValueSource::unboxedCell(op1GPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(op1GPR), MacroAssembler::TrustedImmPtr(vptr)));1724 speculationCheck(BadType, JSValueSource::unboxedCell(op1GPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(op1GPR), MacroAssembler::TrustedImmPtr(vptr))); 1725 1725 if (!predictionCheck(m_state.forNode(node.child2()).m_type)) 1726 speculationCheck( JSValueSource::unboxedCell(op2GPR), node.child2(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(op2GPR), MacroAssembler::TrustedImmPtr(vptr)));1726 speculationCheck(BadType, JSValueSource::unboxedCell(op2GPR), node.child2(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(op2GPR), MacroAssembler::TrustedImmPtr(vptr))); 1727 1727 1728 1728 MacroAssembler::Jump falseCase = m_jit.branchPtr(MacroAssembler::NotEqual, op1GPR, op2GPR); … … 1794 1794 MacroAssembler::Jump notCell = m_jit.branch32(MacroAssembler::NotEqual, valueTagGPR, TrustedImm32(JSValue::CellTag)); 1795 1795 if (needSpeculationCheck) 1796 speculationCheck( JSValueRegs(valueTagGPR, valuePayloadGPR), nodeIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(valuePayloadGPR), MacroAssembler::TrustedImmPtr(vptr)));1796 speculationCheck(BadType, JSValueRegs(valueTagGPR, valuePayloadGPR), nodeIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(valuePayloadGPR), MacroAssembler::TrustedImmPtr(vptr))); 1797 1797 m_jit.move(TrustedImm32(0), resultPayloadGPR); 1798 1798 MacroAssembler::Jump done = m_jit.jump(); … … 1804 1804 m_jit.move(valueTagGPR, resultPayloadGPR); 1805 1805 m_jit.or32(TrustedImm32(1), resultPayloadGPR); 1806 speculationCheck( JSValueRegs(valueTagGPR, valuePayloadGPR), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, resultPayloadGPR, TrustedImm32(JSValue::NullTag)));1806 speculationCheck(BadType, JSValueRegs(valueTagGPR, valuePayloadGPR), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, resultPayloadGPR, TrustedImm32(JSValue::NullTag))); 1807 1807 } 1808 1808 m_jit.move(TrustedImm32(1), resultPayloadGPR); … … 1882 1882 MacroAssembler::Jump notCell = m_jit.branch32(MacroAssembler::NotEqual, valueTagGPR, TrustedImm32(JSValue::CellTag)); 1883 1883 if (needSpeculationCheck) 1884 speculationCheck( JSValueRegs(valueTagGPR, valuePayloadGPR), nodeIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(valuePayloadGPR), MacroAssembler::TrustedImmPtr(vptr)));1884 speculationCheck(BadType, JSValueRegs(valueTagGPR, valuePayloadGPR), nodeIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(valuePayloadGPR), MacroAssembler::TrustedImmPtr(vptr))); 1885 1885 addBranch(m_jit.jump(), taken); 1886 1886 … … 1891 1891 m_jit.move(valueTagGPR, scratchGPR); 1892 1892 m_jit.or32(TrustedImm32(1), scratchGPR); 1893 speculationCheck( JSValueRegs(valueTagGPR, valuePayloadGPR), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, scratchGPR, TrustedImm32(JSValue::NullTag)));1893 speculationCheck(BadType, JSValueRegs(valueTagGPR, valuePayloadGPR), nodeIndex, m_jit.branch32(MacroAssembler::NotEqual, scratchGPR, TrustedImm32(JSValue::NullTag))); 1894 1894 } 1895 1895 … … 1999 1999 // If we have no prediction for this local, then don't attempt to compile. 2000 2000 if (prediction == PredictNone) { 2001 terminateSpeculativeExecution( JSValueRegs(), NoNode);2001 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 2002 2002 break; 2003 2003 } … … 2081 2081 GPRReg cellGPR = cell.gpr(); 2082 2082 if (!isArrayPrediction(m_state.forNode(node.child1()).m_type)) 2083 speculationCheck( JSValueSource::unboxedCell(cellGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(cellGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr)));2083 speculationCheck(BadType, JSValueSource::unboxedCell(cellGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(cellGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr))); 2084 2084 m_jit.storePtr(cellGPR, JITCompiler::payloadFor(node.local())); 2085 2085 noResult(m_compileIndex); … … 2088 2088 GPRReg cellGPR = cell.gpr(); 2089 2089 if (!isByteArrayPrediction(m_state.forNode(node.child1()).m_type)) 2090 speculationCheck( JSValueSource::unboxedCell(cellGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(cellGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr)));2090 speculationCheck(BadType, JSValueSource::unboxedCell(cellGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(cellGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr))); 2091 2091 m_jit.storePtr(cellGPR, JITCompiler::payloadFor(node.local())); 2092 2092 noResult(m_compileIndex); … … 2194 2194 2195 2195 // Test the operand is positive. 2196 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, op1.gpr(), TrustedImm32(0)));2196 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, op1.gpr(), TrustedImm32(0))); 2197 2197 2198 2198 m_jit.move(op1.gpr(), result.gpr()); … … 2242 2242 m_jit.add32(Imm32(imm1), result.gpr()); 2243 2243 } else 2244 speculationCheck( JSValueRegs(), NoNode, m_jit.branchAdd32(MacroAssembler::Overflow, op2.gpr(), Imm32(imm1), result.gpr()));2244 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branchAdd32(MacroAssembler::Overflow, op2.gpr(), Imm32(imm1), result.gpr())); 2245 2245 2246 2246 integerResult(result.gpr(), m_compileIndex); … … 2257 2257 m_jit.add32(Imm32(imm2), result.gpr()); 2258 2258 } else 2259 speculationCheck( JSValueRegs(), NoNode, m_jit.branchAdd32(MacroAssembler::Overflow, op1.gpr(), Imm32(imm2), result.gpr()));2259 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branchAdd32(MacroAssembler::Overflow, op1.gpr(), Imm32(imm2), result.gpr())); 2260 2260 2261 2261 integerResult(result.gpr(), m_compileIndex); … … 2282 2282 2283 2283 if (gpr1 == gprResult) 2284 speculationCheck( JSValueRegs(), NoNode, check, SpeculationRecovery(SpeculativeAdd, gprResult, gpr2));2284 speculationCheck(Overflow, JSValueRegs(), NoNode, check, SpeculationRecovery(SpeculativeAdd, gprResult, gpr2)); 2285 2285 else if (gpr2 == gprResult) 2286 speculationCheck( JSValueRegs(), NoNode, check, SpeculationRecovery(SpeculativeAdd, gprResult, gpr1));2286 speculationCheck(Overflow, JSValueRegs(), NoNode, check, SpeculationRecovery(SpeculativeAdd, gprResult, gpr1)); 2287 2287 else 2288 speculationCheck( JSValueRegs(), NoNode, check);2288 speculationCheck(Overflow, JSValueRegs(), NoNode, check); 2289 2289 } 2290 2290 … … 2322 2322 m_jit.sub32(Imm32(imm2), result.gpr()); 2323 2323 } else 2324 speculationCheck( JSValueRegs(), NoNode, m_jit.branchSub32(MacroAssembler::Overflow, op1.gpr(), Imm32(imm2), result.gpr()));2324 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branchSub32(MacroAssembler::Overflow, op1.gpr(), Imm32(imm2), result.gpr())); 2325 2325 2326 2326 integerResult(result.gpr(), m_compileIndex); … … 2336 2336 m_jit.sub32(op2.gpr(), result.gpr()); 2337 2337 } else 2338 speculationCheck( JSValueRegs(), NoNode, m_jit.branchSub32(MacroAssembler::Overflow, op1.gpr(), op2.gpr(), result.gpr()));2338 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branchSub32(MacroAssembler::Overflow, op1.gpr(), op2.gpr(), result.gpr())); 2339 2339 2340 2340 integerResult(result.gpr(), m_compileIndex); … … 2369 2369 GPRReg op2GPR = op2.gpr(); 2370 2370 2371 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTest32(JITCompiler::Zero, op2GPR));2371 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branchTest32(JITCompiler::Zero, op2GPR)); 2372 2372 2373 2373 // If the user cares about negative zero, then speculate that we're not about … … 2375 2375 if (!nodeCanIgnoreNegativeZero(node.arithNodeFlags())) { 2376 2376 MacroAssembler::Jump numeratorNonZero = m_jit.branchTest32(MacroAssembler::NonZero, op1GPR); 2377 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, op2GPR, TrustedImm32(0)));2377 speculationCheck(NegativeZero, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, op2GPR, TrustedImm32(0))); 2378 2378 numeratorNonZero.link(&m_jit); 2379 2379 } … … 2395 2395 // Check that there was no remainder. If there had been, then we'd be obligated to 2396 2396 // produce a double result instead. 2397 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTest32(JITCompiler::NonZero, edx.gpr()));2397 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branchTest32(JITCompiler::NonZero, edx.gpr())); 2398 2398 2399 2399 integerResult(eax.gpr(), m_compileIndex); … … 2415 2415 JITCompiler::JumpList failureCases; 2416 2416 m_jit.branchConvertDoubleToInt32(resultFPR, resultGPR, failureCases, scratchFPR); 2417 speculationCheck( JSValueRegs(), NoNode, failureCases);2417 speculationCheck(Overflow, JSValueRegs(), NoNode, failureCases); 2418 2418 2419 2419 integerResult(resultGPR, m_compileIndex); … … 2449 2449 m_jit.add32(scratch.gpr(), result.gpr()); 2450 2450 m_jit.xor32(scratch.gpr(), result.gpr()); 2451 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::Equal, result.gpr(), MacroAssembler::TrustedImm32(1 << 31)));2451 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::Equal, result.gpr(), MacroAssembler::TrustedImm32(1 << 31))); 2452 2452 integerResult(result.gpr(), m_compileIndex); 2453 2453 break; … … 2686 2686 GPRReg baseReg = base.gpr(); 2687 2687 if (!isArrayPrediction(m_state.forNode(node.child1()).m_type)) 2688 speculationCheck( JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr)));2689 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset())));2688 speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr))); 2689 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset()))); 2690 2690 } 2691 2691 … … 2694 2694 // then we'll need to allocate a new temporary for result. 2695 2695 m_jit.load32(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), resultTag.gpr()); 2696 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::Equal, resultTag.gpr(), TrustedImm32(JSValue::EmptyValueTag)));2696 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::Equal, resultTag.gpr(), TrustedImm32(JSValue::EmptyValueTag))); 2697 2697 m_jit.load32(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), resultPayload.gpr()); 2698 2698 … … 2805 2805 // If we have predicted the base to be type array, we can skip the check. 2806 2806 if (!isArrayPrediction(m_state.forNode(node.child1()).m_type)) 2807 speculationCheck( JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr)));2807 speculationCheck(BadType, JSValueSource::unboxedCell(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr))); 2808 2808 2809 2809 base.use(); … … 2949 2949 2950 2950 if (!isArrayPrediction(m_state.forNode(node.child1()).m_type)) 2951 speculationCheck( JSValueSource::unboxedCell(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr)));2951 speculationCheck(BadType, JSValueSource::unboxedCell(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr))); 2952 2952 2953 2953 m_jit.loadPtr(MacroAssembler::Address(baseGPR, JSArray::storageOffset()), storageGPR); … … 2955 2955 2956 2956 // Refuse to handle bizarre lengths. 2957 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::Above, storageLengthGPR, TrustedImm32(0x7ffffffe)));2957 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::Above, storageLengthGPR, TrustedImm32(0x7ffffffe))); 2958 2958 2959 2959 MacroAssembler::Jump slowPath = m_jit.branch32(MacroAssembler::AboveOrEqual, storageLengthGPR, MacroAssembler::Address(baseGPR, JSArray::vectorLengthOffset())); … … 2995 2995 2996 2996 if (!isArrayPrediction(m_state.forNode(node.child1()).m_type)) 2997 speculationCheck( JSValueSource::unboxedCell(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr)));2997 speculationCheck(BadType, JSValueSource::unboxedCell(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr))); 2998 2998 2999 2999 m_jit.loadPtr(MacroAssembler::Address(baseGPR, JSArray::storageOffset()), storageGPR); … … 3116 3116 // We expect that throw statements are rare and are intended to exit the code block 3117 3117 // anyway, so we just OSR back to the old JIT for now. 3118 terminateSpeculativeExecution( JSValueRegs(), NoNode);3118 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 3119 3119 break; 3120 3120 } … … 3264 3264 // This is hard. It would be better to save the value, but we can't quite do it, 3265 3265 // since this operation does not otherwise get the payload. 3266 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, scratchGPR, TrustedImm32(JSValue::NullTag)));3266 speculationCheck(BadType, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::NotEqual, scratchGPR, TrustedImm32(JSValue::NullTag))); 3267 3267 3268 3268 m_jit.move(MacroAssembler::TrustedImmPtr(m_jit.globalObjectFor(node.codeOrigin)), scratchGPR); … … 3278 3278 3279 3279 if (!isObjectPrediction(m_state.forNode(node.child1()).m_type)) 3280 speculationCheck( JSValueSource::unboxedCell(thisValueGPR), node.child1(), m_jit.branchPtr(JITCompiler::Equal, JITCompiler::Address(thisValueGPR), JITCompiler::TrustedImmPtr(m_jit.globalData()->jsStringVPtr)));3280 speculationCheck(BadType, JSValueSource::unboxedCell(thisValueGPR), node.child1(), m_jit.branchPtr(JITCompiler::Equal, JITCompiler::Address(thisValueGPR), JITCompiler::TrustedImmPtr(m_jit.globalData()->jsStringVPtr))); 3281 3281 3282 3282 m_jit.move(thisValueGPR, resultGPR); … … 3323 3323 if (at(node.child1()).shouldSpeculateFinalObject()) { 3324 3324 if (!isFinalObjectPrediction(m_state.forNode(node.child1()).m_type)) 3325 speculationCheck( JSValueSource::unboxedCell(protoGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(protoGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsFinalObjectVPtr)));3325 speculationCheck(BadType, JSValueSource::unboxedCell(protoGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(protoGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsFinalObjectVPtr))); 3326 3326 } else { 3327 3327 m_jit.loadPtr(MacroAssembler::Address(protoGPR, JSCell::structureOffset()), scratchGPR); … … 3435 3435 case GetById: { 3436 3436 if (!node.prediction()) { 3437 terminateSpeculativeExecution( JSValueRegs(), NoNode);3437 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 3438 3438 break; 3439 3439 } … … 3495 3495 3496 3496 if (!isArrayPrediction(m_state.forNode(node.child1()).m_type)) 3497 speculationCheck( JSValueSource::unboxedCell(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr)));3497 speculationCheck(BadType, JSValueSource::unboxedCell(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr))); 3498 3498 3499 3499 m_jit.loadPtr(MacroAssembler::Address(baseGPR, JSArray::storageOffset()), resultGPR); 3500 3500 m_jit.load32(MacroAssembler::Address(resultGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)), resultGPR); 3501 3501 3502 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, resultGPR, MacroAssembler::TrustedImm32(0)));3502 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, resultGPR, MacroAssembler::TrustedImm32(0))); 3503 3503 3504 3504 integerResult(resultGPR, m_compileIndex); … … 3514 3514 3515 3515 if (!isStringPrediction(m_state.forNode(node.child1()).m_type)) 3516 speculationCheck( JSValueSource::unboxedCell(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsStringVPtr)));3516 speculationCheck(BadType, JSValueSource::unboxedCell(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsStringVPtr))); 3517 3517 3518 3518 m_jit.load32(MacroAssembler::Address(baseGPR, JSString::offsetOfLength()), resultGPR); … … 3530 3530 3531 3531 if (!isByteArrayPrediction(m_state.forNode(node.child1()).m_type)) 3532 speculationCheck( JSValueSource::unboxedCell(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr)));3532 speculationCheck(BadType, JSValueSource::unboxedCell(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr))); 3533 3533 3534 3534 m_jit.loadPtr(MacroAssembler::Address(baseGPR, JSByteArray::offsetOfStorage()), resultGPR); … … 3573 3573 case CheckFunction: { 3574 3574 SpeculateCellOperand function(this, node.child1()); 3575 speculationCheck( JSValueRegs(), NoNode, m_jit.branchWeakPtr(JITCompiler::NotEqual, function.gpr(), node.function()));3575 speculationCheck(BadCache, JSValueRegs(), NoNode, m_jit.branchWeakPtr(JITCompiler::NotEqual, function.gpr(), node.function())); 3576 3576 noResult(m_compileIndex); 3577 3577 break; … … 3589 3589 3590 3590 if (node.structureSet().size() == 1) 3591 speculationCheck( JSValueRegs(), NoNode, m_jit.branchWeakPtr(JITCompiler::NotEqual, JITCompiler::Address(base.gpr(), JSCell::structureOffset()), node.structureSet()[0]));3591 speculationCheck(BadCache, JSValueRegs(), NoNode, m_jit.branchWeakPtr(JITCompiler::NotEqual, JITCompiler::Address(base.gpr(), JSCell::structureOffset()), node.structureSet()[0])); 3592 3592 else { 3593 3593 GPRTemporary structure(this); … … 3600 3600 done.append(m_jit.branchWeakPtr(JITCompiler::Equal, structure.gpr(), node.structureSet()[i])); 3601 3601 3602 speculationCheck( JSValueRegs(), NoNode, m_jit.branchWeakPtr(JITCompiler::NotEqual, structure.gpr(), node.structureSet().last()));3602 speculationCheck(BadCache, JSValueRegs(), NoNode, m_jit.branchWeakPtr(JITCompiler::NotEqual, structure.gpr(), node.structureSet().last())); 3603 3603 3604 3604 done.link(&m_jit); … … 3766 3766 // Speculate that base 'ImplementsDefaultHasInstance'. 3767 3767 m_jit.loadPtr(MacroAssembler::Address(base.gpr(), JSCell::structureOffset()), structure.gpr()); 3768 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTest8(MacroAssembler::Zero, MacroAssembler::Address(structure.gpr(), Structure::typeInfoFlagsOffset()), MacroAssembler::TrustedImm32(ImplementsDefaultHasInstance)));3768 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTest8(MacroAssembler::Zero, MacroAssembler::Address(structure.gpr(), Structure::typeInfoFlagsOffset()), MacroAssembler::TrustedImm32(ImplementsDefaultHasInstance))); 3769 3769 3770 3770 noResult(m_compileIndex); … … 3862 3862 3863 3863 case ForceOSRExit: { 3864 terminateSpeculativeExecution( JSValueRegs(), NoNode);3864 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 3865 3865 break; 3866 3866 } -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r102545 r102694 1283 1283 case DataFormatNone: { 1284 1284 if ((node.hasConstant() && !isInt32Constant(nodeIndex)) || info.spillFormat() == DataFormatDouble) { 1285 terminateSpeculativeExecution( JSValueRegs(), NoNode);1285 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1286 1286 returnFormat = DataFormatInteger; 1287 1287 return allocate(); … … 1333 1333 GPRReg gpr = info.gpr(); 1334 1334 m_gprs.lock(gpr); 1335 speculationCheck( JSValueRegs(gpr), nodeIndex, m_jit.branchPtr(MacroAssembler::Below, gpr, GPRInfo::tagTypeNumberRegister));1335 speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchPtr(MacroAssembler::Below, gpr, GPRInfo::tagTypeNumberRegister)); 1336 1336 info.fillJSValue(gpr, DataFormatJSInteger); 1337 1337 // If !strict we're done, return. … … 1390 1390 case DataFormatJSCell: 1391 1391 case DataFormatJSBoolean: { 1392 terminateSpeculativeExecution( JSValueRegs(), NoNode);1392 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1393 1393 returnFormat = DataFormatInteger; 1394 1394 return allocate(); … … 1449 1449 return fpr; 1450 1450 } 1451 terminateSpeculativeExecution( JSValueRegs(), NoNode);1451 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1452 1452 return fprAllocate(); 1453 1453 } … … 1492 1492 1493 1493 case DataFormatCell: 1494 terminateSpeculativeExecution( JSValueRegs(), NoNode);1494 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1495 1495 return fprAllocate(); 1496 1496 … … 1505 1505 JITCompiler::Jump isInteger = m_jit.branchPtr(MacroAssembler::AboveOrEqual, jsValueGpr, GPRInfo::tagTypeNumberRegister); 1506 1506 1507 speculationCheck( JSValueRegs(jsValueGpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::Zero, jsValueGpr, GPRInfo::tagTypeNumberRegister));1507 speculationCheck(BadType, JSValueRegs(jsValueGpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::Zero, jsValueGpr, GPRInfo::tagTypeNumberRegister)); 1508 1508 1509 1509 // First, if we get here we have a double encoded as a JSValue … … 1579 1579 case DataFormatNone: { 1580 1580 if (info.spillFormat() == DataFormatInteger || info.spillFormat() == DataFormatDouble) { 1581 terminateSpeculativeExecution( JSValueRegs(), NoNode);1581 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1582 1582 return allocate(); 1583 1583 } … … 1593 1593 return gpr; 1594 1594 } 1595 terminateSpeculativeExecution( JSValueRegs(), NoNode);1595 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1596 1596 return gpr; 1597 1597 } … … 1602 1602 info.fillJSValue(gpr, DataFormatJS); 1603 1603 if (info.spillFormat() != DataFormatJSCell) 1604 speculationCheck( JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, GPRInfo::tagMaskRegister));1604 speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, GPRInfo::tagMaskRegister)); 1605 1605 info.fillJSValue(gpr, DataFormatJSCell); 1606 1606 return gpr; … … 1617 1617 GPRReg gpr = info.gpr(); 1618 1618 m_gprs.lock(gpr); 1619 speculationCheck( JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, GPRInfo::tagMaskRegister));1619 speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, GPRInfo::tagMaskRegister)); 1620 1620 info.fillJSValue(gpr, DataFormatJSCell); 1621 1621 return gpr; … … 1628 1628 case DataFormatJSBoolean: 1629 1629 case DataFormatBoolean: { 1630 terminateSpeculativeExecution( JSValueRegs(), NoNode);1630 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1631 1631 return allocate(); 1632 1632 } … … 1652 1652 case DataFormatNone: { 1653 1653 if (info.spillFormat() == DataFormatInteger || info.spillFormat() == DataFormatDouble) { 1654 terminateSpeculativeExecution( JSValueRegs(), NoNode);1654 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1655 1655 return allocate(); 1656 1656 } … … 1666 1666 return gpr; 1667 1667 } 1668 terminateSpeculativeExecution( JSValueRegs(), NoNode);1668 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1669 1669 return gpr; 1670 1670 } … … 1676 1676 if (info.spillFormat() != DataFormatJSBoolean) { 1677 1677 m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr); 1678 speculationCheck( JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, TrustedImm32(static_cast<int32_t>(~1))), SpeculationRecovery(BooleanSpeculationCheck, gpr, InvalidGPRReg));1678 speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, TrustedImm32(static_cast<int32_t>(~1))), SpeculationRecovery(BooleanSpeculationCheck, gpr, InvalidGPRReg)); 1679 1679 m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr); 1680 1680 } … … 1694 1694 m_gprs.lock(gpr); 1695 1695 m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr); 1696 speculationCheck( JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, TrustedImm32(static_cast<int32_t>(~1))), SpeculationRecovery(BooleanSpeculationCheck, gpr, InvalidGPRReg));1696 speculationCheck(BadType, JSValueRegs(gpr), nodeIndex, m_jit.branchTestPtr(MacroAssembler::NonZero, gpr, TrustedImm32(static_cast<int32_t>(~1))), SpeculationRecovery(BooleanSpeculationCheck, gpr, InvalidGPRReg)); 1697 1697 m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), gpr); 1698 1698 info.fillJSValue(gpr, DataFormatJSBoolean); … … 1706 1706 case DataFormatJSCell: 1707 1707 case DataFormatCell: { 1708 terminateSpeculativeExecution( JSValueRegs(), NoNode);1708 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 1709 1709 return allocate(); 1710 1710 } … … 1749 1749 1750 1750 if (!predictionCheck(m_state.forNode(node.child1()).m_type)) 1751 speculationCheck( JSValueRegs(op1GPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(op1GPR), MacroAssembler::TrustedImmPtr(vptr)));1751 speculationCheck(BadType, JSValueRegs(op1GPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(op1GPR), MacroAssembler::TrustedImmPtr(vptr))); 1752 1752 if (!predictionCheck(m_state.forNode(node.child2()).m_type)) 1753 speculationCheck( JSValueRegs(op2GPR), node.child2(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(op2GPR), MacroAssembler::TrustedImmPtr(vptr)));1753 speculationCheck(BadType, JSValueRegs(op2GPR), node.child2(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(op2GPR), MacroAssembler::TrustedImmPtr(vptr))); 1754 1754 1755 1755 MacroAssembler::Jump falseCase = m_jit.branchPtr(MacroAssembler::NotEqual, op1GPR, op2GPR); … … 1818 1818 MacroAssembler::Jump notCell = m_jit.branchTestPtr(MacroAssembler::NonZero, valueGPR, GPRInfo::tagMaskRegister); 1819 1819 if (needSpeculationCheck) 1820 speculationCheck( JSValueRegs(valueGPR), nodeIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(valueGPR), MacroAssembler::TrustedImmPtr(vptr)));1820 speculationCheck(BadType, JSValueRegs(valueGPR), nodeIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(valueGPR), MacroAssembler::TrustedImmPtr(vptr))); 1821 1821 m_jit.move(TrustedImm32(static_cast<int32_t>(ValueFalse)), resultGPR); 1822 1822 MacroAssembler::Jump done = m_jit.jump(); … … 1827 1827 m_jit.move(valueGPR, resultGPR); 1828 1828 m_jit.andPtr(MacroAssembler::TrustedImm32(~TagBitUndefined), resultGPR); 1829 speculationCheck( JSValueRegs(valueGPR), nodeIndex, m_jit.branchPtr(MacroAssembler::NotEqual, resultGPR, MacroAssembler::TrustedImmPtr(reinterpret_cast<void*>(ValueNull))));1829 speculationCheck(BadType, JSValueRegs(valueGPR), nodeIndex, m_jit.branchPtr(MacroAssembler::NotEqual, resultGPR, MacroAssembler::TrustedImmPtr(reinterpret_cast<void*>(ValueNull)))); 1830 1830 } 1831 1831 m_jit.move(TrustedImm32(static_cast<int32_t>(ValueTrue)), resultGPR); … … 1883 1883 m_jit.move(value.gpr(), result.gpr()); 1884 1884 m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueFalse)), result.gpr()); 1885 speculationCheck( JSValueRegs(value.gpr()), node.child1(), m_jit.branchTestPtr(JITCompiler::NonZero, result.gpr(), TrustedImm32(static_cast<int32_t>(~1))));1885 speculationCheck(BadType, JSValueRegs(value.gpr()), node.child1(), m_jit.branchTestPtr(JITCompiler::NonZero, result.gpr(), TrustedImm32(static_cast<int32_t>(~1)))); 1886 1886 m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(ValueTrue)), result.gpr()); 1887 1887 … … 1922 1922 MacroAssembler::Jump notCell = m_jit.branchTestPtr(MacroAssembler::NonZero, valueGPR, GPRInfo::tagMaskRegister); 1923 1923 if (needSpeculationCheck) 1924 speculationCheck( JSValueRegs(valueGPR), nodeIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(valueGPR), MacroAssembler::TrustedImmPtr(vptr)));1924 speculationCheck(BadType, JSValueRegs(valueGPR), nodeIndex, m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(valueGPR), MacroAssembler::TrustedImmPtr(vptr))); 1925 1925 addBranch(m_jit.jump(), taken); 1926 1926 … … 1930 1930 m_jit.move(valueGPR, scratchGPR); 1931 1931 m_jit.andPtr(MacroAssembler::TrustedImm32(~TagBitUndefined), scratchGPR); 1932 speculationCheck( JSValueRegs(valueGPR), nodeIndex, m_jit.branchPtr(MacroAssembler::NotEqual, scratchGPR, MacroAssembler::TrustedImmPtr(reinterpret_cast<void*>(ValueNull))));1932 speculationCheck(BadType, JSValueRegs(valueGPR), nodeIndex, m_jit.branchPtr(MacroAssembler::NotEqual, scratchGPR, MacroAssembler::TrustedImmPtr(reinterpret_cast<void*>(ValueNull)))); 1933 1933 } 1934 1934 if (notTaken != (m_block + 1)) … … 1998 1998 addBranch(m_jit.branchPtr(MacroAssembler::Equal, valueGPR, MacroAssembler::ImmPtr(JSValue::encode(jsBoolean(true)))), taken); 1999 1999 2000 speculationCheck( JSValueRegs(valueGPR), node.child1(), m_jit.jump());2000 speculationCheck(BadType, JSValueRegs(valueGPR), node.child1(), m_jit.jump()); 2001 2001 value.use(); 2002 2002 } else { … … 2044 2044 // If we have no prediction for this local, then don't attempt to compile. 2045 2045 if (prediction == PredictNone || value.isClear()) { 2046 terminateSpeculativeExecution( JSValueRegs(), NoNode);2046 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 2047 2047 break; 2048 2048 } … … 2114 2114 GPRReg cellGPR = cell.gpr(); 2115 2115 if (!isArrayPrediction(m_state.forNode(node.child1()).m_type)) 2116 speculationCheck( JSValueRegs(cellGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(cellGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr)));2116 speculationCheck(BadType, JSValueRegs(cellGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(cellGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr))); 2117 2117 m_jit.storePtr(cellGPR, JITCompiler::addressFor(node.local())); 2118 2118 noResult(m_compileIndex); … … 2121 2121 GPRReg cellGPR = cell.gpr(); 2122 2122 if (!isByteArrayPrediction(m_state.forNode(node.child1()).m_type)) 2123 speculationCheck( JSValueRegs(cellGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(cellGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr)));2123 speculationCheck(BadType, JSValueRegs(cellGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(cellGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr))); 2124 2124 m_jit.storePtr(cellGPR, JITCompiler::addressFor(node.local())); 2125 2125 noResult(m_compileIndex); … … 2226 2226 2227 2227 // Test the operand is positive. 2228 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, op1.gpr(), TrustedImm32(0)));2228 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, op1.gpr(), TrustedImm32(0))); 2229 2229 2230 2230 m_jit.move(op1.gpr(), result.gpr()); … … 2274 2274 m_jit.add32(Imm32(imm1), result.gpr()); 2275 2275 } else 2276 speculationCheck( JSValueRegs(), NoNode, m_jit.branchAdd32(MacroAssembler::Overflow, op2.gpr(), Imm32(imm1), result.gpr()));2276 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branchAdd32(MacroAssembler::Overflow, op2.gpr(), Imm32(imm1), result.gpr())); 2277 2277 2278 2278 integerResult(result.gpr(), m_compileIndex); … … 2289 2289 m_jit.add32(Imm32(imm2), result.gpr()); 2290 2290 } else 2291 speculationCheck( JSValueRegs(), NoNode, m_jit.branchAdd32(MacroAssembler::Overflow, op1.gpr(), Imm32(imm2), result.gpr()));2291 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branchAdd32(MacroAssembler::Overflow, op1.gpr(), Imm32(imm2), result.gpr())); 2292 2292 2293 2293 integerResult(result.gpr(), m_compileIndex); … … 2314 2314 2315 2315 if (gpr1 == gprResult) 2316 speculationCheck( JSValueRegs(), NoNode, check, SpeculationRecovery(SpeculativeAdd, gprResult, gpr2));2316 speculationCheck(Overflow, JSValueRegs(), NoNode, check, SpeculationRecovery(SpeculativeAdd, gprResult, gpr2)); 2317 2317 else if (gpr2 == gprResult) 2318 speculationCheck( JSValueRegs(), NoNode, check, SpeculationRecovery(SpeculativeAdd, gprResult, gpr1));2318 speculationCheck(Overflow, JSValueRegs(), NoNode, check, SpeculationRecovery(SpeculativeAdd, gprResult, gpr1)); 2319 2319 else 2320 speculationCheck( JSValueRegs(), NoNode, check);2320 speculationCheck(Overflow, JSValueRegs(), NoNode, check); 2321 2321 } 2322 2322 … … 2354 2354 m_jit.sub32(Imm32(imm2), result.gpr()); 2355 2355 } else 2356 speculationCheck( JSValueRegs(), NoNode, m_jit.branchSub32(MacroAssembler::Overflow, op1.gpr(), Imm32(imm2), result.gpr()));2356 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branchSub32(MacroAssembler::Overflow, op1.gpr(), Imm32(imm2), result.gpr())); 2357 2357 2358 2358 integerResult(result.gpr(), m_compileIndex); … … 2368 2368 m_jit.sub32(op2.gpr(), result.gpr()); 2369 2369 } else 2370 speculationCheck( JSValueRegs(), NoNode, m_jit.branchSub32(MacroAssembler::Overflow, op1.gpr(), op2.gpr(), result.gpr()));2370 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branchSub32(MacroAssembler::Overflow, op1.gpr(), op2.gpr(), result.gpr())); 2371 2371 2372 2372 integerResult(result.gpr(), m_compileIndex); … … 2400 2400 GPRReg op2GPR = op2.gpr(); 2401 2401 2402 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTest32(JITCompiler::Zero, op2GPR));2402 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branchTest32(JITCompiler::Zero, op2GPR)); 2403 2403 2404 2404 // If the user cares about negative zero, then speculate that we're not about … … 2406 2406 if (!nodeCanIgnoreNegativeZero(node.arithNodeFlags())) { 2407 2407 MacroAssembler::Jump numeratorNonZero = m_jit.branchTest32(MacroAssembler::NonZero, op1GPR); 2408 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, op2GPR, TrustedImm32(0)));2408 speculationCheck(NegativeZero, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, op2GPR, TrustedImm32(0))); 2409 2409 numeratorNonZero.link(&m_jit); 2410 2410 } … … 2426 2426 // Check that there was no remainder. If there had been, then we'd be obligated to 2427 2427 // produce a double result instead. 2428 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTest32(JITCompiler::NonZero, edx.gpr()));2428 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branchTest32(JITCompiler::NonZero, edx.gpr())); 2429 2429 2430 2430 integerResult(eax.gpr(), m_compileIndex); … … 2459 2459 m_jit.add32(scratch.gpr(), result.gpr()); 2460 2460 m_jit.xor32(scratch.gpr(), result.gpr()); 2461 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::Equal, result.gpr(), MacroAssembler::TrustedImm32(1 << 31)));2461 speculationCheck(Overflow, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::Equal, result.gpr(), MacroAssembler::TrustedImm32(1 << 31))); 2462 2462 integerResult(result.gpr(), m_compileIndex); 2463 2463 break; … … 2689 2689 2690 2690 if (!isArrayPrediction(m_state.forNode(node.child1()).m_type)) 2691 speculationCheck( JSValueRegs(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr)));2692 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset())));2691 speculationCheck(BadType, JSValueRegs(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr))); 2692 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::AboveOrEqual, propertyReg, MacroAssembler::Address(baseReg, JSArray::vectorLengthOffset()))); 2693 2693 2694 2694 // FIXME: In cases where there are subsequent by_val accesses to the same base it might help to cache … … 2697 2697 GPRTemporary result(this); 2698 2698 m_jit.loadPtr(MacroAssembler::BaseIndex(storageReg, propertyReg, MacroAssembler::ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), result.gpr()); 2699 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::Zero, result.gpr()));2699 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTestPtr(MacroAssembler::Zero, result.gpr())); 2700 2700 2701 2701 jsValueResult(result.gpr(), m_compileIndex); … … 2800 2800 // If we have predicted the base to be type array, we can skip the check. 2801 2801 if (!isArrayPrediction(m_state.forNode(node.child1()).m_type)) 2802 speculationCheck( JSValueRegs(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr)));2802 speculationCheck(BadType, JSValueRegs(baseReg), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseReg), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr))); 2803 2803 2804 2804 base.use(); … … 2944 2944 2945 2945 if (!isArrayPrediction(m_state.forNode(node.child1()).m_type)) 2946 speculationCheck( JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr)));2946 speculationCheck(BadType, JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr))); 2947 2947 2948 2948 m_jit.loadPtr(MacroAssembler::Address(baseGPR, JSArray::storageOffset()), storageGPR); … … 2950 2950 2951 2951 // Refuse to handle bizarre lengths. 2952 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::Above, storageLengthGPR, TrustedImm32(0x7ffffffe)));2952 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::Above, storageLengthGPR, TrustedImm32(0x7ffffffe))); 2953 2953 2954 2954 MacroAssembler::Jump slowPath = m_jit.branch32(MacroAssembler::AboveOrEqual, storageLengthGPR, MacroAssembler::Address(baseGPR, JSArray::vectorLengthOffset())); … … 2987 2987 2988 2988 if (!isArrayPrediction(m_state.forNode(node.child1()).m_type)) 2989 speculationCheck( JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr)));2989 speculationCheck(BadType, JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr))); 2990 2990 2991 2991 m_jit.loadPtr(MacroAssembler::Address(baseGPR, JSArray::storageOffset()), storageGPR); … … 3092 3092 // We expect that throw statements are rare and are intended to exit the code block 3093 3093 // anyway, so we just OSR back to the old JIT for now. 3094 terminateSpeculativeExecution( JSValueRegs(), NoNode);3094 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 3095 3095 break; 3096 3096 } … … 3225 3225 m_jit.move(thisValueGPR, scratchGPR); 3226 3226 m_jit.andPtr(MacroAssembler::TrustedImm32(~TagBitUndefined), scratchGPR); 3227 speculationCheck( JSValueRegs(thisValueGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, scratchGPR, MacroAssembler::TrustedImmPtr(reinterpret_cast<void*>(ValueNull))));3227 speculationCheck(BadType, JSValueRegs(thisValueGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, scratchGPR, MacroAssembler::TrustedImmPtr(reinterpret_cast<void*>(ValueNull)))); 3228 3228 } 3229 3229 … … 3240 3240 3241 3241 if (!isObjectPrediction(m_state.forNode(node.child1()).m_type)) 3242 speculationCheck( JSValueRegs(thisValueGPR), node.child1(), m_jit.branchPtr(JITCompiler::Equal, JITCompiler::Address(thisValueGPR), JITCompiler::TrustedImmPtr(m_jit.globalData()->jsStringVPtr)));3242 speculationCheck(BadType, JSValueRegs(thisValueGPR), node.child1(), m_jit.branchPtr(JITCompiler::Equal, JITCompiler::Address(thisValueGPR), JITCompiler::TrustedImmPtr(m_jit.globalData()->jsStringVPtr))); 3243 3243 3244 3244 m_jit.move(thisValueGPR, resultGPR); … … 3284 3284 if (at(node.child1()).shouldSpeculateFinalObject()) { 3285 3285 if (!isFinalObjectPrediction(m_state.forNode(node.child1()).m_type)) 3286 speculationCheck( JSValueRegs(protoGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(protoGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsFinalObjectVPtr)));3286 speculationCheck(BadType, JSValueRegs(protoGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(protoGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsFinalObjectVPtr))); 3287 3287 } else { 3288 3288 m_jit.loadPtr(MacroAssembler::Address(protoGPR, JSCell::structureOffset()), scratchGPR); … … 3391 3391 case GetById: { 3392 3392 if (!node.prediction()) { 3393 terminateSpeculativeExecution( JSValueRegs(), NoNode);3393 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 3394 3394 break; 3395 3395 } … … 3447 3447 3448 3448 if (!isArrayPrediction(m_state.forNode(node.child1()).m_type)) 3449 speculationCheck( JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr)));3449 speculationCheck(BadType, JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsArrayVPtr))); 3450 3450 3451 3451 m_jit.loadPtr(MacroAssembler::Address(baseGPR, JSArray::storageOffset()), resultGPR); 3452 3452 m_jit.load32(MacroAssembler::Address(resultGPR, OBJECT_OFFSETOF(ArrayStorage, m_length)), resultGPR); 3453 3453 3454 speculationCheck( JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, resultGPR, MacroAssembler::TrustedImm32(0)));3454 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branch32(MacroAssembler::LessThan, resultGPR, MacroAssembler::TrustedImm32(0))); 3455 3455 3456 3456 integerResult(resultGPR, m_compileIndex); … … 3466 3466 3467 3467 if (!isStringPrediction(m_state.forNode(node.child1()).m_type)) 3468 speculationCheck( JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsStringVPtr)));3468 speculationCheck(BadType, JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsStringVPtr))); 3469 3469 3470 3470 m_jit.load32(MacroAssembler::Address(baseGPR, JSString::offsetOfLength()), resultGPR); … … 3482 3482 3483 3483 if (!isByteArrayPrediction(m_state.forNode(node.child1()).m_type)) 3484 speculationCheck( JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr)));3484 speculationCheck(BadType, JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR), MacroAssembler::TrustedImmPtr(m_jit.globalData()->jsByteArrayVPtr))); 3485 3485 3486 3486 m_jit.loadPtr(MacroAssembler::Address(baseGPR, JSByteArray::offsetOfStorage()), resultGPR); … … 3524 3524 case CheckFunction: { 3525 3525 SpeculateCellOperand function(this, node.child1()); 3526 speculationCheck( JSValueRegs(), NoNode, m_jit.branchWeakPtr(JITCompiler::NotEqual, function.gpr(), node.function()));3526 speculationCheck(BadCache, JSValueRegs(), NoNode, m_jit.branchWeakPtr(JITCompiler::NotEqual, function.gpr(), node.function())); 3527 3527 noResult(m_compileIndex); 3528 3528 break; … … 3539 3539 3540 3540 if (node.structureSet().size() == 1) 3541 speculationCheck( JSValueRegs(), NoNode, m_jit.branchWeakPtr(JITCompiler::NotEqual, JITCompiler::Address(base.gpr(), JSCell::structureOffset()), node.structureSet()[0]));3541 speculationCheck(BadCache, JSValueRegs(), NoNode, m_jit.branchWeakPtr(JITCompiler::NotEqual, JITCompiler::Address(base.gpr(), JSCell::structureOffset()), node.structureSet()[0])); 3542 3542 else { 3543 3543 GPRTemporary structure(this); … … 3550 3550 done.append(m_jit.branchWeakPtr(JITCompiler::Equal, structure.gpr(), node.structureSet()[i])); 3551 3551 3552 speculationCheck( JSValueRegs(), NoNode, m_jit.branchWeakPtr(JITCompiler::NotEqual, structure.gpr(), node.structureSet().last()));3552 speculationCheck(BadCache, JSValueRegs(), NoNode, m_jit.branchWeakPtr(JITCompiler::NotEqual, structure.gpr(), node.structureSet().last())); 3553 3553 3554 3554 done.link(&m_jit); … … 3706 3706 // Speculate that base 'ImplementsDefaultHasInstance'. 3707 3707 m_jit.loadPtr(MacroAssembler::Address(base.gpr(), JSCell::structureOffset()), structure.gpr()); 3708 speculationCheck( JSValueRegs(), NoNode, m_jit.branchTest8(MacroAssembler::Zero, MacroAssembler::Address(structure.gpr(), Structure::typeInfoFlagsOffset()), MacroAssembler::TrustedImm32(ImplementsDefaultHasInstance)));3708 speculationCheck(Uncountable, JSValueRegs(), NoNode, m_jit.branchTest8(MacroAssembler::Zero, MacroAssembler::Address(structure.gpr(), Structure::typeInfoFlagsOffset()), MacroAssembler::TrustedImm32(ImplementsDefaultHasInstance))); 3709 3709 3710 3710 noResult(m_compileIndex); … … 3795 3795 3796 3796 case ForceOSRExit: { 3797 terminateSpeculativeExecution( JSValueRegs(), NoNode);3797 terminateSpeculativeExecution(Uncountable, JSValueRegs(), NoNode); 3798 3798 break; 3799 3799 } -
trunk/Source/JavaScriptCore/runtime/Heuristics.cpp
r102489 r102694 68 68 unsigned couldTakeSlowCaseMinimumCount; 69 69 70 double osrExitProminenceForFrequentExitSite; 71 70 72 unsigned largeFailCountThresholdBase; 71 73 unsigned largeFailCountThresholdBaseForLoop; … … 148 150 SET(likelyToTakeSlowCaseMinimumCount, 100); 149 151 SET(couldTakeSlowCaseMinimumCount, 10); 152 153 SET(osrExitProminenceForFrequentExitSite, 0.3); 150 154 151 155 SET(largeFailCountThresholdBase, 20); -
trunk/Source/JavaScriptCore/runtime/Heuristics.h
r102489 r102694 54 54 extern unsigned couldTakeSlowCaseMinimumCount; 55 55 56 extern double osrExitProminenceForFrequentExitSite; 57 56 58 extern unsigned largeFailCountThresholdBase; 57 59 extern unsigned largeFailCountThresholdBaseForLoop;
Note: See TracChangeset
for help on using the changeset viewer.