GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — deps: V8: cherry-pick 3066b7b2fcb3 · nodejs/node@9bfb0f3

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • common.gypi
  • deps/v8
    • src/compiler/backend/x64
      • instruction-selector-x64.cc
    • test/mjsunit/compiler
      • regress-1196683.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎common.gypi‎

Copy file name to clipboardExpand all lines: common.gypi
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.49',
39+
'v8_embedder_string': '-node.50',
4040

4141
##### V8 defaults for Node.js #####
4242

Collapse file

‎deps/v8/src/compiler/backend/x64/instruction-selector-x64.cc‎

Copy file name to clipboardExpand all lines: deps/v8/src/compiler/backend/x64/instruction-selector-x64.cc
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,9 @@ void InstructionSelector::VisitChangeInt32ToInt64(Node* node) {
12701270
opcode = load_rep.IsSigned() ? kX64Movsxwq : kX64Movzxwq;
12711271
break;
12721272
case MachineRepresentation::kWord32:
1273-
opcode = load_rep.IsSigned() ? kX64Movsxlq : kX64Movl;
1273+
// ChangeInt32ToInt64 must interpret its input as a _signed_ 32-bit
1274+
// integer, so here we must sign-extend the loaded value in any case.
1275+
opcode = kX64Movsxlq;
12741276
break;
12751277
default:
12761278
UNREACHABLE();
Collapse file

‎deps/v8/test/mjsunit/compiler/regress-1196683.js‎

Copy file name to clipboard
+56Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
})();

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.