Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index 4cf7df4c78db93b5b778aa97a8010e7ab733a4a9..92fbd415a69df2a3ffe79bab91972bc08b54af39 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -1858,6 +1858,33 @@ void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { |
} |
+Condition LCodeGen::EmitIsString(Register input, |
+ Register temp1, |
+ Label* is_not_string, |
+ Label* is_string) { |
+ __ JumpIfSmi(input, is_not_string); |
+ __ CompareObjectType(input, temp1, temp1, FIRST_NONSTRING_TYPE); |
+ |
+ return lt; |
+} |
+ |
+ |
+void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { |
+ Register reg = ToRegister(instr->InputAt(0)); |
+ Register temp1 = ToRegister(instr->TempAt(0)); |
+ |
+ int true_block = chunk_->LookupDestination(instr->true_block_id()); |
+ int false_block = chunk_->LookupDestination(instr->false_block_id()); |
+ Label* true_label = chunk_->GetAssemblyLabel(true_block); |
+ Label* false_label = chunk_->GetAssemblyLabel(false_block); |
+ |
+ Condition true_cond = |
+ EmitIsString(reg, temp1, false_label, true_label); |
+ |
+ EmitBranch(true_block, false_block, true_cond); |
+} |
+ |
+ |
void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
@@ -1883,6 +1910,41 @@ void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { |
} |
+static Condition ComputeCompareCondition(Token::Value op) { |
+ switch (op) { |
+ case Token::EQ_STRICT: |
+ case Token::EQ: |
+ return eq; |
+ case Token::LT: |
+ return lt; |
+ case Token::GT: |
+ return gt; |
+ case Token::LTE: |
+ return le; |
+ case Token::GTE: |
+ return ge; |
+ default: |
+ UNREACHABLE(); |
+ return kNoCondition; |
+ } |
+} |
+ |
+ |
+void LCodeGen::DoCompareGenericAndBranch(LCompareGenericAndBranch* instr) { |
+ Token::Value op = instr->op(); |
+ int true_block = chunk_->LookupDestination(instr->true_block_id()); |
+ int false_block = chunk_->LookupDestination(instr->false_block_id()); |
+ |
+ Handle<Code> ic = CompareIC::GetUninitialized(op); |
+ CallCode(ic, RelocInfo::CODE_TARGET, instr); |
+ __ cmp(r0, Operand(0)); // This instruction also signals no smi code inlined. |
+ |
+ Condition condition = ComputeCompareCondition(op); |
+ |
+ EmitBranch(true_block, false_block, condition); |
+} |
+ |
+ |
static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { |
InstanceType from = instr->from(); |
InstanceType to = instr->to(); |
@@ -2168,26 +2230,6 @@ void LCodeGen::DoDeferredLInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, |
} |
-static Condition ComputeCompareCondition(Token::Value op) { |
- switch (op) { |
- case Token::EQ_STRICT: |
- case Token::EQ: |
- return eq; |
- case Token::LT: |
- return lt; |
- case Token::GT: |
- return gt; |
- case Token::LTE: |
- return le; |
- case Token::GTE: |
- return ge; |
- default: |
- UNREACHABLE(); |
- return kNoCondition; |
- } |
-} |
- |
- |
void LCodeGen::DoCmpT(LCmpT* instr) { |
Token::Value op = instr->op(); |