diff options
author | Myles Borins <myles.borins@gmail.com> | 2016-06-20 21:31:10 -0700 |
---|---|---|
committer | Myles Borins <mborins@us.ibm.com> | 2016-06-22 15:51:14 -0700 |
commit | a84b0f2f7611304d888e2d52f04d41796102e8d1 (patch) | |
tree | c9feb44831adc02d7e825c218223639731645749 /deps | |
parent | efebd0b79d930c50217caaddf1d245d510937bb0 (diff) | |
download | android-node-v8-a84b0f2f7611304d888e2d52f04d41796102e8d1.tar.gz android-node-v8-a84b0f2f7611304d888e2d52f04d41796102e8d1.tar.bz2 android-node-v8-a84b0f2f7611304d888e2d52f04d41796102e8d1.zip |
deps: backport 7dfb5beeec from V8 upstream
This commit backports a fix to a JIT bug in V8.
After 100 or so comparisons `typeof null ==="undefined"` is returning
`true` instead of `false`.
Original commit message:
Fix 'typeof null' canonicalization in crankshaft
BUG=
Review URL: https://codereview.chromium.org/1912553002
Cr-Commit-Position: refs/heads/master@{#35699}
Ref: https://bugs.chromium.org/p/chromium/issues/detail?id=604033
PR-URL: https://github.com/nodejs/node/pull/7348
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaƫl Zasso <mic.besace@gmail.com>
Diffstat (limited to 'deps')
-rw-r--r-- | deps/v8/src/crankshaft/hydrogen-instructions.cc | 2 | ||||
-rw-r--r-- | deps/v8/test/mjsunit/regress/regress-opt-typeof-null.js | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/deps/v8/src/crankshaft/hydrogen-instructions.cc b/deps/v8/src/crankshaft/hydrogen-instructions.cc index a9c6228cd3..729fc588bc 100644 --- a/deps/v8/src/crankshaft/hydrogen-instructions.cc +++ b/deps/v8/src/crankshaft/hydrogen-instructions.cc @@ -1283,7 +1283,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: { @@ -1312,6 +1311,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(); } diff --git a/deps/v8/test/mjsunit/regress/regress-opt-typeof-null.js b/deps/v8/test/mjsunit/regress/regress-opt-typeof-null.js new file mode 100644 index 0000000000..e4721a18c5 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-opt-typeof-null.js @@ -0,0 +1,12 @@ +// 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()); |