Changeset 171662 in webkit for trunk/Source/JavaScriptCore/dfg
- Timestamp:
- Jul 27, 2014, 4:35:32 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore/dfg
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r171660 r171662 344 344 ASSERT(info.gpr() == source); 345 345 if (node->hasConstant()) { 346 DFG_ASSERT(m_jit.graph(), m_currentNode, node->isCellConstant()); 346 347 node->asCell(); // To get the assertion. 347 348 fillAction = SetCellConstant; -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r171660 r171662 868 868 VirtualRegister virtualRegister = edge->virtualRegister(); 869 869 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister); 870 871 if (edge->hasConstant() && !edge->isCellConstant()) { 872 // Protect the silent spill/fill logic by failing early. If we "speculate" on 873 // the constant then the silent filler may think that we have a cell and a 874 // constant, so it will try to fill this as an cell constant. Bad things will 875 // happen. 876 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 877 return allocate(); 878 } 870 879 871 880 switch (info.registerFormat()) { … … 879 888 JSValue jsValue = edge->asJSValue(); 880 889 GPRReg gpr = allocate(); 881 if (jsValue.isCell()) { 882 m_gprs.retain(gpr, virtualRegister, SpillOrderConstant); 883 m_jit.move(MacroAssembler::TrustedImmPtr(jsValue.asCell()), gpr); 884 info.fillCell(*m_stream, gpr); 885 return gpr; 886 } 887 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 890 m_gprs.retain(gpr, virtualRegister, SpillOrderConstant); 891 m_jit.move(MacroAssembler::TrustedImmPtr(jsValue.asCell()), gpr); 892 info.fillCell(*m_stream, gpr); 888 893 return gpr; 889 894 } -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r171660 r171662 996 996 GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister); 997 997 998 if (edge->hasConstant() && !edge->isCellConstant()) { 999 // Better to fail early on constants. 1000 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 1001 return allocate(); 1002 } 1003 998 1004 switch (info.registerFormat()) { 999 1005 case DataFormatNone: { … … 1002 1008 if (edge->hasConstant()) { 1003 1009 JSValue jsValue = edge->asJSValue(); 1004 if (jsValue.isCell()) { 1005 m_gprs.retain(gpr, virtualRegister, SpillOrderConstant); 1006 m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsValue)), gpr); 1007 info.fillJSValue(*m_stream, gpr, DataFormatJSCell); 1008 return gpr; 1009 } 1010 terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0); 1010 m_gprs.retain(gpr, virtualRegister, SpillOrderConstant); 1011 m_jit.move(MacroAssembler::TrustedImm64(JSValue::encode(jsValue)), gpr); 1012 info.fillJSValue(*m_stream, gpr, DataFormatJSCell); 1011 1013 return gpr; 1012 1014 }
Note:
See TracChangeset
for help on using the changeset viewer.