Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index 36edfb7dcb066cba82fcb702cea58fbba405057c..fd88b9dda43b5dddd7126e47f74ac1a64094fbbf 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -1614,6 +1614,30 @@ void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { |
} |
+Condition LCodeGen::EmitIsString(Register input, |
+ Register temp1, |
+ Label* is_not_string) { |
+ __ JumpIfSmi(input, is_not_string); |
+ Condition cond = masm_->IsObjectStringType(input, temp1, temp1); |
+ |
+ return cond; |
+} |
+ |
+ |
+void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { |
+ Register reg = ToRegister(instr->InputAt(0)); |
+ Register temp = 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, temp, false_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()); |
@@ -1645,6 +1669,21 @@ void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { |
} |
+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 = TokenToCondition(op, false); |
+ __ testq(rax, rax); |
+ |
+ EmitBranch(true_block, false_block, condition); |
+} |
+ |
+ |
static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { |
InstanceType from = instr->from(); |
InstanceType to = instr->to(); |