Skip to content

Commit d9b4369

Browse files
github-actions[bot]auto user
andauthored
Auto update version to 11.9.169.6 (#74)
Co-authored-by: auto user <auto@redis.com>
1 parent c69eaa2 commit d9b4369

File tree

14 files changed

+462
-129
lines changed

14 files changed

+462
-129
lines changed

V8_DEFAULT_VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
11.8.172.17
1+
11.9.169.6

v8_c_api/src/v8include/js_protocol.pdl

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,8 +1014,7 @@ domain Runtime
10141014
# Unique script identifier.
10151015
type ScriptId extends string
10161016

1017-
# Represents options for serialization. Overrides `generatePreview`, `returnByValue` and
1018-
# `generateWebDriverValue`.
1017+
# Represents options for serialization. Overrides `generatePreview` and `returnByValue`.
10191018
type SerializationOptions extends object
10201019
properties
10211020
enum serialization
@@ -1027,8 +1026,7 @@ domain Runtime
10271026
# `returnByValue: true`. Overrides `returnByValue`.
10281027
json
10291028
# Only remote object id is put in the result. Same bahaviour as if no
1030-
# `serializationOptions`, `generatePreview`, `returnByValue` nor `generateWebDriverValue`
1031-
# are provided.
1029+
# `serializationOptions`, `generatePreview` nor `returnByValue` are provided.
10321030
idOnly
10331031

10341032
# Deep serialization depth. Default is full depth. Respected only in `deep` serialization mode.
@@ -1066,6 +1064,7 @@ domain Runtime
10661064
arraybuffer
10671065
node
10681066
window
1067+
generator
10691068
optional any value
10701069
optional string objectId
10711070
# Set if value reference met more then once during serialization. In such
@@ -1125,8 +1124,6 @@ domain Runtime
11251124
optional UnserializableValue unserializableValue
11261125
# String representation of the object.
11271126
optional string description
1128-
# Deprecated. Use `deepSerializedValue` instead. WebDriver BiDi representation of the value.
1129-
deprecated optional DeepSerializedValue webDriverValue
11301127
# Deep serialized value.
11311128
experimental optional DeepSerializedValue deepSerializedValue
11321129
# Unique object identifier (for non-primitive values).
@@ -1442,13 +1439,8 @@ domain Runtime
14421439
# boundaries).
14431440
# This is mutually exclusive with `executionContextId`.
14441441
experimental optional string uniqueContextId
1445-
# Deprecated. Use `serializationOptions: {serialization:"deep"}` instead.
1446-
# Whether the result should contain `webDriverValue`, serialized according to
1447-
# https://w3c.github.io/webdriver-bidi. This is mutually exclusive with `returnByValue`, but
1448-
# resulting `objectId` is still provided.
1449-
deprecated optional boolean generateWebDriverValue
14501442
# Specifies the result serialization. If provided, overrides
1451-
# `generatePreview`, `returnByValue` and `generateWebDriverValue`.
1443+
# `generatePreview` and `returnByValue`.
14521444
experimental optional SerializationOptions serializationOptions
14531445

14541446
returns
@@ -1536,14 +1528,8 @@ domain Runtime
15361528
# boundaries).
15371529
# This is mutually exclusive with `contextId`.
15381530
experimental optional string uniqueContextId
1539-
# Deprecated. Use `serializationOptions: {serialization:"deep"}` instead.
1540-
# Whether the result should contain `webDriverValue`, serialized
1541-
# according to
1542-
# https://w3c.github.io/webdriver-bidi. This is mutually exclusive with `returnByValue`, but
1543-
# resulting `objectId` is still provided.
1544-
deprecated optional boolean generateWebDriverValue
15451531
# Specifies the result serialization. If provided, overrides
1546-
# `generatePreview`, `returnByValue` and `generateWebDriverValue`.
1532+
# `generatePreview` and `returnByValue`.
15471533
experimental optional SerializationOptions serializationOptions
15481534
returns
15491535
# Evaluation result.

v8_c_api/src/v8include/v8-container.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,42 @@ class V8_EXPORT Array : public Object {
4343
return static_cast<Array*>(value);
4444
}
4545

46+
enum class CallbackResult {
47+
kException,
48+
kBreak,
49+
kContinue,
50+
};
51+
using IterationCallback = CallbackResult (*)(uint32_t index,
52+
Local<Value> element,
53+
void* data);
54+
55+
/**
56+
* Calls {callback} for every element of this array, passing {callback_data}
57+
* as its {data} parameter.
58+
* This function will typically be faster than calling {Get()} repeatedly.
59+
* As a consequence of being optimized for low overhead, the provided
60+
* callback must adhere to the following restrictions:
61+
* - It must not allocate any V8 objects and continue iterating; it may
62+
* allocate (e.g. an error message/object) and then immediately terminate
63+
* the iteration.
64+
* - It must not modify the array being iterated.
65+
* - It must not call back into V8 (unless it can guarantee that such a
66+
* call does not violate the above restrictions, which is difficult).
67+
* - The {Local<Value> element} must not "escape", i.e. must not be assigned
68+
* to any other {Local}. Creating a {Global} from it, or updating a
69+
* v8::TypecheckWitness with it, is safe.
70+
* These restrictions may be lifted in the future if use cases arise that
71+
* justify a slower but more robust implementation.
72+
*
73+
* Returns {Nothing} on exception; use a {TryCatch} to catch and handle this
74+
* exception.
75+
* When the {callback} returns {kException}, iteration is terminated
76+
* immediately, returning {Nothing}. By returning {kBreak}, the callback
77+
* can request non-exceptional early termination of the iteration.
78+
*/
79+
Maybe<void> Iterate(Local<Context> context, IterationCallback callback,
80+
void* callback_data);
81+
4682
private:
4783
Array();
4884
static void CheckCast(Value* obj);

v8_c_api/src/v8include/v8-exception.h

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,21 @@ class ThreadLocalTop;
3030
*/
3131
class V8_EXPORT Exception {
3232
public:
33-
static Local<Value> RangeError(Local<String> message);
34-
static Local<Value> ReferenceError(Local<String> message);
35-
static Local<Value> SyntaxError(Local<String> message);
36-
static Local<Value> TypeError(Local<String> message);
37-
static Local<Value> WasmCompileError(Local<String> message);
38-
static Local<Value> WasmLinkError(Local<String> message);
39-
static Local<Value> WasmRuntimeError(Local<String> message);
40-
static Local<Value> Error(Local<String> message);
33+
static Local<Value> RangeError(Local<String> message,
34+
Local<Value> options = {});
35+
static Local<Value> ReferenceError(Local<String> message,
36+
Local<Value> options = {});
37+
static Local<Value> SyntaxError(Local<String> message,
38+
Local<Value> options = {});
39+
static Local<Value> TypeError(Local<String> message,
40+
Local<Value> options = {});
41+
static Local<Value> WasmCompileError(Local<String> message,
42+
Local<Value> options = {});
43+
static Local<Value> WasmLinkError(Local<String> message,
44+
Local<Value> options = {});
45+
static Local<Value> WasmRuntimeError(Local<String> message,
46+
Local<Value> options = {});
47+
static Local<Value> Error(Local<String> message, Local<Value> options = {});
4148

4249
/**
4350
* Creates an error message for the given exception.

v8_c_api/src/v8include/v8-inspector.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,6 @@ class V8_EXPORT V8InspectorSession {
217217
virtual void stop() = 0;
218218
};
219219

220-
// Deprecated.
221-
// TODO(crbug.com/1420968): remove.
222-
class V8_EXPORT WebDriverValue {
223-
public:
224-
explicit WebDriverValue(std::unique_ptr<StringBuffer> type,
225-
v8::MaybeLocal<v8::Value> value = {})
226-
: type(std::move(type)), value(value) {}
227-
std::unique_ptr<StringBuffer> type;
228-
v8::MaybeLocal<v8::Value> value;
229-
};
230-
231220
struct V8_EXPORT DeepSerializedValue {
232221
explicit DeepSerializedValue(std::unique_ptr<StringBuffer> type,
233222
v8::MaybeLocal<v8::Value> value = {})
@@ -266,12 +255,6 @@ class V8_EXPORT V8InspectorClient {
266255
virtual void beginUserGesture() {}
267256
virtual void endUserGesture() {}
268257

269-
// Deprecated. Use `deepSerialize` instead.
270-
// TODO(crbug.com/1420968): remove.
271-
virtual std::unique_ptr<WebDriverValue> serializeToWebDriverValue(
272-
v8::Local<v8::Value> v8Value, int maxDepth) {
273-
return nullptr;
274-
}
275258
virtual std::unique_ptr<DeepSerializationResult> deepSerialize(
276259
v8::Local<v8::Value> v8Value, int maxDepth,
277260
v8::Local<v8::Object> additionalParameters) {

v8_c_api/src/v8include/v8-internal.h

Lines changed: 53 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -484,65 +484,74 @@ PER_ISOLATE_EXTERNAL_POINTER_TAGS(CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS)
484484
// Indirect Pointers.
485485
//
486486
// When the sandbox is enabled, indirect pointers are used to reference
487-
// HeapObjects that live outside of the sandbox (but are still managed through
488-
// the GC). When object A references an object B through an indirect pointer,
489-
// object A will contain a IndirectPointerHandle, i.e. a shifted 32-bit index,
490-
// which identifies an entry in a pointer table (such as the CodePointerTable).
487+
// HeapObjects that live outside of the sandbox (but are still managed by V8's
488+
// garbage collector). When object A references an object B through an indirect
489+
// pointer, object A will contain a IndirectPointerHandle, i.e. a shifted
490+
// 32-bit index, which identifies an entry in a pointer table (generally an
491+
// indirect pointer table, or the code pointer table if it is a Code object).
491492
// This table entry then contains the actual pointer to object B. Further,
492493
// object B owns this pointer table entry, and it is responsible for updating
493494
// the "self-pointer" in the entry when it is relocated in memory. This way, in
494495
// contrast to "normal" pointers, indirect pointers never need to be tracked by
495496
// the GC (i.e. there is no remembered set for them).
496-
// Currently there is only one type of object referenced through indirect
497-
// pointers (Code objects), but once there are different types of such objects,
498-
// the pointer table entry would probably also contain the type of the target
499-
// object (e.g. by XORing the instance type into the top bits of the pointer).
500497

501498
// An IndirectPointerHandle represents a 32-bit index into a pointer table.
502499
using IndirectPointerHandle = uint32_t;
503500

501+
// The size of the virtual memory reservation for the indirect pointer table.
502+
// As with the external pointer table, a maximum table size in combination with
503+
// shifted indices allows omitting bounds checks.
504+
constexpr size_t kIndirectPointerTableReservationSize = 8 * MB;
505+
504506
// The indirect pointer handles are stores shifted to the left by this amount
505507
// to guarantee that they are smaller than the maximum table size.
506-
constexpr uint32_t kIndirectPointerHandleShift = 6;
508+
constexpr uint32_t kIndirectPointerHandleShift = 12;
507509

508510
// A null handle always references an entry that contains nullptr.
509511
constexpr IndirectPointerHandle kNullIndirectPointerHandle = 0;
510512

511-
// Currently only Code objects can be referenced through indirect pointers and
512-
// various places rely on that assumption. They will all static_assert against
513-
// this constant to make them easy to find and fix once we reference other types
514-
// of objects indirectly.
515-
constexpr bool kAllIndirectPointerObjectsAreCode = true;
513+
// The maximum number of entries in an indirect pointer table.
514+
constexpr int kIndirectPointerTableEntrySize = 8;
515+
constexpr int kIndirectPointerTableEntrySizeLog2 = 3;
516+
constexpr size_t kMaxIndirectPointers =
517+
kIndirectPointerTableReservationSize / kIndirectPointerTableEntrySize;
518+
static_assert((1 << (32 - kIndirectPointerHandleShift)) == kMaxIndirectPointers,
519+
"kIndirectPointerTableReservationSize and "
520+
"kIndirectPointerHandleShift don't match");
516521

517522
//
518523
// Code Pointers.
519524
//
520525
// When the sandbox is enabled, Code objects are referenced from inside the
521526
// sandbox through indirect pointers that reference entries in the code pointer
522-
// table (CPT). Each entry in the CPT contains both a pointer to a Code object
523-
// as well as a pointer to the Code's entrypoint. This allows calling/jumping
524-
// into Code with one fewer memory access (compared to the case where the
525-
// entrypoint pointer needs to be loaded from the Code object).
526-
// As such, a CodePointerHandle can be used both to obtain the referenced Code
527-
// object and to directly load its entrypoint pointer.
527+
// table (CPT) instead of the indirect pointer table (IPT). Each entry in the
528+
// CPT contains both a pointer to a Code object as well as a pointer to the
529+
// Code's entrypoint. This allows calling/jumping into Code with one fewer
530+
// memory access (compared to the case where the entrypoint pointer needs to be
531+
// loaded from the Code object). As such, a CodePointerHandle can be used both
532+
// to obtain the referenced Code object and to directly load its entrypoint
533+
// pointer.
528534
using CodePointerHandle = IndirectPointerHandle;
529-
constexpr uint32_t kCodePointerHandleShift = kIndirectPointerHandleShift;
530-
constexpr CodePointerHandle kNullCodePointerHandle = 0;
531535

532-
// The size of the virtual memory reservation for code pointer table.
533-
// This determines the maximum number of entries in a table. Using a maximum
534-
// size allows omitting bounds checks on table accesses if the indices are
535-
// guaranteed (e.g. through shifting) to be below the maximum index. This
536-
// value must be a power of two.
536+
// The size of the virtual memory reservation for the code pointer table.
537+
// As with the other tables, a maximum table size in combination with shifted
538+
// indices allows omitting bounds checks.
537539
constexpr size_t kCodePointerTableReservationSize = 1 * GB;
538540

539-
// The maximum number of entries in an external pointer table.
541+
// Code pointer handles are shifted by a different amount than indirect pointer
542+
// handles as the tables have a different maximum size.
543+
constexpr uint32_t kCodePointerHandleShift = 6;
544+
545+
// A null handle always references an entry that contains nullptr.
546+
constexpr CodePointerHandle kNullCodePointerHandle = 0;
547+
548+
// The maximum number of entries in a code pointer table.
540549
constexpr int kCodePointerTableEntrySize = 16;
541550
constexpr int kCodePointerTableEntrySizeLog2 = 4;
542551
constexpr size_t kMaxCodePointers =
543552
kCodePointerTableReservationSize / kCodePointerTableEntrySize;
544553
static_assert(
545-
(1 << (32 - kIndirectPointerHandleShift)) == kMaxCodePointers,
554+
(1 << (32 - kCodePointerHandleShift)) == kMaxCodePointers,
546555
"kCodePointerTableReservationSize and kCodePointerHandleShift don't match");
547556

548557
constexpr int kCodePointerTableEntryEntrypointOffset = 0;
@@ -602,9 +611,11 @@ class Internals {
602611
static const int kHandleScopeDataSize =
603612
2 * kApiSystemPointerSize + 2 * kApiInt32Size;
604613

605-
// ExternalPointerTable layout guarantees.
614+
// ExternalPointerTable and IndirectPointerTable layout guarantees.
606615
static const int kExternalPointerTableBasePointerOffset = 0;
607616
static const int kExternalPointerTableSize = 2 * kApiSystemPointerSize;
617+
static const int kIndirectPointerTableSize = 2 * kApiSystemPointerSize;
618+
static const int kIndirectPointerTableBasePointerOffset = 0;
608619

609620
// IsolateData layout guarantees.
610621
static const int kIsolateCageBaseOffset = 0;
@@ -639,8 +650,10 @@ class Internals {
639650
kIsolateEmbedderDataOffset + kNumIsolateDataSlots * kApiSystemPointerSize;
640651
static const int kIsolateSharedExternalPointerTableAddressOffset =
641652
kIsolateExternalPointerTableOffset + kExternalPointerTableSize;
642-
static const int kIsolateApiCallbackThunkArgumentOffset =
653+
static const int kIsolateIndirectPointerTableOffset =
643654
kIsolateSharedExternalPointerTableAddressOffset + kApiSystemPointerSize;
655+
static const int kIsolateApiCallbackThunkArgumentOffset =
656+
kIsolateIndirectPointerTableOffset + kIndirectPointerTableSize;
644657
#else
645658
static const int kIsolateApiCallbackThunkArgumentOffset =
646659
kIsolateEmbedderDataOffset + kNumIsolateDataSlots * kApiSystemPointerSize;
@@ -763,6 +776,15 @@ class Internals {
763776
return ReadRawField<uint16_t>(map, kMapInstanceTypeOffset);
764777
}
765778

779+
V8_INLINE static Address LoadMap(Address obj) {
780+
if (!HasHeapObjectTag(obj)) return kNullAddress;
781+
Address map = ReadTaggedPointerField(obj, kHeapObjectMapOffset);
782+
#ifdef V8_MAP_PACKING
783+
map = UnpackMapWord(map);
784+
#endif
785+
return map;
786+
}
787+
766788
V8_INLINE static int GetOddballKind(Address obj) {
767789
return SmiValue(ReadTaggedSignedField(obj, kOddballKindOffset));
768790
}

0 commit comments

Comments
 (0)