Skip to content

Commit 2930867

Browse files
committed
deps: update V8 to 4.6.85.31
This update contains the patch floated in #3390 and a fix for Intl.NumberFormat. Diff: https://chromium.googlesource.com/v8/v8.git/+/4.6.85.28..4.6.85.31 PR-URL: #3698 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]>
1 parent 25cd455 commit 2930867

File tree

5 files changed

+91
-6
lines changed

5 files changed

+91
-6
lines changed

deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 4
1212
#define V8_MINOR_VERSION 6
1313
#define V8_BUILD_NUMBER 85
14-
#define V8_PATCH_LEVEL 28
14+
#define V8_PATCH_LEVEL 31
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/arm64/lithium-codegen-arm64.cc

+2
Original file line numberDiff line numberDiff line change
@@ -2819,6 +2819,8 @@ void LCodeGen::DoDoubleToIntOrSmi(LDoubleToIntOrSmi* instr) {
28192819

28202820
void LCodeGen::DoDrop(LDrop* instr) {
28212821
__ Drop(instr->count());
2822+
2823+
RecordPushedArgumentsDelta(instr->hydrogen_value()->argument_delta());
28222824
}
28232825

28242826

deps/v8/src/i18n.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1103,14 +1103,15 @@ function initializeNumberFormat(numberFormat, locales, options) {
11031103

11041104
var mnfd = options['minimumFractionDigits'];
11051105
var mxfd = options['maximumFractionDigits'];
1106-
if (!IS_UNDEFINED(mnfd) || !internalOptions.style === 'currency') {
1106+
if (!IS_UNDEFINED(mnfd) || internalOptions.style !== 'currency') {
11071107
mnfd = getNumberOption(options, 'minimumFractionDigits', 0, 20, 0);
11081108
defineWEProperty(internalOptions, 'minimumFractionDigits', mnfd);
11091109
}
11101110

1111-
if (!IS_UNDEFINED(mxfd) || !internalOptions.style === 'currency') {
1111+
if (!IS_UNDEFINED(mxfd) || internalOptions.style !== 'currency') {
1112+
var min_mxfd = internalOptions.style === 'percent' ? 0 : 3;
11121113
mnfd = IS_UNDEFINED(mnfd) ? 0 : mnfd;
1113-
fallback_limit = (mnfd > 3) ? mnfd : 3;
1114+
fallback_limit = (mnfd > min_mxfd) ? mnfd : min_mxfd;
11141115
mxfd = getNumberOption(options, 'maximumFractionDigits', mnfd, 20, fallback_limit);
11151116
defineWEProperty(internalOptions, 'maximumFractionDigits', mxfd);
11161117
}

deps/v8/test/intl/number-format/check-minimum-fraction-digits.js

+50-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,56 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// Make sure minimumFractionDigits is honored
5+
// Make sure minimumFractionDigits and maximumFractionDigits are honored
66

7-
var nf = new Intl.NumberFormat("en-us",{ useGrouping: false, minimumFractionDigits: 4});
7+
var nf = new Intl.NumberFormat("en-us", { useGrouping: false, minimumFractionDigits: 4, maximumFractionDigits: 8});
88

99
assertEquals("12345.6789", nf.format(12345.6789));
10+
assertEquals("12345.678912", nf.format(12345.678912));
11+
assertEquals("12345.6700", nf.format(12345.67));
12+
assertEquals("12345.67891234", nf.format(12345.6789123421));
13+
14+
nf = new Intl.NumberFormat("en-us", { useGrouping: false, minimumFractionDigits: 4, maximumFractionDigits: 8, style: 'percent'});
15+
16+
assertEquals("12345.6789%", nf.format(123.456789));
17+
assertEquals("12345.678912%", nf.format(123.45678912));
18+
assertEquals("12345.6700%", nf.format(123.4567));
19+
assertEquals("12345.67891234%", nf.format(123.456789123421));
20+
21+
nf = new Intl.NumberFormat('en', {minimumFractionDigits: 4, maximumFractionDigits: 8, style: 'currency', currency: 'USD'});
22+
23+
assertEquals("$54,306.404797", nf.format(54306.4047970));
24+
assertEquals("$54,306.4000", nf.format(54306.4));
25+
assertEquals("$54,306.40000001", nf.format(54306.400000011));
26+
27+
// Ensure that appropriate defaults exist when minimum and maximum are not specified
28+
29+
nf = new Intl.NumberFormat("en-us", { useGrouping: false });
30+
31+
assertEquals("12345.679", nf.format(12345.6789));
32+
assertEquals("12345.679", nf.format(12345.678912));
33+
assertEquals("12345.67", nf.format(12345.6700));
34+
assertEquals("12345", nf.format(12345));
35+
assertEquals("12345.679", nf.format(12345.6789123421));
36+
37+
nf = new Intl.NumberFormat("en-us", { useGrouping: false, style: 'percent'});
38+
39+
assertEquals("12346%", nf.format(123.456789));
40+
assertEquals("12346%", nf.format(123.45678912));
41+
assertEquals("12346%", nf.format(123.456700));
42+
assertEquals("12346%", nf.format(123.456789123421));
43+
assertEquals("12345%", nf.format(123.45));
44+
45+
// For currency, the minimum or the maximum can be overwritten individually
46+
47+
nf = new Intl.NumberFormat('en', {minimumFractionDigits: 0, style: 'currency', currency: 'USD'});
48+
49+
assertEquals("$54,306.4", nf.format(54306.4047970));
50+
assertEquals("$54,306.4", nf.format(54306.4));
51+
assertEquals("$54,306", nf.format(54306));
52+
53+
nf = new Intl.NumberFormat('en', {maximumFractionDigits: 3, style: 'currency', currency: 'USD'});
54+
55+
assertEquals("$54,306.405", nf.format(54306.4047970));
56+
assertEquals("$54,306.40", nf.format(54306.4));
57+
assertEquals("$54,306.00", nf.format(54306));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2015 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+
"use strict";
8+
9+
function Message(message) {
10+
this.message = message;
11+
}
12+
13+
function Inlined(input) {
14+
var dummy = arguments[1] === undefined;
15+
if (input instanceof Message) {
16+
return input;
17+
}
18+
print("unreachable, but we must create register allocation complexity");
19+
return [];
20+
}
21+
22+
function Process(input) {
23+
var ret = [];
24+
ret.push(Inlined(input[0], 1, 2));
25+
return ret;
26+
}
27+
28+
var input = [new Message("TEST PASS")];
29+
30+
Process(input);
31+
Process(input);
32+
%OptimizeFunctionOnNextCall(Process);
33+
var result = Process(input);
34+
assertEquals("TEST PASS", result[0].message);

0 commit comments

Comments
 (0)