Changeset 192842 in webkit
- Timestamp:
- Nov 30, 2015, 4:07:39 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r192841 r192842 1 2015-11-30 Mark Lam <mark.lam@apple.com> 2 3 Refactor the op_add, op_sub, and op_mul snippets to use the SnippetOperand class. 4 https://bugs.webkit.org/show_bug.cgi?id=151678 5 6 Reviewed by Geoffrey Garen. 7 8 * dfg/DFGSpeculativeJIT.cpp: 9 (JSC::DFG::SpeculativeJIT::compileValueAdd): 10 (JSC::DFG::SpeculativeJIT::compileArithSub): 11 * ftl/FTLCompile.cpp: 12 * jit/JITAddGenerator.cpp: 13 (JSC::JITAddGenerator::generateFastPath): 14 * jit/JITAddGenerator.h: 15 (JSC::JITAddGenerator::JITAddGenerator): 16 * jit/JITArithmetic.cpp: 17 (JSC::JIT::emit_op_add): 18 (JSC::JIT::emit_op_mul): 19 (JSC::JIT::emit_op_sub): 20 * jit/JITMulGenerator.cpp: 21 (JSC::JITMulGenerator::generateFastPath): 22 * jit/JITMulGenerator.h: 23 (JSC::JITMulGenerator::JITMulGenerator): 24 * jit/JITSubGenerator.cpp: 25 (JSC::JITSubGenerator::generateFastPath): 26 * jit/JITSubGenerator.h: 27 (JSC::JITSubGenerator::JITSubGenerator): 28 * jit/SnippetOperand.h: 29 (JSC::SnippetOperand::isPositiveConstInt32): 30 1 31 2015-11-30 Filip Pizlo <fpizlo@apple.com> 2 32 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r192814 r192842 2854 2854 #endif 2855 2855 2856 ResultType leftType = m_state.forNode(node->child1()).resultType(); 2857 ResultType rightType = m_state.forNode(node->child2()).resultType(); 2858 int32_t leftConstInt32 = 0; 2859 int32_t rightConstInt32 = 0; 2860 2861 ASSERT(!leftIsConstInt32 || !rightIsConstInt32); 2862 2863 if (leftIsConstInt32) { 2864 leftConstInt32 = node->child1()->asInt32(); 2856 SnippetOperand leftOperand(m_state.forNode(node->child1()).resultType()); 2857 SnippetOperand rightOperand(m_state.forNode(node->child2()).resultType()); 2858 2859 if (leftIsConstInt32) 2860 leftOperand.setConstInt32(node->child1()->asInt32()); 2861 if (rightIsConstInt32) 2862 rightOperand.setConstInt32(node->child2()->asInt32()); 2863 2864 ASSERT(!leftOperand.isConst() || !rightOperand.isConst()); 2865 2866 if (!leftOperand.isConst()) { 2867 left = JSValueOperand(this, node->child1()); 2868 leftRegs = left->jsValueRegs(); 2869 } 2870 if (!rightOperand.isConst()) { 2865 2871 right = JSValueOperand(this, node->child2()); 2866 2872 rightRegs = right->jsValueRegs(); 2867 } else if (rightIsConstInt32) { 2868 left = JSValueOperand(this, node->child1()); 2869 leftRegs = left->jsValueRegs(); 2870 rightConstInt32 = node->child2()->asInt32(); 2871 } else { 2872 left = JSValueOperand(this, node->child1()); 2873 leftRegs = left->jsValueRegs(); 2874 right = JSValueOperand(this, node->child2()); 2875 rightRegs = right->jsValueRegs(); 2876 } 2877 2878 JITAddGenerator gen(resultRegs, leftRegs, rightRegs, leftType, rightType, 2879 leftIsConstInt32, rightIsConstInt32, leftConstInt32, rightConstInt32, 2873 } 2874 2875 JITAddGenerator gen(leftOperand, rightOperand, resultRegs, leftRegs, rightRegs, 2880 2876 leftFPR, rightFPR, scratchGPR, scratchFPR); 2881 2877 gen.generateFastPath(m_jit); … … 3217 3213 JSValueRegs rightRegs = right.jsValueRegs(); 3218 3214 3219 ResultType leftType = m_state.forNode(node->child1()).resultType();3220 ResultType rightType = m_state.forNode(node->child2()).resultType();3221 3222 3215 FPRTemporary leftNumber(this); 3223 3216 FPRTemporary rightNumber(this); … … 3240 3233 #endif 3241 3234 3242 JITSubGenerator gen(resultRegs, leftRegs, rightRegs, leftType, rightType, 3235 SnippetOperand leftOperand(m_state.forNode(node->child1()).resultType()); 3236 SnippetOperand rightOperand(m_state.forNode(node->child2()).resultType()); 3237 3238 JITSubGenerator gen(leftOperand, rightOperand, resultRegs, leftRegs, rightRegs, 3243 3239 leftFPR, rightFPR, scratchGPR, scratchFPR); 3244 3240 gen.generateFastPath(m_jit); -
trunk/Source/JavaScriptCore/ftl/FTLCompile.cpp
r192599 r192842 441 441 CCallHelpers fastPathJIT(&vm, codeBlock); 442 442 443 SnippetOperand leftOperand(ic.leftType()); 444 SnippetOperand rightOperand(ic.rightType()); 445 443 446 GPRReg result = record.locations[0].directGPR(); 444 447 GPRReg left = record.locations[1].directGPR(); … … 455 458 FPRReg scratchFPR = InvalidFPRReg; 456 459 457 JITSubGenerator gen( JSValueRegs(result), JSValueRegs(left), JSValueRegs(right), ic.leftType(), ic.rightType(), leftFPR, rightFPR, scratchGPR, scratchFPR);460 JITSubGenerator gen(leftOperand, rightOperand, JSValueRegs(result), JSValueRegs(left), JSValueRegs(right), leftFPR, rightFPR, scratchGPR, scratchFPR); 458 461 459 462 auto numberOfBytesUsedToPreserveReusedRegisters = -
trunk/Source/JavaScriptCore/jit/JITAddGenerator.cpp
r192599 r192842 25 25 26 26 #include "config.h" 27 #include "JITAddGenerator.h" 27 28 28 29 #if ENABLE(JIT) 29 #include "JITAddGenerator.h"30 30 31 31 namespace JSC { … … 42 42 #endif 43 43 44 ASSERT(!m_left IsConstInt32 || !m_rightIsConstInt32);44 ASSERT(!m_leftOperand.isConstInt32() || !m_rightOperand.isConstInt32()); 45 45 46 if (!m_left Type.mightBeNumber() || !m_rightType.mightBeNumber()) {46 if (!m_leftOperand.mightBeNumber() || !m_rightOperand.mightBeNumber()) { 47 47 ASSERT(!m_didEmitFastPath); 48 48 return; … … 51 51 m_didEmitFastPath = true; 52 52 53 if (m_leftIsConstInt32 || m_rightIsConstInt32) { 54 JSValueRegs var; 55 ResultType varType = ResultType::unknownType(); 56 int32_t constInt32; 57 58 if (m_leftIsConstInt32) { 59 var = m_right; 60 varType = m_rightType; 61 constInt32 = m_leftConstInt32; 62 } else { 63 var = m_left; 64 varType = m_leftType; 65 constInt32 = m_rightConstInt32; 66 } 53 if (m_leftOperand.isConstInt32() || m_rightOperand.isConstInt32()) { 54 JSValueRegs var = m_leftOperand.isConstInt32() ? m_right : m_left; 55 SnippetOperand& varOpr = m_leftOperand.isConstInt32() ? m_rightOperand : m_leftOperand; 56 SnippetOperand& constOpr = m_leftOperand.isConstInt32() ? m_leftOperand : m_rightOperand; 67 57 68 58 // Try to do intVar + intConstant. 69 59 CCallHelpers::Jump notInt32 = jit.branchIfNotInt32(var); 70 60 71 m_slowPathJumpList.append(jit.branchAdd32(CCallHelpers::Overflow, var.payloadGPR(), CCallHelpers::Imm32(const Int32), m_scratchGPR));61 m_slowPathJumpList.append(jit.branchAdd32(CCallHelpers::Overflow, var.payloadGPR(), CCallHelpers::Imm32(constOpr.asConstInt32()), m_scratchGPR)); 72 62 73 63 jit.boxInt32(m_scratchGPR, m_result); … … 81 71 // Try to do doubleVar + double(intConstant). 82 72 notInt32.link(&jit); 83 if (!var Type.definitelyIsNumber())73 if (!varOpr.definitelyIsNumber()) 84 74 m_slowPathJumpList.append(jit.branchIfNotNumber(var, m_scratchGPR)); 85 75 86 76 jit.unboxDoubleNonDestructive(var, m_leftFPR, m_scratchGPR, m_scratchFPR); 87 77 88 jit.move(CCallHelpers::Imm32(const Int32), m_scratchGPR);78 jit.move(CCallHelpers::Imm32(constOpr.asConstInt32()), m_scratchGPR); 89 79 jit.convertInt32ToDouble(m_scratchGPR, m_rightFPR); 90 80 … … 92 82 93 83 } else { 94 ASSERT(!m_left IsConstInt32 && !m_rightIsConstInt32);84 ASSERT(!m_leftOperand.isConstInt32() && !m_rightOperand.isConstInt32()); 95 85 CCallHelpers::Jump leftNotInt; 96 86 CCallHelpers::Jump rightNotInt; … … 112 102 113 103 leftNotInt.link(&jit); 114 if (!m_left Type.definitelyIsNumber())104 if (!m_leftOperand.definitelyIsNumber()) 115 105 m_slowPathJumpList.append(jit.branchIfNotNumber(m_left, m_scratchGPR)); 116 if (!m_right Type.definitelyIsNumber())106 if (!m_rightOperand.definitelyIsNumber()) 117 107 m_slowPathJumpList.append(jit.branchIfNotNumber(m_right, m_scratchGPR)); 118 108 … … 124 114 125 115 rightNotInt.link(&jit); 126 if (!m_right Type.definitelyIsNumber())116 if (!m_rightOperand.definitelyIsNumber()) 127 117 m_slowPathJumpList.append(jit.branchIfNotNumber(m_right, m_scratchGPR)); 128 118 -
trunk/Source/JavaScriptCore/jit/JITAddGenerator.h
r192632 r192842 30 30 31 31 #include "CCallHelpers.h" 32 #include " ResultType.h"32 #include "SnippetOperand.h" 33 33 34 34 namespace JSC { … … 36 36 class JITAddGenerator { 37 37 public: 38 JITAddGenerator(JSValueRegs result, JSValueRegs left, JSValueRegs right, 39 ResultType leftType, ResultType rightType, bool leftIsConstInt32, bool rightIsConstInt32, 40 int32_t leftConstInt32, int32_t rightConstInt32, FPRReg leftFPR, FPRReg rightFPR, 41 GPRReg scratchGPR, FPRReg scratchFPR) 42 : m_result(result) 38 JITAddGenerator(SnippetOperand leftOperand, SnippetOperand rightOperand, 39 JSValueRegs result, JSValueRegs left, JSValueRegs right, 40 FPRReg leftFPR, FPRReg rightFPR, GPRReg scratchGPR, FPRReg scratchFPR) 41 : m_leftOperand(leftOperand) 42 , m_rightOperand(rightOperand) 43 , m_result(result) 43 44 , m_left(left) 44 45 , m_right(right) 45 , m_leftType(leftType)46 , m_rightType(rightType)47 , m_leftIsConstInt32(leftIsConstInt32)48 , m_rightIsConstInt32(rightIsConstInt32)49 , m_leftConstInt32(leftConstInt32)50 , m_rightConstInt32(rightConstInt32)51 46 , m_leftFPR(leftFPR) 52 47 , m_rightFPR(rightFPR) … … 54 49 , m_scratchFPR(scratchFPR) 55 50 { 56 ASSERT(! leftIsConstInt32 || !rightIsConstInt32);51 ASSERT(!m_leftOperand.isConstInt32() || !m_rightOperand.isConstInt32()); 57 52 } 58 53 … … 64 59 65 60 private: 61 SnippetOperand m_leftOperand; 62 SnippetOperand m_rightOperand; 66 63 JSValueRegs m_result; 67 64 JSValueRegs m_left; 68 65 JSValueRegs m_right; 69 ResultType m_leftType;70 ResultType m_rightType;71 bool m_leftIsConstInt32;72 bool m_rightIsConstInt32;73 int32_t m_leftConstInt32;74 int32_t m_rightConstInt32;75 66 FPRReg m_leftFPR; 76 67 FPRReg m_rightFPR; -
trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp
r192836 r192842 686 686 #endif 687 687 688 bool leftIsConstInt32 = isOperandConstantInt(op1); 689 bool rightIsConstInt32 = isOperandConstantInt(op2); 690 ResultType leftType = types.first(); 691 ResultType rightType = types.second(); 692 int32_t leftConstInt32 = 0; 693 int32_t rightConstInt32 = 0; 694 695 ASSERT(!leftIsConstInt32 || !rightIsConstInt32); 696 697 if (leftIsConstInt32) { 698 leftConstInt32 = getOperandConstantInt(op1); 688 SnippetOperand leftOperand(types.first()); 689 SnippetOperand rightOperand(types.second()); 690 691 if (isOperandConstantInt(op1)) 692 leftOperand.setConstInt32(getOperandConstantInt(op1)); 693 if (isOperandConstantInt(op2)) 694 rightOperand.setConstInt32(getOperandConstantInt(op2)); 695 696 ASSERT(!leftOperand.isConst() || !rightOperand.isConst()); 697 698 if (!leftOperand.isConst()) 699 emitGetVirtualRegister(op1, leftRegs); 700 if (!rightOperand.isConst()) 699 701 emitGetVirtualRegister(op2, rightRegs); 700 } else if (rightIsConstInt32) { 701 emitGetVirtualRegister(op1, leftRegs); 702 rightConstInt32 = getOperandConstantInt(op2); 703 } else { 704 emitGetVirtualRegister(op1, leftRegs); 705 emitGetVirtualRegister(op2, rightRegs); 706 } 707 708 JITAddGenerator gen(resultRegs, leftRegs, rightRegs, leftType, rightType, 709 leftIsConstInt32, rightIsConstInt32, leftConstInt32, rightConstInt32, 702 703 JITAddGenerator gen(leftOperand, rightOperand, resultRegs, leftRegs, rightRegs, 710 704 fpRegT0, fpRegT1, scratchGPR, scratchFPR); 711 705 … … 827 821 #endif 828 822 829 bool leftIsConstInt32 = isOperandConstantInt(op1);830 bool rightIsConstInt32 = isOperandConstantInt(op2);831 ResultType leftType = types.first();832 ResultType rightType = types.second();833 int32_t leftConstInt32 = 0;834 int32_t rightConstInt32 = 0;835 836 823 uint32_t* profilingCounter = nullptr; 837 824 if (shouldEmitProfiling()) 838 825 profilingCounter = &m_codeBlock->addSpecialFastCaseProfile(m_bytecodeOffset)->m_counter; 839 826 840 ASSERT(!leftIsConstInt32 || !rightIsConstInt32); 841 842 if (leftIsConstInt32) 843 leftConstInt32 = getOperandConstantInt(op1); 844 if (rightIsConstInt32) 845 rightConstInt32 = getOperandConstantInt(op2); 846 847 bool leftIsPositiveConstInt32 = leftIsConstInt32 && (leftConstInt32 > 0); 848 bool rightIsPositiveConstInt32 = rightIsConstInt32 && (rightConstInt32 > 0); 849 850 if (leftIsPositiveConstInt32) 827 SnippetOperand leftOperand(types.first()); 828 SnippetOperand rightOperand(types.second()); 829 830 if (isOperandConstantInt(op1)) 831 leftOperand.setConstInt32(getOperandConstantInt(op1)); 832 if (isOperandConstantInt(op2)) 833 rightOperand.setConstInt32(getOperandConstantInt(op2)); 834 835 ASSERT(!leftOperand.isConst() || !rightOperand.isConst()); 836 837 if (!leftOperand.isPositiveConstInt32()) 838 emitGetVirtualRegister(op1, leftRegs); 839 if (!rightOperand.isPositiveConstInt32()) 851 840 emitGetVirtualRegister(op2, rightRegs); 852 else if (rightIsPositiveConstInt32) 853 emitGetVirtualRegister(op1, leftRegs); 854 else { 855 emitGetVirtualRegister(op1, leftRegs); 856 emitGetVirtualRegister(op2, rightRegs); 857 } 858 859 JITMulGenerator gen(resultRegs, leftRegs, rightRegs, leftType, rightType, 860 leftIsPositiveConstInt32, rightIsPositiveConstInt32, leftConstInt32, rightConstInt32, 841 842 JITMulGenerator gen(leftOperand, rightOperand, resultRegs, leftRegs, rightRegs, 861 843 fpRegT0, fpRegT1, scratchGPR, scratchFPR, profilingCounter); 862 844 … … 905 887 #endif 906 888 889 SnippetOperand leftOperand(types.first()); 890 SnippetOperand rightOperand(types.second()); 891 907 892 emitGetVirtualRegister(op1, leftRegs); 908 893 emitGetVirtualRegister(op2, rightRegs); 909 894 910 JITSubGenerator gen( resultRegs, leftRegs, rightRegs, types.first(), types.second(),895 JITSubGenerator gen(leftOperand, rightOperand, resultRegs, leftRegs, rightRegs, 911 896 fpRegT0, fpRegT1, scratchGPR, scratchFPR); 912 897 -
trunk/Source/JavaScriptCore/jit/JITMulGenerator.cpp
r192600 r192842 25 25 26 26 #include "config.h" 27 #include "JITMulGenerator.h" 27 28 28 29 #if ENABLE(JIT) 29 #include "JITMulGenerator.h"30 30 31 31 namespace JSC { … … 42 42 #endif 43 43 44 ASSERT(!m_left IsPositiveConstInt32 || !m_rightIsPositiveConstInt32);45 46 if (!m_left Type.mightBeNumber() || !m_rightType.mightBeNumber()) {44 ASSERT(!m_leftOperand.isPositiveConstInt32() || !m_rightOperand.isPositiveConstInt32()); 45 46 if (!m_leftOperand.mightBeNumber() || !m_rightOperand.mightBeNumber()) { 47 47 ASSERT(!m_didEmitFastPath); 48 48 return; … … 51 51 m_didEmitFastPath = true; 52 52 53 if (m_leftIsPositiveConstInt32 || m_rightIsPositiveConstInt32) { 54 JSValueRegs var; 55 ResultType varType = ResultType::unknownType(); 56 int32_t constInt32; 57 58 if (m_leftIsPositiveConstInt32) { 59 var = m_right; 60 varType = m_rightType; 61 constInt32 = m_leftConstInt32; 62 } else { 63 var = m_left; 64 varType = m_leftType; 65 constInt32 = m_rightConstInt32; 66 } 53 if (m_leftOperand.isPositiveConstInt32() || m_rightOperand.isPositiveConstInt32()) { 54 JSValueRegs var = m_leftOperand.isPositiveConstInt32() ? m_right : m_left; 55 SnippetOperand& varOpr = m_leftOperand.isPositiveConstInt32() ? m_rightOperand : m_leftOperand; 56 SnippetOperand& constOpr = m_leftOperand.isPositiveConstInt32() ? m_leftOperand : m_rightOperand; 67 57 68 58 // Try to do intVar * intConstant. 69 59 CCallHelpers::Jump notInt32 = jit.branchIfNotInt32(var); 70 60 71 m_slowPathJumpList.append(jit.branchMul32(CCallHelpers::Overflow, var.payloadGPR(), CCallHelpers::Imm32(const Int32), m_scratchGPR));61 m_slowPathJumpList.append(jit.branchMul32(CCallHelpers::Overflow, var.payloadGPR(), CCallHelpers::Imm32(constOpr.asConstInt32()), m_scratchGPR)); 72 62 73 63 jit.boxInt32(m_scratchGPR, m_result); … … 81 71 // Try to do doubleVar * double(intConstant). 82 72 notInt32.link(&jit); 83 if (!var Type.definitelyIsNumber())73 if (!varOpr.definitelyIsNumber()) 84 74 m_slowPathJumpList.append(jit.branchIfNotNumber(var, m_scratchGPR)); 85 75 86 76 jit.unboxDoubleNonDestructive(var, m_leftFPR, m_scratchGPR, m_scratchFPR); 87 77 88 jit.move(CCallHelpers::Imm32(const Int32), m_scratchGPR);78 jit.move(CCallHelpers::Imm32(constOpr.asConstInt32()), m_scratchGPR); 89 79 jit.convertInt32ToDouble(m_scratchGPR, m_rightFPR); 90 80 … … 92 82 93 83 } else { 94 ASSERT(!m_left IsPositiveConstInt32 && !m_rightIsPositiveConstInt32);84 ASSERT(!m_leftOperand.isPositiveConstInt32() && !m_rightOperand.isPositiveConstInt32()); 95 85 96 86 CCallHelpers::Jump leftNotInt; … … 131 121 132 122 leftNotInt.link(&jit); 133 if (!m_left Type.definitelyIsNumber())123 if (!m_leftOperand.definitelyIsNumber()) 134 124 m_slowPathJumpList.append(jit.branchIfNotNumber(m_left, m_scratchGPR)); 135 if (!m_right Type.definitelyIsNumber())125 if (!m_rightOperand.definitelyIsNumber()) 136 126 m_slowPathJumpList.append(jit.branchIfNotNumber(m_right, m_scratchGPR)); 137 127 … … 143 133 144 134 rightNotInt.link(&jit); 145 if (!m_right Type.definitelyIsNumber())135 if (!m_rightOperand.definitelyIsNumber()) 146 136 m_slowPathJumpList.append(jit.branchIfNotNumber(m_right, m_scratchGPR)); 147 137 -
trunk/Source/JavaScriptCore/jit/JITMulGenerator.h
r192632 r192842 30 30 31 31 #include "CCallHelpers.h" 32 #include " ResultType.h"32 #include "SnippetOperand.h" 33 33 34 34 namespace JSC { … … 36 36 class JITMulGenerator { 37 37 public: 38 JITMulGenerator(JSValueRegs result, JSValueRegs left, JSValueRegs right, 39 ResultType leftType, ResultType rightType, bool leftIsPositiveConstInt32, bool rightIsPositiveConstInt32, 40 int32_t leftConstInt32, int32_t rightConstInt32, FPRReg leftFPR, FPRReg rightFPR, 41 GPRReg scratchGPR, FPRReg scratchFPR, uint32_t* profilingCounter) 42 : m_result(result) 38 JITMulGenerator(SnippetOperand leftOperand, SnippetOperand rightOperand, 39 JSValueRegs result, JSValueRegs left, JSValueRegs right, 40 FPRReg leftFPR, FPRReg rightFPR, GPRReg scratchGPR, FPRReg scratchFPR, uint32_t* profilingCounter) 41 : m_leftOperand(leftOperand) 42 , m_rightOperand(rightOperand) 43 , m_result(result) 43 44 , m_left(left) 44 45 , m_right(right) 45 , m_leftType(leftType)46 , m_rightType(rightType)47 , m_leftIsPositiveConstInt32(leftIsPositiveConstInt32)48 , m_rightIsPositiveConstInt32(rightIsPositiveConstInt32)49 , m_leftConstInt32(leftConstInt32)50 , m_rightConstInt32(rightConstInt32)51 46 , m_leftFPR(leftFPR) 52 47 , m_rightFPR(rightFPR) … … 55 50 , m_profilingCounter(profilingCounter) 56 51 { 57 ASSERT(! leftIsPositiveConstInt32 || !rightIsPositiveConstInt32);52 ASSERT(!m_leftOperand.isPositiveConstInt32() || !m_rightOperand.isPositiveConstInt32()); 58 53 } 59 54 … … 65 60 66 61 private: 62 SnippetOperand m_leftOperand; 63 SnippetOperand m_rightOperand; 67 64 JSValueRegs m_result; 68 65 JSValueRegs m_left; 69 66 JSValueRegs m_right; 70 ResultType m_leftType;71 ResultType m_rightType;72 bool m_leftIsPositiveConstInt32;73 bool m_rightIsPositiveConstInt32;74 int32_t m_leftConstInt32;75 int32_t m_rightConstInt32;76 67 FPRReg m_leftFPR; 77 68 FPRReg m_rightFPR; -
trunk/Source/JavaScriptCore/jit/JITSubGenerator.cpp
r192599 r192842 25 25 26 26 #include "config.h" 27 #include "JITSubGenerator.h" 27 28 28 29 #if ENABLE(JIT) 29 #include "JITSubGenerator.h"30 30 31 31 namespace JSC { … … 61 61 62 62 leftNotInt.link(&jit); 63 if (!m_left Type.definitelyIsNumber())63 if (!m_leftOperand.definitelyIsNumber()) 64 64 m_slowPathJumpList.append(jit.branchIfNotNumber(m_left, m_scratchGPR)); 65 if (!m_right Type.definitelyIsNumber())65 if (!m_rightOperand.definitelyIsNumber()) 66 66 m_slowPathJumpList.append(jit.branchIfNotNumber(m_right, m_scratchGPR)); 67 67 … … 73 73 74 74 rightNotInt.link(&jit); 75 if (!m_right Type.definitelyIsNumber())75 if (!m_rightOperand.definitelyIsNumber()) 76 76 m_slowPathJumpList.append(jit.branchIfNotNumber(m_right, m_scratchGPR)); 77 77 -
trunk/Source/JavaScriptCore/jit/JITSubGenerator.h
r192632 r192842 30 30 31 31 #include "CCallHelpers.h" 32 #include " ResultType.h"32 #include "SnippetOperand.h" 33 33 34 34 namespace JSC { … … 36 36 class JITSubGenerator { 37 37 public: 38 JITSubGenerator(JSValueRegs result, JSValueRegs left, JSValueRegs right, 39 ResultType leftType, ResultType rightType, FPRReg leftFPR, FPRReg rightFPR, 40 GPRReg scratchGPR, FPRReg scratchFPR) 41 : m_result(result) 38 JITSubGenerator(SnippetOperand leftOperand, SnippetOperand rightOperand, 39 JSValueRegs result, JSValueRegs left, JSValueRegs right, 40 FPRReg leftFPR, FPRReg rightFPR, GPRReg scratchGPR, FPRReg scratchFPR) 41 : m_leftOperand(leftOperand) 42 , m_rightOperand(rightOperand) 43 , m_result(result) 42 44 , m_left(left) 43 45 , m_right(right) 44 , m_leftType(leftType)45 , m_rightType(rightType)46 46 , m_leftFPR(leftFPR) 47 47 , m_rightFPR(rightFPR) … … 57 57 58 58 private: 59 SnippetOperand m_leftOperand; 60 SnippetOperand m_rightOperand; 59 61 JSValueRegs m_result; 60 62 JSValueRegs m_left; 61 63 JSValueRegs m_right; 62 ResultType m_leftType;63 ResultType m_rightType;64 64 FPRReg m_leftFPR; 65 65 FPRReg m_rightFPR; -
trunk/Source/JavaScriptCore/jit/SnippetOperand.h
r192836 r192842 51 51 bool isConstInt32() const { return m_type == ConstInt32; } 52 52 bool isConstDouble() const { return m_type == ConstDouble; } 53 bool isPositiveConstInt32() const { return isConstInt32() && asConstInt32() > 0; } 53 54 54 55 int64_t asRawBits() const { return m_val.rawBits; }
Note:
See TracChangeset
for help on using the changeset viewer.