Changeset 51735 in webkit for trunk/JavaScriptCore/bytecompiler
- Timestamp:
- Dec 6, 2009, 1:42:03 AM (15 years ago)
- Location:
- trunk/JavaScriptCore/bytecompiler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r50916 r51735 617 617 PassRefPtr<Label> BytecodeGenerator::emitJumpIfTrue(RegisterID* cond, Label* target) 618 618 { 619 if (m_lastOpcodeID == op_less && !target->isForward()) {619 if (m_lastOpcodeID == op_less) { 620 620 int dstIndex; 621 621 int src1Index; … … 628 628 629 629 size_t begin = instructions().size(); 630 emitOpcode( op_loop_if_less);630 emitOpcode(target->isForward() ? op_jless : op_loop_if_less); 631 631 instructions().append(src1Index); 632 632 instructions().append(src2Index); … … 693 693 PassRefPtr<Label> BytecodeGenerator::emitJumpIfFalse(RegisterID* cond, Label* target) 694 694 { 695 ASSERT(target->isForward()); 696 697 if (m_lastOpcodeID == op_less) { 695 if (m_lastOpcodeID == op_less && target->isForward()) { 698 696 int dstIndex; 699 697 int src1Index; … … 712 710 return target; 713 711 } 714 } else if (m_lastOpcodeID == op_lesseq ) {712 } else if (m_lastOpcodeID == op_lesseq && target->isForward()) { 715 713 int dstIndex; 716 714 int src1Index; … … 739 737 740 738 size_t begin = instructions().size(); 741 emitOpcode( op_jtrue);739 emitOpcode(target->isForward() ? op_jtrue : op_loop_if_true); 742 740 instructions().append(srcIndex); 743 741 instructions().append(target->bind(begin, instructions().size())); 744 742 return target; 745 743 } 746 } else if (m_lastOpcodeID == op_eq_null ) {744 } else if (m_lastOpcodeID == op_eq_null && target->isForward()) { 747 745 int dstIndex; 748 746 int srcIndex; … … 759 757 return target; 760 758 } 761 } else if (m_lastOpcodeID == op_neq_null ) {759 } else if (m_lastOpcodeID == op_neq_null && target->isForward()) { 762 760 int dstIndex; 763 761 int srcIndex; … … 777 775 778 776 size_t begin = instructions().size(); 779 emitOpcode( op_jfalse);777 emitOpcode(target->isForward() ? op_jfalse : op_loop_if_false); 780 778 instructions().append(cond->index()); 781 779 instructions().append(target->bind(begin, instructions().size())); -
trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r50254 r51735 193 193 } 194 194 195 void emitNodeInConditionContext(ExpressionNode* n, Label* trueTarget, Label* falseTarget, bool fallThroughMeansTrue) 196 { 197 if (!m_codeBlock->numberOfLineInfos() || m_codeBlock->lastLineInfo().lineNumber != n->lineNo()) { 198 LineInfo info = { instructions().size(), n->lineNo() }; 199 m_codeBlock->addLineInfo(info); 200 } 201 if (m_emitNodeDepth >= s_maxEmitNodeDepth) 202 emitThrowExpressionTooDeepException(); 203 ++m_emitNodeDepth; 204 n->emitBytecodeInConditionContext(*this, trueTarget, falseTarget, fallThroughMeansTrue); 205 --m_emitNodeDepth; 206 } 207 195 208 void emitExpressionInfo(unsigned divot, unsigned startOffset, unsigned endOffset) 196 209 {
Note:
See TracChangeset
for help on using the changeset viewer.