Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index 994c9ff61e45c020c15cb775f79957b168bcc7ca..14ced5e8bd6b202839e2ff582b3401a0b21b43b8 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -4105,6 +4105,10 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr, |
__ j(equal, if_true); |
__ cmp(eax, isolate()->factory()->false_value()); |
Split(equal, if_true, if_false, fall_through); |
+ } else if (FLAG_harmony_typeof && |
+ check->Equals(isolate()->heap()->null_symbol())) { |
+ __ cmp(eax, isolate()->factory()->null_value()); |
+ Split(equal, if_true, if_false, fall_through); |
} else if (check->Equals(isolate()->heap()->undefined_symbol())) { |
__ cmp(eax, isolate()->factory()->undefined_value()); |
__ j(equal, if_true); |
@@ -4120,8 +4124,10 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr, |
Split(above_equal, if_true, if_false, fall_through); |
} else if (check->Equals(isolate()->heap()->object_symbol())) { |
__ JumpIfSmi(eax, if_false); |
- __ cmp(eax, isolate()->factory()->null_value()); |
- __ j(equal, if_true); |
+ if (!FLAG_harmony_typeof) { |
+ __ cmp(eax, isolate()->factory()->null_value()); |
+ __ j(equal, if_true); |
+ } |
__ CmpObjectType(eax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, edx); |
__ j(below, if_false); |
__ CmpInstanceType(edx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |