| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b4363f7 commit 8e80fc7
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ | |||
| 11 | 11 | #define V8_MAJOR_VERSION 9 | |
| 12 | 12 | #define V8_MINOR_VERSION 0 | |
| 13 | 13 | #define V8_BUILD_NUMBER 257 | |
| 14 | - #define V8_PATCH_LEVEL 16 | ||
| 14 | + #define V8_PATCH_LEVEL 17 | ||
| 15 | 15 | ||
| 16 | 16 | // Use 1 for candidates and 0 otherwise. | |
| 17 | 17 | // (Boolean macro values are not supported by all preprocessors.) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1396,7 +1396,9 @@ void InstructionSelector::VisitChangeInt32ToInt64(Node* node) { | |||
| 1396 | 1396 | opcode = load_rep.IsSigned() ? kX64Movsxwq : kX64Movzxwq; | |
| 1397 | 1397 | break; | |
| 1398 | 1398 | case MachineRepresentation::kWord32: | |
| 1399 | - opcode = load_rep.IsSigned() ? kX64Movsxlq : kX64Movl; | ||
| 1399 | + // ChangeInt32ToInt64 must interpret its input as a _signed_ 32-bit | ||
| 1400 | + // integer, so here we must sign-extend the loaded value in any case. | ||
| 1401 | + opcode = kX64Movsxlq; | ||
| 1400 | 1402 | break; | |
| 1401 | 1403 | default: | |
| 1402 | 1404 | UNREACHABLE(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,56 @@ | |||
| 1 | + // Copyright 2021 the V8 project authors. All rights reserved. | ||
| 2 | + // Use of this source code is governed by a BSD-style license that can be | ||
| 3 | + // found in the LICENSE file. | ||
| 4 | + | ||
| 5 | + // Flags: --allow-natives-syntax | ||
| 6 | + | ||
| 7 | + | ||
| 8 | + (function() { | ||
| 9 | + const arr = new Uint32Array([2**31]); | ||
| 10 | + function foo() { | ||
| 11 | + return (arr[0] ^ 0) + 1; | ||
| 12 | + } | ||
| 13 | + %PrepareFunctionForOptimization(foo); | ||
| 14 | + assertEquals(-(2**31) + 1, foo()); | ||
| 15 | + %OptimizeFunctionOnNextCall(foo); | ||
| 16 | + assertEquals(-(2**31) + 1, foo()); | ||
| 17 | + }); | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + // The remaining tests already passed without the bugfix. | ||
| 21 | + | ||
| 22 | + | ||
| 23 | + (function() { | ||
| 24 | + const arr = new Uint16Array([2**15]); | ||
| 25 | + function foo() { | ||
| 26 | + return (arr[0] ^ 0) + 1; | ||
| 27 | + } | ||
| 28 | + %PrepareFunctionForOptimization(foo); | ||
| 29 | + assertEquals(2**15 + 1, foo()); | ||
| 30 | + %OptimizeFunctionOnNextCall(foo); | ||
| 31 | + assertEquals(2**15 + 1, foo()); | ||
| 32 | + })(); | ||
| 33 | + | ||
| 34 | + | ||
| 35 | + (function() { | ||
| 36 | + const arr = new Uint8Array([2**7]); | ||
| 37 | + function foo() { | ||
| 38 | + return (arr[0] ^ 0) + 1; | ||
| 39 | + } | ||
| 40 | + %PrepareFunctionForOptimization(foo); | ||
| 41 | + assertEquals(2**7 + 1, foo()); | ||
| 42 | + %OptimizeFunctionOnNextCall(foo); | ||
| 43 | + assertEquals(2**7 + 1, foo()); | ||
| 44 | + })(); | ||
| 45 | + | ||
| 46 | + | ||
| 47 | + (function() { | ||
| 48 | + const arr = new Int32Array([-(2**31)]); | ||
| 49 | + function foo() { | ||
| 50 | + return (arr[0] >>> 0) + 1; | ||
| 51 | + } | ||
| 52 | + %PrepareFunctionForOptimization(foo); | ||
| 53 | + assertEquals(2**31 + 1, foo()); | ||
| 54 | + %OptimizeFunctionOnNextCall(foo); | ||
| 55 | + assertEquals(2**31 + 1, foo()); | ||
| 56 | + })(); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments