Commit 7dfb5bee authored by verwaest's avatar verwaest Committed by Commit bot

Fix 'typeof null' canonicalization in crankshaft

BUG=

Review URL: https://codereview.chromium.org/1912553002

Cr-Commit-Position: refs/heads/master@{#35699}
parent b3cf031e
......@@ -1203,7 +1203,6 @@ namespace {
String* TypeOfString(HConstant* constant, Isolate* isolate) {
Heap* heap = isolate->heap();
if (constant->HasNumberValue()) return heap->number_string();
if (constant->IsUndetectable()) return heap->undefined_string();
if (constant->HasStringValue()) return heap->string_string();
switch (constant->GetInstanceType()) {
case ODDBALL_TYPE: {
......@@ -1232,6 +1231,7 @@ String* TypeOfString(HConstant* constant, Isolate* isolate) {
return nullptr;
}
default:
if (constant->IsUndetectable()) return heap->undefined_string();
if (constant->IsCallable()) return heap->function_string();
return heap->object_string();
}
......
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
function f() {
return typeof null === "object";
};
%OptimizeFunctionOnNextCall(f);
assertTrue(f());
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment