Index: src/mips/lithium-codegen-mips.cc |
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc |
index c32be4f35ca024d6b8abc2ca64b9c19e89ce1705..9b000781576de99779e2738f4f4eeadb0e7af3a7 100644 |
--- a/src/mips/lithium-codegen-mips.cc |
+++ b/src/mips/lithium-codegen-mips.cc |
@@ -1901,6 +1901,12 @@ void LCodeGen::DoBranch(LBranch* instr) { |
__ bind(¬_string); |
} |
+ if (expected.Contains(ToBooleanStub::SYMBOL)) { |
+ // Symbol value -> true. |
+ __ lbu(at, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
+ __ Branch(true_label, eq, at, Operand(SYMBOL_TYPE)); |
Paul Lind
2013/03/23 01:23:40
We cannot use 'at' register in this Branch(), as '
palfia
2013/03/23 01:49:45
Thanks for fixing this! It escaped my attention, t
|
+ } |
+ |
if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
CpuFeatureScope scope(masm(), FPU); |
// heap number -> false iff +0, -0, or NaN. |
@@ -5771,6 +5777,13 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, |
cmp2 = Operand(zero_reg); |
final_branch_condition = eq; |
+ } else if (type_name->Equals(heap()->symbol_string())) { |
+ __ JumpIfSmi(input, false_label); |
+ __ GetObjectType(input, input, scratch); |
+ cmp1 = scratch; |
+ cmp2 = Operand(SYMBOL_TYPE); |
+ final_branch_condition = eq; |
+ |
} else if (type_name->Equals(heap()->boolean_string())) { |
__ LoadRoot(at, Heap::kTrueValueRootIndex); |
__ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); |
@@ -5814,20 +5827,10 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, |
__ LoadRoot(at, Heap::kNullValueRootIndex); |
__ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); |
} |
- if (FLAG_harmony_symbols) { |
- // input is an object, it is safe to use GetObjectType in the delay slot. |
- __ GetObjectType(input, input, scratch); |
- __ Branch(USE_DELAY_SLOT, true_label, eq, scratch, Operand(SYMBOL_TYPE)); |
- // Still an object, so the InstanceType can be loaded. |
- __ lbu(scratch, FieldMemOperand(input, Map::kInstanceTypeOffset)); |
- __ Branch(USE_DELAY_SLOT, false_label, |
- lt, scratch, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
- } else { |
- // input is an object, it is safe to use GetObjectType in the delay slot. |
- __ GetObjectType(input, input, scratch); |
- __ Branch(USE_DELAY_SLOT, false_label, |
- lt, scratch, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
- } |
+ // input is an object, it is safe to use GetObjectType in the delay slot. |
+ __ GetObjectType(input, input, scratch); |
Paul Lind
2013/03/22 22:15:20
There is some tricky stuff with delay slots here t
|
+ __ Branch(USE_DELAY_SLOT, false_label, |
+ lt, scratch, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
// Still an object, so the InstanceType can be loaded. |
__ lbu(scratch, FieldMemOperand(input, Map::kInstanceTypeOffset)); |
__ Branch(USE_DELAY_SLOT, false_label, |