Skip to content

Commit

Permalink
deps: patch V8 to 11.8.172.6
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Sep 15, 2023
1 parent a3b7184 commit 763cfa9
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 7 deletions.
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 11
#define V8_MINOR_VERSION 8
#define V8_BUILD_NUMBER 172
#define V8_PATCH_LEVEL 3
#define V8_PATCH_LEVEL 6

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
12 changes: 7 additions & 5 deletions deps/v8/src/builtins/promise-any.tq
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@ transitioning javascript builtin PromiseAnyRejectElementClosure(
const index = Signed(ChangeUint32ToWord(identityHash)) - 1;

// 6. Let errors be F.[[Errors]].
let errors = *ContextSlot(
let errorsRef:&FixedArray = ContextSlot(
context,
PromiseAnyRejectElementContextSlots::kPromiseAnyRejectElementErrorsSlot);
let errors = *errorsRef;

// 7. Let promiseCapability be F.[[Capability]].

Expand All @@ -133,10 +134,7 @@ transitioning javascript builtin PromiseAnyRejectElementClosure(
IntPtrMax(SmiUntag(remainingElementsCount) - 1, index + 1);
if (newCapacity > errors.length_intptr) deferred {
errors = ExtractFixedArray(errors, 0, errors.length_intptr, newCapacity);
*ContextSlot(
context,
PromiseAnyRejectElementContextSlots::
kPromiseAnyRejectElementErrorsSlot) = errors;
*errorsRef = errors;
}
errors.objects[index] = value;

Expand All @@ -154,6 +152,10 @@ transitioning javascript builtin PromiseAnyRejectElementClosure(

// b. Set error.[[AggregateErrors]] to errors.
const error = ConstructAggregateError(errors);

// After this point, errors escapes to user code. Clear the slot.
*errorsRef = kEmptyFixedArray;

// c. Return ? Call(promiseCapability.[[Reject]], undefined, « error »).
const capability = *ContextSlot(
context,
Expand Down
4 changes: 4 additions & 0 deletions deps/v8/src/json/json-stringifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,10 @@ JsonStringifier::Result JsonStringifier::Serialize_(Handle<Object> object,
if (deferred_string_key) SerializeDeferredKey(comma, key);
return SerializeJSArray(Handle<JSArray>::cast(object), key);
case JS_PRIMITIVE_WRAPPER_TYPE:
if (!need_stack_) {
need_stack_ = true;
return NEED_STACK;
}
if (deferred_string_key) SerializeDeferredKey(comma, key);
return SerializeJSPrimitiveWrapper(
Handle<JSPrimitiveWrapper>::cast(object), key);
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/maglev/maglev-graph-builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5633,7 +5633,7 @@ ReduceResult MaglevGraphBuilder::TryReduceArrayForEach(
// before the call.
if (receiver_info_after_call &&
receiver_info_after_call->possible_maps_are_known()) {
recheck_maps_after_call = receiver_maps_before_loop.contains(
recheck_maps_after_call = !receiver_maps_before_loop.contains(
receiver_info_after_call->possible_maps());
}
}
Expand Down
20 changes: 20 additions & 0 deletions deps/v8/test/mjsunit/json2.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,23 @@ var o = {};
o.somespecialproperty = 10;
o["\x19"] = 10;
assertThrows("JSON.parse('{\"somespecialproperty\":100, \"\x19\":10}')");

let exception_count = 0;
function foo(v) {
try {
v["set-i32"];
} catch (e) {
exception_count++;
}
try {
JSON.stringify(v);
} catch (e) {}
}