Changeset 165098 in webkit for trunk/Source/JavaScriptCore/dfg
- Timestamp:
- Mar 4, 2014, 11:25:02 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore/dfg
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
r165085 r165098 918 918 SpeculatedType leftType = forNode(node->child1()).m_type; 919 919 SpeculatedType rightType = forNode(node->child2()).m_type; 920 if (!valuesCouldBeEqual(leftType, rightType)) { 920 if ((isInt32Speculation(leftType) && isOtherSpeculation(rightType)) 921 || (isOtherSpeculation(leftType) && isInt32Speculation(rightType))) { 921 922 setConstant(node, jsBoolean(false)); 922 923 break; … … 943 944 JSValue right = forNode(rightNode).value(); 944 945 if (left && right) { 946 if (left.isNumber() && right.isNumber()) { 947 setConstant(node, jsBoolean(left.asNumber() == right.asNumber())); 948 break; 949 } 945 950 if (left.isString() && right.isString()) { 946 // We need this case because JSValue::strictEqual is otherwise too racy for947 // string comparisons.948 951 const StringImpl* a = asString(left)->tryGetValueImpl(); 949 952 const StringImpl* b = asString(right)->tryGetValueImpl(); … … 952 955 break; 953 956 } 954 } else { 955 setConstant(node, jsBoolean(JSValue::strictEqual(0, left, right))); 956 break; 957 } 958 } 959 960 SpeculatedType leftLUB = leastUpperBoundOfStrictlyEquivalentSpeculations(forNode(leftNode).m_type); 961 SpeculatedType rightLUB = leastUpperBoundOfStrictlyEquivalentSpeculations(forNode(rightNode).m_type); 962 if (!(leftLUB & rightLUB)) { 963 setConstant(node, jsBoolean(false)); 964 break; 965 } 966 957 } 958 } 967 959 forNode(node).setType(SpecBoolean); 968 960 node->setCanExit(true); // This is overly conservative. -
trunk/Source/JavaScriptCore/dfg/DFGArrayMode.cpp
r165085 r165098 1 1 /* 2 * Copyright (C) 2012, 2013 , 2014Apple Inc. All rights reserved.2 * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 133 133 134 134 ArrayMode ArrayMode::refine( 135 Graph& graph, Node* node,135 Graph& graph, CodeOrigin codeOrigin, 136 136 SpeculatedType base, SpeculatedType index, SpeculatedType value, 137 137 NodeFlags flags) const … … 200 200 201 201 ArrayMode result; 202 switch (node->op()) { 203 case PutByVal: 204 if (graph.hasExitSite(node->origin.semantic, OutOfBounds) || !isInBounds()) 205 result = withSpeculation(Array::OutOfBounds); 206 else 207 result = withSpeculation(Array::InBounds); 208 break; 209 210 default: 202 if (graph.hasExitSite(codeOrigin, OutOfBounds) || !isInBounds()) 203 result = withSpeculation(Array::OutOfBounds); 204 else 211 205 result = withSpeculation(Array::InBounds); 212 break;213 }214 206 215 207 if (isInt8ArraySpeculation(base)) -
trunk/Source/JavaScriptCore/dfg/DFGArrayMode.h
r165085 r165098 1 1 /* 2 * Copyright (C) 2012, 2013 , 2014Apple Inc. All rights reserved.2 * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 221 221 } 222 222 223 ArrayMode refine(Graph&, Node*, SpeculatedType base, SpeculatedType index, SpeculatedType value = SpecNone, NodeFlags = 0) const;223 ArrayMode refine(Graph&, CodeOrigin, SpeculatedType base, SpeculatedType index, SpeculatedType value = SpecNone, NodeFlags = 0) const; 224 224 225 225 bool alreadyChecked(Graph&, Node*, AbstractValue&) const; -
trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
r165085 r165098 433 433 break; 434 434 } 435 if (node->child1()->shouldSpeculateMisc() && node->child2()->shouldSpeculateMisc()) {436 fixEdge<MiscUse>(node->child1());437 fixEdge<MiscUse>(node->child2());438 break;439 }440 435 break; 441 436 } … … 458 453 node->setArrayMode( 459 454 node->arrayMode().refine( 460 m_graph, node ,455 m_graph, node->origin.semantic, 461 456 node->child1()->prediction(), 462 457 node->child2()->prediction(), … … 516 511 node->setArrayMode( 517 512 node->arrayMode().refine( 518 m_graph, node ,513 m_graph, node->origin.semantic, 519 514 child1->prediction(), 520 515 child2->prediction(), … … 602 597 node->setArrayMode( 603 598 node->arrayMode().refine( 604 m_graph, node ,599 m_graph, node->origin.semantic, 605 600 node->child1()->prediction() & SpecCell, 606 601 SpecInt32, … … 1756 1751 1757 1752 arrayMode = arrayMode.refine( 1758 m_graph, node , node->child1()->prediction(), node->prediction());1753 m_graph, node->origin.semantic, node->child1()->prediction(), node->prediction()); 1759 1754 1760 1755 if (arrayMode.type() == Array::Generic) { -
trunk/Source/JavaScriptCore/dfg/DFGNode.h
r165085 r165098 1400 1400 return isBooleanSpeculation(prediction()); 1401 1401 } 1402 1403 bool shouldSpeculateMisc()1404 {1405 return isMiscSpeculation(prediction());1406 }1407 1402 1408 1403 bool shouldSpeculateStringIdent() -
trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h
r165085 r165098 60 60 case NotCellUse: 61 61 case OtherUse: 62 case MiscUse:63 62 case MachineIntUse: 64 63 return; -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r165085 r165098 3803 3803 } 3804 3804 3805 case MiscUse: {3806 compileMiscStrictEq(node);3807 return false;3808 }3809 3810 3805 case UntypedUse: { 3811 3806 return nonSpeculativeStrictEq(node); … … 4836 4831 } 4837 4832 4838 void SpeculativeJIT::speculateMisc(Edge edge, JSValueRegs regs)4839 {4840 #if USE(JSVALUE64)4841 typeCheck(4842 regs, edge, SpecMisc,4843 m_jit.branch64(MacroAssembler::Above, regs.gpr(), MacroAssembler::TrustedImm64(TagBitTypeOther | TagBitBool | TagBitUndefined)));4844 #else4845 typeCheck(4846 regs, edge, SpecMisc | SpecInt32,4847 m_jit.branch32(MacroAssembler::Equal, regs.tagGPR(), MacroAssembler::TrustedImm32(JSValue::Int32Tag)));4848 typeCheck(4849 regs, edge, SpecMisc,4850 m_jit.branch32(MacroAssembler::Below, regs.tagGPR(), MacroAssembler::TrustedImm32(JSValue::UndefinedTag)));4851 #endif4852 }4853 4854 void SpeculativeJIT::speculateMisc(Edge edge)4855 {4856 if (!needsTypeCheck(edge, SpecMisc))4857 return;4858 4859 JSValueOperand operand(this, edge, ManualOperandSpeculation);4860 speculateMisc(edge, operand.jsValueRegs());4861 }4862 4863 4833 void SpeculativeJIT::speculate(Node*, Edge edge) 4864 4834 { … … 4922 4892 case OtherUse: 4923 4893 speculateOther(edge); 4924 break;4925 case MiscUse:4926 speculateMisc(edge);4927 4894 break; 4928 4895 default: -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
r165085 r165098 1986 1986 void compileStringIdentEquality(Node*); 1987 1987 void compileStringZeroLength(Node*); 1988 void compileMiscStrictEq(Node*);1989 1988 1990 1989 void emitObjectOrOtherBranch(Edge value, BasicBlock* taken, BasicBlock* notTaken); … … 2205 2204 void speculateNotCell(Edge); 2206 2205 void speculateOther(Edge); 2207 void speculateMisc(Edge, JSValueRegs);2208 void speculateMisc(Edge);2209 2206 void speculate(Node*, Edge); 2210 2207 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r165085 r165098 612 612 613 613 booleanResult(resultPayloadGPR, node, UseChildrenCalledExplicitly); 614 }615 616 void SpeculativeJIT::compileMiscStrictEq(Node* node)617 {618 JSValueOperand op1(this, node->child1(), ManualOperandSpeculation);619 JSValueOperand op2(this, node->child2(), ManualOperandSpeculation);620 GPRTemporary result(this);621 622 speculateMisc(node->child1(), op1.jsValueRegs());623 speculateMisc(node->child2(), op2.jsValueRegs());624 625 m_jit.move(TrustedImm32(0), result.gpr());626 JITCompiler::Jump notEqual = m_jit.branch32(JITCompiler::NotEqual, op1.tagGPR(), op2.tagGPR());627 m_jit.compare32(JITCompiler::Equal, op1.payloadGPR(), op2.payloadGPR(), result.gpr());628 notEqual.link(&m_jit);629 booleanResult(result.gpr(), node);630 614 } 631 615 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r165085 r165098 647 647 648 648 jsValueResult(resultGPR, m_currentNode, DataFormatJSBoolean, UseChildrenCalledExplicitly); 649 }650 651 void SpeculativeJIT::compileMiscStrictEq(Node* node)652 {653 JSValueOperand op1(this, node->child1(), ManualOperandSpeculation);654 JSValueOperand op2(this, node->child2(), ManualOperandSpeculation);655 GPRTemporary result(this);656 657 speculateMisc(node->child1(), op1.jsValueRegs());658 speculateMisc(node->child2(), op2.jsValueRegs());659 660 m_jit.compare32(JITCompiler::Equal, op1.gpr(), op2.gpr(), result.gpr());661 m_jit.or32(TrustedImm32(ValueFalse), result.gpr());662 jsValueResult(result.gpr(), node, DataFormatJSBoolean);663 649 } 664 650 -
trunk/Source/JavaScriptCore/dfg/DFGUseKind.cpp
r165085 r165098 1 1 /* 2 * Copyright (C) 2013 , 2014Apple Inc. All rights reserved.2 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 98 98 out.print("Other"); 99 99 break; 100 case MiscUse:101 out.print("Misc");102 break;103 100 default: 104 101 RELEASE_ASSERT_NOT_REACHED(); -
trunk/Source/JavaScriptCore/dfg/DFGUseKind.h
r165085 r165098 1 1 /* 2 * Copyright (C) 2013 , 2014Apple Inc. All rights reserved.2 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 55 55 NotCellUse, 56 56 OtherUse, 57 MiscUse,58 57 LastUseKind // Must always be the last entry in the enum, as it is used to denote the number of enum elements. 59 58 }; … … 98 97 case OtherUse: 99 98 return SpecOther; 100 case MiscUse:101 return SpecMisc;102 99 default: 103 100 RELEASE_ASSERT_NOT_REACHED();
Note:
See TracChangeset
for help on using the changeset viewer.