Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 205781b9d9f51da066e0a06ca9ca7fa52ab6d94a..588b6b6d7b535679464b627e1b441b58566cc191 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -2116,6 +2116,12 @@ void LCodeGen::DoBranch(LBranch* instr) { |
__ bind(¬_string); |
} |
+ if (expected.Contains(ToBooleanStub::SYMBOL)) { |
+ // Symbol value -> true. |
+ __ CmpInstanceType(map, SYMBOL_TYPE); |
+ __ j(equal, true_label); |
+ } |
+ |
if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
// heap number -> false iff +0, -0, or NaN. |
Label not_heap_number; |
@@ -5979,6 +5985,11 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, |
1 << Map::kIsUndetectable); |
final_branch_condition = zero; |
+ } else if (type_name->Equals(heap()->symbol_string())) { |
+ __ JumpIfSmi(input, false_label); |
+ __ CmpObjectType(input, SYMBOL_TYPE, input); |
+ final_branch_condition = equal; |
+ |
} else if (type_name->Equals(heap()->boolean_string())) { |
__ cmp(input, factory()->true_value()); |
__ j(equal, true_label); |
@@ -6013,13 +6024,7 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, |
__ cmp(input, factory()->null_value()); |
__ j(equal, true_label); |
} |
- if (FLAG_harmony_symbols) { |
- __ CmpObjectType(input, SYMBOL_TYPE, input); |
- __ j(equal, true_label); |
- __ CmpInstanceType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); |
- } else { |
- __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); |
- } |
+ __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); |
__ j(below, false_label); |
__ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |
__ j(above, false_label); |