@@ -47,7 +47,6 @@ class AsyncConsumer {
4747}
4848
4949export class Processor extends LogReader {
50- _profile = new Profile ( ) ;
5150 _codeTimeline = new Timeline ( ) ;
5251 _deoptTimeline = new Timeline ( ) ;
5352 _icTimeline = new Timeline ( ) ;
@@ -70,12 +69,16 @@ export class Processor extends LogReader {
7069
7170 MAJOR_VERSION = 7 ;
7271 MINOR_VERSION = 6 ;
73- constructor ( ) {
74- super ( ) ;
72+ constructor ( useBigInt = false ) {
73+ super ( false , false , useBigInt ) ;
74+ this . useBigInt = useBigInt ;
75+ this . kZero = useBigInt ? 0n : 0 ;
76+ this . parseAddress = useBigInt ? BigInt : parseInt ;
7577 this . _chunkConsumer =
7678 new AsyncConsumer ( ( chunk ) => this . _processChunk ( chunk ) ) ;
79+ this . _profile = new Profile ( useBigInt ) ;
7780 const propertyICParser = [
78- parseInt , parseInt , parseInt , parseInt , parseString , parseString ,
81+ this . parseAddress , parseInt , parseInt , parseInt , parseString , parseString ,
7982 parseString , parseString , parseString , parseString
8083 ] ;
8184 this . setDispatchTable ( {
@@ -88,14 +91,14 @@ export class Processor extends LogReader {
8891 processor : this . processV8Version ,
8992 } ,
9093 'shared-library' : {
91- parsers : [ parseString , parseInt , parseInt , parseInt ] ,
94+ parsers : [ parseString , this . parseAddress , this . parseAddress , parseInt ] ,
9295 processor : this . processSharedLibrary . bind ( this ) ,
9396 isAsync : true ,
9497 } ,
9598 'code-creation' : {
9699 parsers : [
97- parseString , parseInt , parseInt , parseInt , parseInt , parseString ,
98- parseVarArgs
100+ parseString , parseInt , parseInt , this . parseAddress , this . parseAddress ,
101+ parseString , parseVarArgs
99102 ] ,
100103 processor : this . processCodeCreation
101104 } ,
@@ -111,17 +114,13 @@ export class Processor extends LogReader {
111114 'code-delete' : { parsers : [ parseInt ] , processor : this . processCodeDelete } ,
112115 'code-source-info' : {
113116 parsers : [
114- parseInt , parseInt , parseInt , parseInt , parseString , parseString ,
115- parseString
117+ this . parseAddress , parseInt , parseInt , parseInt , parseString ,
118+ parseString , parseString
116119 ] ,
117120 processor : this . processCodeSourceInfo
118121 } ,
119122 'code-disassemble' : {
120- parsers : [
121- parseInt ,
122- parseString ,
123- parseString ,
124- ] ,
123+ parsers : [ this . parseAddress , parseString , parseString ] ,
125124 processor : this . processCodeDisassemble
126125 } ,
127126 'feedback-vector' : {
@@ -138,8 +137,10 @@ export class Processor extends LogReader {
138137 'sfi-move' :
139138 { parsers : [ parseInt , parseInt ] , processor : this . processFunctionMove } ,
140139 'tick' : {
141- parsers :
142- [ parseInt , parseInt , parseInt , parseInt , parseInt , parseVarArgs ] ,
140+ parsers : [
141+ this . parseAddress , parseInt , parseInt , this . parseAddress , parseInt ,
142+ parseVarArgs
143+ ] ,
143144 processor : this . processTick
144145 } ,
145146 'active-runtime-timer' : undefined ,
@@ -157,8 +158,8 @@ export class Processor extends LogReader {
157158 { parsers : [ parseInt , parseString ] , processor : this . processMapCreate } ,
158159 'map' : {
159160 parsers : [
160- parseString , parseInt , parseString , parseString , parseInt , parseInt ,
161- parseInt , parseString , parseString
161+ parseString , parseInt , parseString , parseString , this . parseAddress ,
162+ parseInt , parseInt , parseString , parseString
162163 ] ,
163164 processor : this . processMap
164165 } ,
@@ -310,11 +311,9 @@ export class Processor extends LogReader {
310311 // Many events rely on having a script around, creating fake entries for
311312 // shared libraries.
312313 this . _profile . addScriptSource ( - 1 , name , '' ) ;
313-
314314 if ( this . _cppEntriesProvider == undefined ) {
315315 await this . _setupCppEntriesProvider ( ) ;
316316 }
317-
318317 await this . _cppEntriesProvider . parseVmSymbols (
319318 name , startAddr , endAddr , aslrSlide , ( fName , fStart , fEnd ) => {
320319 const entry = this . _profile . addStaticCode ( fName , fStart , fEnd ) ;
@@ -352,7 +351,7 @@ export class Processor extends LogReader {
352351 let profilerEntry ;
353352 let stateName = '' ;
354353 if ( maybe_func . length ) {
355- const funcAddr = parseInt ( maybe_func [ 0 ] ) ;
354+ const funcAddr = this . parseAddress ( maybe_func [ 0 ] ) ;
356355 stateName = maybe_func [ 1 ] ?? '' ;
357356 const state = Profile . parseState ( maybe_func [ 1 ] ) ;
358357 profilerEntry = this . _profile . addFuncCode (
@@ -439,13 +438,13 @@ export class Processor extends LogReader {
439438 // that a callback calls itself. Instead we use tos_or_external_callback,
440439 // as simply resetting PC will produce unaccounted ticks.
441440 pc = tos_or_external_callback ;
442- tos_or_external_callback = 0 ;
441+ tos_or_external_callback = this . kZero ;
443442 } else if ( tos_or_external_callback ) {
444443 // Find out, if top of stack was pointing inside a JS function
445444 // meaning that we have encountered a frameless invocation.
446445 const funcEntry = this . _profile . findEntry ( tos_or_external_callback ) ;
447446 if ( ! funcEntry ?. isJSFunction ?. ( ) ) {
448- tos_or_external_callback = 0 ;
447+ tos_or_external_callback = this . kZero ;
449448 }
450449 }
451450 const entryStack = this . _profile . recordTick (
0 commit comments