Chromium Code Reviews| Index: src/ia32/lithium-codegen-ia32.cc |
| diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
| index 86ac466ae8740dc46c85df4da8d887ee9a40e913..307b8e00fd291ad1082b13b3dff2e2318b11d49b 100644 |
| --- a/src/ia32/lithium-codegen-ia32.cc |
| +++ b/src/ia32/lithium-codegen-ia32.cc |
| @@ -1325,6 +1325,26 @@ static const char* LabelType(LLabel* label) { |
| } |
| +static Condition ComputeCompareCondition(Token::Value op) { |
| + switch (op) { |
| + case Token::EQ_STRICT: |
| + case Token::EQ: |
| + return equal; |
| + case Token::LT: |
| + return less; |
| + case Token::GT: |
| + return greater; |
| + case Token::LTE: |
| + return less_equal; |
| + case Token::GTE: |
| + return greater_equal; |
| + default: |
| + UNREACHABLE(); |
| + return no_condition; |
| + } |
| +} |
| + |
| + |
| void LCodeGen::DoLabel(LLabel* label) { |
| Comment(";;; <@%d,#%d> -------------------- B%d%s --------------------", |
| current_instruction_, |
| @@ -2380,6 +2400,13 @@ void LCodeGen::EmitFalseBranch(InstrType instr, Condition cc) { |
| } |
| +void LCodeGen::DoAndBranch(LAndBranch* instr) { |
| + Condition condition = ComputeCompareCondition(instr->op()); |
| + __ test(ToRegister(instr->value()), ToRegister(instr->value())); |
| + EmitBranch(instr, condition); |
| +} |
| + |
| + |
| void LCodeGen::DoBranch(LBranch* instr) { |
| Representation r = instr->hydrogen()->value()->representation(); |
| if (r.IsSmiOrInteger32()) { |
| @@ -2753,26 +2780,6 @@ void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { |
| } |
| -static Condition ComputeCompareCondition(Token::Value op) { |
| - switch (op) { |
| - case Token::EQ_STRICT: |
| - case Token::EQ: |
| - return equal; |
| - case Token::LT: |
| - return less; |
| - case Token::GT: |
| - return greater; |
| - case Token::LTE: |
| - return less_equal; |
| - case Token::GTE: |
| - return greater_equal; |
| - default: |
| - UNREACHABLE(); |
| - return no_condition; |
| - } |
| -} |
| - |
| - |
| void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { |
| Token::Value op = instr->op(); |
| @@ -3058,16 +3065,10 @@ void LCodeGen::DoCmpT(LCmpT* instr) { |
| Handle<Code> ic = CompareIC::GetUninitialized(isolate(), op); |
| CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| + __ nop(); |
|
titzer
2013/10/10 14:05:25
What's the nop for?
|
| - Condition condition = ComputeCompareCondition(op); |
| - Label true_value, done; |
| - __ test(eax, Operand(eax)); |
| - __ j(condition, &true_value, Label::kNear); |
| - __ mov(ToRegister(instr->result()), factory()->false_value()); |
| - __ jmp(&done, Label::kNear); |
| - __ bind(&true_value); |
| - __ mov(ToRegister(instr->result()), factory()->true_value()); |
| - __ bind(&done); |
| + Register res = ToRegister(instr->result()); |
| + if (!res.is(eax)) __ mov(res, eax); |
| } |