Changeset 185705 in webkit
- Timestamp:
- Jun 18, 2015, 10:39:52 AM (11 years ago)
- Location:
- branches/safari-600.7-branch/Source/JavaScriptCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
dfg/DFGSpeculativeJIT32_64.cpp (modified) (9 diffs)
-
dfg/DFGSpeculativeJIT64.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-600.7-branch/Source/JavaScriptCore/ChangeLog
r184580 r185705 1 2015-06-18 Babak Shafiei <bshafiei@apple.com> 2 3 Roll out patch for r182827. 4 1 5 2015-05-19 Babak Shafiei <bshafiei@apple.com> 2 6 -
branches/safari-600.7-branch/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r184580 r185705 732 732 SpeculatedType type = value.m_type; 733 733 ASSERT(edge.useKind() != KnownInt32Use || !(value.m_type & ~SpecInt32)); 734 735 if (m_interpreter.filter(value, SpecInt32) == Contradiction) { 734 m_interpreter.filter(value, SpecInt32); 735 VirtualRegister virtualRegister = edge->virtualRegister(); 736 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister); 737 738 if (edge->hasConstant() && !isInt32Constant(edge.node())) { 736 739 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 737 740 returnFormat = DataFormatInt32; 738 741 return allocate(); 739 742 } 740 741 VirtualRegister virtualRegister = edge->virtualRegister(); 742 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister); 743 743 744 744 switch (info.registerFormat()) { 745 745 case DataFormatNone: { … … 755 755 756 756 DataFormat spillFormat = info.spillFormat(); 757 758 757 ASSERT_UNUSED(spillFormat, (spillFormat & DataFormatJS) || spillFormat == DataFormatInt32); 759 758 … … 801 800 case DataFormatJSCell: 802 801 case DataFormatJSBoolean: 802 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 803 returnFormat = DataFormatInt32; 804 return allocate(); 805 803 806 case DataFormatDouble: 804 807 case DataFormatStorage: … … 859 862 SpeculatedType type = value.m_type; 860 863 ASSERT((edge.useKind() != KnownCellUse && edge.useKind() != KnownStringUse) || !(value.m_type & ~SpecCell)); 861 862 if (m_interpreter.filter(value, SpecCell) == Contradiction) { 863 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 864 return allocate(); 865 } 866 864 m_interpreter.filter(value, SpecCell); 867 865 VirtualRegister virtualRegister = edge->virtualRegister(); 868 866 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister); … … 870 868 switch (info.registerFormat()) { 871 869 case DataFormatNone: { 870 if (info.spillFormat() == DataFormatInt32) { 871 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 872 return allocate(); 873 } 874 872 875 if (edge->hasConstant()) { 873 876 JSValue jsValue = valueOfJSConstant(edge.node()); … … 931 934 case DataFormatJSBoolean: 932 935 case DataFormatBoolean: 936 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 937 return allocate(); 938 933 939 case DataFormatDouble: 934 940 case DataFormatStorage: … … 945 951 AbstractValue& value = m_state.forNode(edge); 946 952 SpeculatedType type = value.m_type; 947 948 if (m_interpreter.filter(value, SpecBoolean) == Contradiction) { 949 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 950 return allocate(); 951 } 952 953 m_interpreter.filter(value, SpecBoolean); 953 954 VirtualRegister virtualRegister = edge->virtualRegister(); 954 955 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister); … … 956 957 switch (info.registerFormat()) { 957 958 case DataFormatNone: { 959 if (info.spillFormat() == DataFormatInt32) { 960 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 961 return allocate(); 962 } 963 958 964 if (edge->hasConstant()) { 959 965 JSValue jsValue = valueOfJSConstant(edge.node()); 960 966 GPRReg gpr = allocate(); 961 m_gprs.retain(gpr, virtualRegister, SpillOrderConstant); 962 m_jit.move(MacroAssembler::TrustedImm32(jsValue.asBoolean()), gpr); 963 info.fillBoolean(*m_stream, gpr); 967 if (jsValue.isBoolean()) { 968 m_gprs.retain(gpr, virtualRegister, SpillOrderConstant); 969 m_jit.move(MacroAssembler::TrustedImm32(jsValue.asBoolean()), gpr); 970 info.fillBoolean(*m_stream, gpr); 971 return gpr; 972 } 973 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 964 974 return gpr; 965 975 } … … 1005 1015 case DataFormatJSCell: 1006 1016 case DataFormatCell: 1017 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 1018 return allocate(); 1019 1007 1020 case DataFormatDouble: 1008 1021 case DataFormatStorage: -
branches/safari-600.7-branch/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r184580 r185705 722 722 SpeculatedType type = value.m_type; 723 723 ASSERT(edge.useKind() != KnownInt32Use || !(value.m_type & ~SpecInt32)); 724 725 if (m_interpreter.filter(value, SpecInt32) == Contradiction) { 724 m_interpreter.filter(value, SpecInt32); 725 VirtualRegister virtualRegister = edge->virtualRegister(); 726 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister); 727 728 if (edge->hasConstant() && !isInt32Constant(edge.node())) { 729 // Protect the silent spill/fill logic by failing early. If we "speculate" on 730 // the constant then the silent filler may think that we have an int32 and a 731 // constant, so it will try to fill this as an int32 constant. Bad things will 732 // happen. 726 733 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 727 734 returnFormat = DataFormatInt32; 728 735 return allocate(); 729 736 } 730 731 VirtualRegister virtualRegister = edge->virtualRegister(); 732 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister); 733 737 734 738 switch (info.registerFormat()) { 735 739 case DataFormatNone: { … … 830 834 case DataFormatBoolean: 831 835 case DataFormatJSCell: 832 case DataFormatJSBoolean: 836 case DataFormatJSBoolean: { 837 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 838 returnFormat = DataFormatInt32; 839 return allocate(); 840 } 841 833 842 case DataFormatDouble: 834 843 case DataFormatStorage: … … 863 872 ASSERT(desiredFormat == DataFormatInt52 || desiredFormat == DataFormatStrictInt52); 864 873 AbstractValue& value = m_state.forNode(edge); 865 866 if (m_interpreter.filter(value, SpecMachineInt) == Contradiction) { 867 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 868 return allocate(); 869 } 870 874 m_interpreter.filter(value, SpecMachineInt); 871 875 VirtualRegister virtualRegister = edge->virtualRegister(); 872 876 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister); … … 874 878 switch (info.registerFormat()) { 875 879 case DataFormatNone: { 880 if ((edge->hasConstant() && !valueOfJSConstant(edge.node()).isMachineInt())) { 881 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 882 return allocate(); 883 } 884 876 885 GPRReg gpr = allocate(); 877 886 … … 992 1001 SpeculatedType type = value.m_type; 993 1002 ASSERT((edge.useKind() != KnownCellUse && edge.useKind() != KnownStringUse) || !(value.m_type & ~SpecCell)); 994 995 if (m_interpreter.filter(value, SpecCell) == Contradiction) { 996 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 997 return allocate(); 998 } 999 1003 m_interpreter.filter(value, SpecCell); 1000 1004 VirtualRegister virtualRegister = edge->virtualRegister(); 1001 1005 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister); … … 1016 1020 return gpr; 1017 1021 } 1018 1022 1023 if (!(info.spillFormat() & DataFormatJS)) { 1024 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 1025 return gpr; 1026 } 1027 1019 1028 m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled); 1020 1029 m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr); … … 1052 1061 case DataFormatJSDouble: 1053 1062 case DataFormatJSBoolean: 1054 case DataFormatBoolean: 1063 case DataFormatBoolean: { 1064 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 1065 return allocate(); 1066 } 1067 1055 1068 case DataFormatDouble: 1056 1069 case DataFormatStorage: … … 1069 1082 AbstractValue& value = m_state.forNode(edge); 1070 1083 SpeculatedType type = value.m_type; 1071 1072 if (m_interpreter.filter(value, SpecBoolean) == Contradiction) { 1073 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 1074 return allocate(); 1075 } 1076 1084 m_interpreter.filter(value, SpecBoolean); 1077 1085 VirtualRegister virtualRegister = edge->virtualRegister(); 1078 1086 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister); … … 1080 1088 switch (info.registerFormat()) { 1081 1089 case DataFormatNone: { 1090 if (info.spillFormat() == DataFormatInt32) { 1091 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 1092 return allocate(); 1093 } 1094 1082 1095 GPRReg gpr = allocate(); 1083 1096 1084 1097 if (edge->hasConstant()) { 1085 1098 JSValue jsValue = valueOfJSConstant(edge.node()); 1086 m_gprs.retain(gpr, virtualRegister, SpillOrderConstant); 1087 m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsValue)), gpr); 1088 info.fillJSValue(*m_stream, gpr, DataFormatJSBoolean); 1099 if (jsValue.isBoolean()) { 1100 m_gprs.retain(gpr, virtualRegister, SpillOrderConstant); 1101 m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsValue)), gpr); 1102 info.fillJSValue(*m_stream, gpr, DataFormatJSBoolean); 1103 return gpr; 1104 } 1105 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 1089 1106 return gpr; 1090 1107 } … … 1127 1144 case DataFormatJSCell: 1128 1145 case DataFormatCell: 1146 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 1147 return allocate(); 1148 1129 1149 case DataFormatDouble: 1130 1150 case DataFormatStorage:
Note:
See TracChangeset
for help on using the changeset viewer.