@@ -352,6 +352,7 @@ type v8Data struct {
352
352
WeakFixedArray uint16 `name:"WeakFixedArray__WEAK_FIXED_ARRAY_TYPE"`
353
353
TrustedByteArray uint16 `name:"TrustedByteArray__TRUSTED_BYTE_ARRAY_TYPE" zero:""`
354
354
TrustedFixedArray uint16 `name:"TrustedFixedArray__TRUSTED_FIXED_ARRAY_TYPE" zero:""`
355
+ TrustedWeakFixedArray uint16 `name:"TrustedFixedArray__TRUSTED_WEAK_FIXED_ARRAY_TYPE" zero:""`
355
356
ProtectedFixedArray uint16 `name:"ProtectedFixedArray__PROTECTED_FIXED_ARRAY_TYPE" zero:""`
356
357
JSFunction uint16 `name:"JSFunction__JS_FUNCTION_TYPE"`
357
358
Map uint16 `name:"Map__MAP_TYPE"`
@@ -468,7 +469,8 @@ type v8Data struct {
468
469
// class DeoptimizationLiteralArray introduced in V8 9.8.23
469
470
// https://chromium.googlesource.com/v8/v8.git/+/refs/tags/10.2.154.1/src/objects/code.h#1090
470
471
DeoptimizationLiteralArray struct {
471
- WeakFixedArray bool
472
+ WeakFixedArray bool
473
+ TrustedWeakFixedArray bool
472
474
}
473
475
474
476
// https://chromium.googlesource.com/v8/v8.git/+/refs/tags/9.2.230.1/src/objects/script.tq#18
@@ -1292,7 +1294,9 @@ func (i *v8Instance) readCode(taggedPtr libpf.Address, cookie uint32, sfi *v8SFI
1292
1294
// The first numSFI entries of literal array are the pointers for
1293
1295
// inlined function's SFI structures
1294
1296
expectedTag := vms .Type .FixedArray
1295
- if vms .DeoptimizationLiteralArray .WeakFixedArray {
1297
+ if vms .DeoptimizationLiteralArray .TrustedWeakFixedArray {
1298
+ expectedTag = vms .Type .TrustedWeakFixedArray
1299
+ } else if vms .DeoptimizationLiteralArray .WeakFixedArray {
1296
1300
expectedTag = vms .Type .WeakFixedArray
1297
1301
}
1298
1302
literalArrayPtr := npsr .Ptr (deoptimizationData ,
@@ -2101,6 +2105,14 @@ func (d *v8Data) readIntrospectionData(ef *pfelf.File, syms libpf.SymbolFinder)
2101
2105
// so we can probably get away with just hardcoding it for now.
2102
2106
vms .SharedFunctionInfo .FunctionData = 8
2103
2107
}
2108
+ if d .version >= v8Ver (12 , 5 , 0 ) {
2109
+ // This changed in f6c936e836b4d8ffafe790bcc3586f2ba5ffcf74
2110
+ vms .DeoptimizationLiteralArray .TrustedWeakFixedArray = true
2111
+ } else if d .version >= v8Ver (11 , 9 , 0 ) {
2112
+ // This had been WeakFixedArray for a very long time,
2113
+ // but we lost the metadata in 0698c376801dcde939850b7ad0b55c7459c83f4d.
2114
+ vms .DeoptimizationLiteralArray .WeakFixedArray = true
2115
+ }
2104
2116
2105
2117
for i := 0 ; i < vmVal .NumField (); i ++ {
2106
2118
classVal := vmVal .Field (i )
0 commit comments