Haiyang-Sun / nodeprof.js

Instrumentation framework for Node.js compliant to ECMAScript 2020 based on GraalVM.
Apache License 2.0
53 stars 22 forks source link

Enter-exit analysis #16

Closed LucaFranceschini closed 5 years ago

LucaFranceschini commented 5 years ago

When I instrument an empty JavaScript file (for instance with this sample analysis) there are still two function invocations observed, what are they? Names are not helpful (empty string).

P.S.: in the sample enter-exit analysis all the callbacks use arguments.length, though this is weird since in JavaScript arguments is an object local to each function, thus using it in Jalangi callbacks should give the number of arguments received by the callback and not by the instrumented function.

Haiyang-Sun commented 5 years ago
  1. every JavaScript file will be wrapped into a special function to be loaded by the engine, and the observed function calls are for this case. You can simply ignore them from your analysis. You might also use them to detect loading a JavaScript file.

  2. the arguments usage here is to verify the number of arguments passed to the analysis callback. If a function exits without an exception, we will still pass an undefined object to the callback, so the analysis is used to show that the number of arguments passed to functionExit is always 3 regardless of whether function exits with an exception or not.

LucaFranceschini commented 5 years ago

I see, thanks for the information!

Haiyang-Sun commented 5 years ago

I have found another issue related somehow with this one, see #17