@@ -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,58 +91,63 @@ export class Processor extends LogReader {
8891 processor : this . processV8Version ,
8992 } ,
9093 'shared-library' : {
91- parsers : [ parseString , parseInt , parseInt , parseInt ] ,
94+ parsers : [
95+ parseString , this . parseAddress , this . parseAddress , this . parseAddress
96+ ] ,
9297 processor : this . processSharedLibrary . bind ( this ) ,
9398 isAsync : true ,
9499 } ,
95100 'code-creation' : {
96101 parsers : [
97- parseString , parseInt , parseInt , parseInt , parseInt , parseString ,
98- parseVarArgs
102+ parseString , parseInt , parseInt , this . parseAddress , this . parseAddress ,
103+ parseString , parseVarArgs
99104 ] ,
100105 processor : this . processCodeCreation
101106 } ,
102107 'code-deopt' : {
103108 parsers : [
104- parseInt , parseInt , parseInt , parseInt , parseInt , parseString ,
105- parseString , parseString
109+ parseInt , parseInt , this . parseAddress , parseInt , parseInt ,
110+ parseString , parseString , parseString
106111 ] ,
107112 processor : this . processCodeDeopt
108113 } ,
109- 'code-move' :
110- { parsers : [ parseInt , parseInt ] , processor : this . processCodeMove } ,
111- 'code-delete' : { parsers : [ parseInt ] , processor : this . processCodeDelete } ,
114+ 'code-move' : {
115+ parsers : [ this . parseAddress , this . parseAddress ] ,
116+ processor : this . processCodeMove
117+ } ,
118+ 'code-delete' :
119+ { parsers : [ this . parseAddress ] , processor : this . processCodeDelete } ,
112120 'code-source-info' : {
113121 parsers : [
114- parseInt , parseInt , parseInt , parseInt , parseString , parseString ,
115- parseString
122+ this . parseAddress , parseInt , parseInt , parseInt , parseString ,
123+ parseString , parseString
116124 ] ,
117125 processor : this . processCodeSourceInfo
118126 } ,
119127 'code-disassemble' : {
120- parsers : [
121- parseInt ,
122- parseString ,
123- parseString ,
124- ] ,
128+ parsers : [ this . parseAddress , parseString , parseString ] ,
125129 processor : this . processCodeDisassemble
126130 } ,
127131 'feedback-vector' : {
128132 parsers : [
129- parseInt , parseString , parseInt , parseInt , parseString , parseString ,
130- parseInt , parseInt , parseString
133+ parseInt , parseString , parseInt , this . parseAddress , parseString ,
134+ parseString , parseInt , parseInt , parseString
131135 ] ,
132136 processor : this . processFeedbackVector
133137 } ,
134138 'script-source' : {
135139 parsers : [ parseInt , parseString , parseString ] ,
136140 processor : this . processScriptSource
137141 } ,
138- 'sfi-move' :
139- { parsers : [ parseInt , parseInt ] , processor : this . processFunctionMove } ,
142+ 'sfi-move' : {
143+ parsers : [ this . parseAddress , this . parseAddress ] ,
144+ processor : this . processFunctionMove
145+ } ,
140146 'tick' : {
141- parsers :
142- [ parseInt , parseInt , parseInt , parseInt , parseInt , parseVarArgs ] ,
147+ parsers : [
148+ this . parseAddress , parseInt , parseInt , this . parseAddress , parseInt ,
149+ parseVarArgs
150+ ] ,
143151 processor : this . processTick
144152 } ,
145153 'active-runtime-timer' : undefined ,
@@ -157,8 +165,8 @@ export class Processor extends LogReader {
157165 { parsers : [ parseInt , parseString ] , processor : this . processMapCreate } ,
158166 'map' : {
159167 parsers : [
160- parseString , parseInt , parseString , parseString , parseInt , parseInt ,
161- parseInt , parseString , parseString
168+ parseString , parseInt , parseString , parseString , this . parseAddress ,
169+ parseInt , parseInt , parseString , parseString
162170 ] ,
163171 processor : this . processMap
164172 } ,
@@ -352,7 +360,7 @@ export class Processor extends LogReader {
352360 let profilerEntry ;
353361 let stateName = '' ;
354362 if ( maybe_func . length ) {
355- const funcAddr = parseInt ( maybe_func [ 0 ] ) ;
363+ const funcAddr = this . parseAddress ( maybe_func [ 0 ] ) ;
356364 stateName = maybe_func [ 1 ] ?? '' ;
357365 const state = Profile . parseState ( maybe_func [ 1 ] ) ;
358366 profilerEntry = this . _profile . addFuncCode (
@@ -404,7 +412,7 @@ export class Processor extends LogReader {
404412 optimization_tier , invocation_count , profiler_ticks , fbv_string ) {
405413 const profCodeEntry = this . _profile . findEntry ( instructionStart ) ;
406414 if ( ! profCodeEntry ) {
407- console . warn ( 'Didn\'t find code for FBV' , { fbv , instructionStart} ) ;
415+ console . warn ( 'Didn\'t find code for FBV' , { fbv_string , instructionStart} ) ;
408416 return ;
409417 }
410418 const fbv = new FeedbackVectorEntry (
@@ -439,13 +447,13 @@ export class Processor extends LogReader {
439447 // that a callback calls itself. Instead we use tos_or_external_callback,
440448 // as simply resetting PC will produce unaccounted ticks.
441449 pc = tos_or_external_callback ;
442- tos_or_external_callback = 0 ;
450+ tos_or_external_callback = this . kZero ;
443451 } else if ( tos_or_external_callback ) {
444452 // Find out, if top of stack was pointing inside a JS function
445453 // meaning that we have encountered a frameless invocation.
446454 const funcEntry = this . _profile . findEntry ( tos_or_external_callback ) ;
447455 if ( ! funcEntry ?. isJSFunction ?. ( ) ) {
448- tos_or_external_callback = 0 ;
456+ tos_or_external_callback = this . kZero ;
449457 }
450458 }
451459 const entryStack = this . _profile . recordTick (
0 commit comments