Skip to content

Commit c1d61f2

Browse files
targosrefack
authored andcommitted
deps: patch V8 to 7.4.288.17
Refs: v8/v8@7.4.288.13...7.4.288.17 PR-URL: #27066 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent c86883c commit c1d61f2

File tree

12 files changed

+116
-36
lines changed

12 files changed

+116
-36
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 7
1212
#define V8_MINOR_VERSION 4
1313
#define V8_BUILD_NUMBER 288
14-
#define V8_PATCH_LEVEL 13
14+
#define V8_PATCH_LEVEL 17
1515

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

deps/v8/src/builtins/array-map.tq

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ namespace array_map {
127127
for (let i: Smi = 0; i < validLength; i++) {
128128
typeswitch (this.fixedArray.objects[i]) {
129129
case (n: Number): {
130-
elements.floats[i] = Float64SilenceNaN(Convert<float64>(n));
130+
elements.floats[i] = Convert<float64>(n);
131131
}
132132
case (h: HeapObject): {
133133
assert(h == Hole);

deps/v8/src/builtins/base.tq

-2
Original file line numberDiff line numberDiff line change
@@ -1464,8 +1464,6 @@ operator '[]=' macro StoreFixedArrayDirect(a: FixedArray, i: Smi, v: Object) {
14641464

14651465
extern operator '.instance_type' macro LoadMapInstanceType(Map): int32;
14661466

1467-
extern macro Float64SilenceNaN(float64): float64;
1468-
14691467
extern macro GetNumberDictionaryNumberOfElements(NumberDictionary): Smi;
14701468
extern macro GetIteratorMethod(implicit context: Context)(HeapObject): Object
14711469
labels IfIteratorUndefined;

deps/v8/src/code-stub-assembler.cc

+8-5
Original file line numberDiff line numberDiff line change
@@ -2827,7 +2827,9 @@ void CodeStubAssembler::StoreFixedDoubleArrayElement(
28272827
ElementOffsetFromIndex(index_node, PACKED_DOUBLE_ELEMENTS, parameter_mode,
28282828
FixedArray::kHeaderSize - kHeapObjectTag);
28292829
MachineRepresentation rep = MachineRepresentation::kFloat64;
2830-
StoreNoWriteBarrier(rep, object, offset, value);
2830+
// Make sure we do not store signalling NaNs into double arrays.
2831+
TNode<Float64T> value_silenced = Float64SilenceNaN(value);
2832+
StoreNoWriteBarrier(rep, object, offset, value_silenced);
28312833
}
28322834

28332835
void CodeStubAssembler::StoreFeedbackVectorSlot(Node* object,
@@ -2981,7 +2983,9 @@ void CodeStubAssembler::TryStoreArrayElement(ElementsKind kind,
29812983
} else if (IsDoubleElementsKind(kind)) {
29822984
GotoIfNotNumber(value, bailout);
29832985
}
2984-
if (IsDoubleElementsKind(kind)) value = ChangeNumberToFloat64(value);
2986+
if (IsDoubleElementsKind(kind)) {
2987+
value = ChangeNumberToFloat64(value);
2988+
}
29852989
StoreElement(elements, kind, index, value, mode);
29862990
}
29872991

@@ -10236,9 +10240,8 @@ void CodeStubAssembler::StoreElement(Node* elements, ElementsKind kind,
1023610240
StoreNoWriteBarrier(rep, elements, offset, value);
1023710241
return;
1023810242
} else if (IsDoubleElementsKind(kind)) {
10239-
// Make sure we do not store signalling NaNs into double arrays.
10240-
TNode<Float64T> value_silenced = Float64SilenceNaN(value);
10241-
StoreFixedDoubleArrayElement(CAST(elements), index, value_silenced, mode);
10243+
TNode<Float64T> value_float64 = UncheckedCast<Float64T>(value);
10244+
StoreFixedDoubleArrayElement(CAST(elements), index, value_float64, mode);
1024210245
} else {
1024310246
WriteBarrierMode barrier_mode =
1024410247
IsSmiElementsKind(kind) ? SKIP_WRITE_BARRIER : UPDATE_WRITE_BARRIER;

deps/v8/src/compiler/node-properties.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,8 @@ NodeProperties::InferReceiverMapsResult NodeProperties::InferReceiverMaps(
412412
mnewtarget.Ref(broker).IsJSFunction()) {
413413
JSFunctionRef original_constructor =
414414
mnewtarget.Ref(broker).AsJSFunction();
415-
if (original_constructor.has_initial_map()) {
415+
if (original_constructor.map().has_prototype_slot() &&
416+
original_constructor.has_initial_map()) {
416417
original_constructor.Serialize();
417418
MapRef initial_map = original_constructor.initial_map();
418419
if (initial_map.GetConstructor().equals(mtarget.Ref(broker))) {

deps/v8/src/heap/mark-compact.cc

+1
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,7 @@ void MarkCompactCollector::ProcessEphemeronsLinear() {
16451645
// is necessary.
16461646

16471647
work_to_do = !marking_worklist()->IsEmpty() ||
1648+
!marking_worklist()->IsEmbedderEmpty() ||
16481649
!heap()->local_embedder_heap_tracer()->IsRemoteTracingDone();
16491650
CHECK(weak_objects_.discovered_ephemerons.IsEmpty());
16501651
}

deps/v8/src/regexp/regexp-utils.cc

+4-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Handle<String> RegExpUtils::GenericCaptureGetter(
3636

3737
namespace {
3838

39-
V8_INLINE bool HasInitialRegExpMap(Isolate* isolate, Handle<JSReceiver> recv) {
39+
V8_INLINE bool HasInitialRegExpMap(Isolate* isolate, JSReceiver recv) {
4040
return recv->map() == isolate->regexp_function()->initial_map();
4141
}
4242

@@ -47,7 +47,7 @@ MaybeHandle<Object> RegExpUtils::SetLastIndex(Isolate* isolate,
4747
uint64_t value) {
4848
Handle<Object> value_as_object =
4949
isolate->factory()->NewNumberFromInt64(value);
50-
if (HasInitialRegExpMap(isolate, recv)) {
50+
if (HasInitialRegExpMap(isolate, *recv)) {
5151
JSRegExp::cast(*recv)->set_last_index(*value_as_object, SKIP_WRITE_BARRIER);
5252
return recv;
5353
} else {
@@ -59,7 +59,7 @@ MaybeHandle<Object> RegExpUtils::SetLastIndex(Isolate* isolate,
5959

6060
MaybeHandle<Object> RegExpUtils::GetLastIndex(Isolate* isolate,
6161
Handle<JSReceiver> recv) {
62-
if (HasInitialRegExpMap(isolate, recv)) {
62+
if (HasInitialRegExpMap(isolate, *recv)) {
6363
return handle(JSRegExp::cast(*recv)->last_index(), isolate);
6464
} else {
6565
return Object::GetProperty(isolate, recv,
@@ -155,9 +155,7 @@ bool RegExpUtils::IsUnmodifiedRegExp(Isolate* isolate, Handle<Object> obj) {
155155

156156
JSReceiver recv = JSReceiver::cast(*obj);
157157

158-
// Check the receiver's map.
159-
Handle<JSFunction> regexp_function = isolate->regexp_function();
160-
if (recv->map() != regexp_function->initial_map()) return false;
158+
if (!HasInitialRegExpMap(isolate, recv)) return false;
161159

162160
// Check the receiver's prototype's map.
163161
Object proto = recv->map()->prototype();

deps/v8/src/runtime/runtime-regexp.cc

+22-18
Original file line numberDiff line numberDiff line change
@@ -1250,20 +1250,16 @@ static Object SearchRegExpMultiple(Isolate* isolate, Handle<String> subject,
12501250
// doesn't properly call the underlying exec method.
12511251
V8_WARN_UNUSED_RESULT MaybeHandle<String> RegExpReplace(
12521252
Isolate* isolate, Handle<JSRegExp> regexp, Handle<String> string,
1253-
Handle<Object> replace_obj) {
1253+
Handle<String> replace) {
12541254
// Functional fast-paths are dispatched directly by replace builtin.
12551255
DCHECK(RegExpUtils::IsUnmodifiedRegExp(isolate, regexp));
1256-
DCHECK(!replace_obj->IsCallable());
12571256

12581257
Factory* factory = isolate->factory();
12591258

12601259
const int flags = regexp->GetFlags();
12611260
const bool global = (flags & JSRegExp::kGlobal) != 0;
12621261
const bool sticky = (flags & JSRegExp::kSticky) != 0;
12631262

1264-
Handle<String> replace;
1265-
ASSIGN_RETURN_ON_EXCEPTION(isolate, replace,
1266-
Object::ToString(isolate, replace_obj), String);
12671263
replace = String::Flatten(isolate, replace);
12681264

12691265
Handle<RegExpMatchInfo> last_match_info = isolate->regexp_last_match_info();
@@ -1363,18 +1359,23 @@ RUNTIME_FUNCTION(Runtime_RegExpExecMultiple) {
13631359
CONVERT_ARG_HANDLE_CHECKED(String, subject, 1);
13641360
CONVERT_ARG_HANDLE_CHECKED(RegExpMatchInfo, last_match_info, 2);
13651361
CONVERT_ARG_HANDLE_CHECKED(JSArray, result_array, 3);
1362+
1363+
DCHECK(RegExpUtils::IsUnmodifiedRegExp(isolate, regexp));
13661364
CHECK(result_array->HasObjectElements());
13671365

13681366
subject = String::Flatten(isolate, subject);
13691367
CHECK(regexp->GetFlags() & JSRegExp::kGlobal);
13701368

1369+
Object result;
13711370
if (regexp->CaptureCount() == 0) {
1372-
return SearchRegExpMultiple<false>(isolate, subject, regexp,
1373-
last_match_info, result_array);
1371+
result = SearchRegExpMultiple<false>(isolate, subject, regexp,
1372+
last_match_info, result_array);
13741373
} else {
1375-
return SearchRegExpMultiple<true>(isolate, subject, regexp, last_match_info,
1376-
result_array);
1374+
result = SearchRegExpMultiple<true>(isolate, subject, regexp,
1375+
last_match_info, result_array);
13771376
}
1377+
DCHECK(RegExpUtils::IsUnmodifiedRegExp(isolate, regexp));
1378+
return result;
13781379
}
13791380

13801381
RUNTIME_FUNCTION(Runtime_StringReplaceNonGlobalRegExpWithFunction) {
@@ -1691,24 +1692,27 @@ RUNTIME_FUNCTION(Runtime_RegExpReplace) {
16911692

16921693
const bool functional_replace = replace_obj->IsCallable();
16931694

1695+
Handle<String> replace;
1696+
if (!functional_replace) {
1697+
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, replace,
1698+
Object::ToString(isolate, replace_obj));
1699+
}
1700+
16941701
// Fast-path for unmodified JSRegExps (and non-functional replace).
16951702
if (RegExpUtils::IsUnmodifiedRegExp(isolate, recv)) {
16961703
// We should never get here with functional replace because unmodified
16971704
// regexp and functional replace should be fully handled in CSA code.
16981705
CHECK(!functional_replace);
1699-
RETURN_RESULT_OR_FAILURE(
1700-
isolate, RegExpReplace(isolate, Handle<JSRegExp>::cast(recv), string,
1701-
replace_obj));
1706+
Handle<Object> result;
1707+
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
1708+
isolate, result,
1709+
RegExpReplace(isolate, Handle<JSRegExp>::cast(recv), string, replace));
1710+
DCHECK(RegExpUtils::IsUnmodifiedRegExp(isolate, recv));
1711+
return *result;
17021712
}
17031713

17041714
const uint32_t length = string->length();
17051715

1706-
Handle<String> replace;
1707-
if (!functional_replace) {
1708-
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, replace,
1709-
Object::ToString(isolate, replace_obj));
1710-
}
1711-
17121716
Handle<Object> global_obj;
17131717
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
17141718
isolate, global_obj,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2019 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+
function f(arg) {
8+
const o = Reflect.construct(Object, arguments, Proxy);
9+
o.foo = arg;
10+
}
11+
12+
function g(i) {
13+
f(i);
14+
}
15+
16+
g(0);
17+
g(1);
18+
%OptimizeFunctionOnNextCall(g);
19+
g(2);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright 2019 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: --verify-heap --expose-gc
6+
7+
function foo( ) {
8+
return [
9+
0,
10+
1,
11+
2,
12+
3,
13+
4,
14+
5,
15+
6,
16+
7,
17+
8,
18+
9,
19+
10,
20+
0x1000000,
21+
0x40000000,
22+
12,
23+
60,
24+
100,
25+
1000 * 60 * 60 * 24].map(Math.asin);
26+
}
27+
28+
let b = [];
29+
b.constructor = {};
30+
b.constructor[Symbol.species] = function() {};
31+
32+
let a = [];
33+
for (let i = 0; i < 10; i++) {
34+
a.push(foo());
35+
gc();
36+
gc();
37+
gc();
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2019 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+
let re = /x/y;
6+
let cnt = 0;
7+
let str = re[Symbol.replace]("x", {
8+
toString: () => {
9+
cnt++;
10+
if (cnt == 2) {
11+
re.lastIndex = {valueOf: () => {
12+
re.x = 42;
13+
return 0;
14+
}};
15+
}
16+
return 'y$';
17+
}
18+
});
19+
assertEquals("y$", str);

deps/v8/third_party/v8/builtins/array-sort.tq

+1-2
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,7 @@ namespace array {
275275
const object = UnsafeCast<JSObject>(sortState.receiver);
276276
const elements = UnsafeCast<FixedDoubleArray>(object.elements);
277277
const heapVal = UnsafeCast<HeapNumber>(value);
278-
// Make sure we do not store signalling NaNs into double arrays.
279-
const val = Float64SilenceNaN(Convert<float64>(heapVal));
278+
const val = Convert<float64>(heapVal);
280279
StoreFixedDoubleArrayElementSmi(elements, index, val);
281280
return kSuccess;
282281
}

0 commit comments

Comments
 (0)