Index: src/mips/lithium-codegen-mips.cc |
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc |
index afe8056dc7ecd550b126c06aafa4cf356e881a3d..021dd8143d2ac422033f1815946f38b60ea646af 100644 |
--- a/src/mips/lithium-codegen-mips.cc |
+++ b/src/mips/lithium-codegen-mips.cc |
@@ -1677,6 +1677,32 @@ void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { |
} |
+Condition LCodeGen::EmitIsString(Register input, |
+ Register temp1, |
+ Label* is_not_string) { |
+ __ JumpIfSmi(input, is_not_string); |
+ __ GetObjectType(input, temp1, temp1); |
+ |
+ 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* false_label = chunk_->GetAssemblyLabel(false_block); |
+ |
+ Condition true_cond = |
+ EmitIsString(reg, temp1, false_label); |
+ |
+ EmitBranch(true_block, false_block, true_cond, temp1, |
+ Operand(FIRST_NONSTRING_TYPE)); |
+} |
+ |
+ |
void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
@@ -1702,6 +1728,40 @@ 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::DoStringCompareAndBranch(LStringCompareAndBranch* 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); |
+ |
+ Condition condition = ComputeCompareCondition(op); |
+ |
+ EmitBranch(true_block, false_block, condition, v0, Operand(zero_reg)); |
+} |
+ |
+ |
static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { |
InstanceType from = instr->from(); |
InstanceType to = instr->to(); |
@@ -2002,26 +2062,6 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(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(); |