Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index 0f7e5b3d79a785a5b4f4a6f93203caed1560fa1f..edd9e8102dfc7e347f157a53751b71db951c5597 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -3971,6 +3971,10 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr, |
__ j(equal, if_true); |
__ CompareRoot(rax, Heap::kFalseValueRootIndex); |
Split(equal, if_true, if_false, fall_through); |
+ } else if (FLAG_harmony_typeof && |
+ check->Equals(isolate()->heap()->null_symbol())) { |
+ __ CompareRoot(rax, Heap::kNullValueRootIndex); |
+ Split(equal, if_true, if_false, fall_through); |
} else if (check->Equals(isolate()->heap()->undefined_symbol())) { |
__ CompareRoot(rax, Heap::kUndefinedValueRootIndex); |
__ j(equal, if_true); |
@@ -3987,8 +3991,10 @@ void FullCodeGenerator::EmitLiteralCompareTypeof(Expression* expr, |
Split(above_equal, if_true, if_false, fall_through); |
} else if (check->Equals(isolate()->heap()->object_symbol())) { |
__ JumpIfSmi(rax, if_false); |
- __ CompareRoot(rax, Heap::kNullValueRootIndex); |
- __ j(equal, if_true); |
+ if (!FLAG_harmony_typeof) { |
+ __ CompareRoot(rax, Heap::kNullValueRootIndex); |
+ __ j(equal, if_true); |
+ } |
__ CmpObjectType(rax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, rdx); |
__ j(below, if_false); |
__ CmpInstanceType(rdx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); |