Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executing the 'deopt' related script will output a large amount of useless logs in macos platform #3

Open
champkeh opened this issue Nov 25, 2023 · 1 comment

Comments

@champkeh
Copy link

I clone the project and install dependencies, then run this command:

pnpm run deopt

the console keeps outputting a lot of logs

> [email protected] deopt /Users/champ/Repos/github/mhevery/JavaScriptVM_under_the_hood
> pnpm build && pnpm dexnode --out ./profile/deopt.log --redirect-code-traces-to=./profile/deopt.ignore ./dist/deopt.js


> [email protected] build /Users/champ/Repos/github/mhevery/JavaScriptVM_under_the_hood
> tsc

> node --log-deopt --redirect-code-traces --redirect-code-traces-to=/var/folders/dc/lvyrwpp97cdcvjdnzfqlbs_m0000gn/T/dexnode-FFLQ2v/code.asm --log-ic --log-maps --log-maps-details --log-code --log-source-code --prof --log-internal-timer-events --detailed-line-info --logfile=/Users/champ/Repos/github/mhevery/JavaScriptVM_under_the_hood/profile/deopt.log --no-logfile-per-isolate --redirect-code-traces-to=./profile/deopt.ignore ./dist/deopt.js
shared-library,/Users/champ/.n/bin/node,0x1047b5000,0x105a97928,75186176
shared-library,/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation,0x18331aff0,0x1835090f4,48742400
shared-library,/usr/lib/libobjc.A.dylib,0x182ee5c00,0x182f22724,48742400
shared-library,/System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal,0x1869711bc,0x1869a8bc0,48742400
shared-library,/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation,0x18444a370,0x184ceb310,48742400
shared-library,/usr/lib/liboah.dylib,0x18fb2b618,0x18fb30cb0,48742400
shared-library,/usr/lib/libfakelink.dylib,0x18fb5f468,0x18fb60b80,48742400
shared-library,/usr/lib/libicucore.A.dylib,0x1863a7a8c,0x1865f53e0,48742400
shared-library,/usr/lib/libSystem.B.dylib,0x18fb5c4d4,0x18fb5caec,48742400
shared-library,/System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData,0x18e48e340,0x18e491b10,48742400
shared-library,/System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon,0x183f7b794,0x18403f910,48742400
shared-library,/System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement,0x18f051b64,0x18f06c020,48742400
shared-library,/usr/lib/libTLE.dylib,0x222ef9448,0x222f006e8,48742400
shared-library-end
tick,0x1832787d0,6792,0,0x0,6
profiler,begin,1000
tick,0x1053ea104,8042,0,0x0,6
new,CodeRange,0x109a9c000,0
new,MemoryChunk,0x2204c6940000,262144
new,MemoryChunk,0x2c26b180000,262144
new,MemoryChunk,0x30605a00000,262144
new,MemoryChunk,0x8dee5100000,262144
new,MemoryChunk,0x2a0800880000,262144
heap-capacity,1030944
heap-available,4346312256
new,MemoryChunk,0x313fe9100000,262144
tick,0x1049f24f4,9333,0,0x0,6
new,MemoryChunk,0x1da23f000000,262144
new,MemoryChunk,0x15bf6c340000,262144
new,MemoryChunk,0x171671bc0000,262144
new,MemoryChunk,0x1113a7f00000,262144
new,MemoryChunk,0x6c58b440000,262144
new,MemoryChunk,0x18139ac40000,262144
new,MemoryChunk,0xe6e4c140000,262144
new,MemoryChunk,0x466632c0000,262144
new,MemoryChunk,0x109ac0000,262144
new,MemoryChunk,0x3af8a4f40000,262144
tick,0x104ee5c20,10583,0,0x0,6
map-create,10625,0x2204c6941139
map-details,10625,0x2204c6941139,0x2204c6941139: [Map] in ReadOnlySpace\n - type: MAP_TYPE\n - instance size: 72\n - elements kind: HOLEY_ELEMENTS\n - unused property fields: 0\n - enum length: invalid\n - stable_map\n - non-extensible\n - back pointer: 0x2204c69415c1 <undefined>\n - prototype_validity cell: 0\n - instance descriptors (own) #0: 0x2204c6941271 <Other heap object (STRONG_DESCRIPTOR_ARRAY_TYPE)>\n - prototype: 0x2204c6941341 <null>\n - constructor: 0x2204c6941341 <null>\n - dependent code: 0x2204c6941259 <Other heap object (WEAK_ARRAY_LIST_TYPE)>\n - construction counter: 0\n\n
map-create,10958,0x2204c6941181
map-details,17583,0x2204c6941181,0x2204c6941181: [Map] in ReadOnlySpace\n - type: ODDBALL_TYPE\n - instance size: 48\n - elements kind: HOLEY_ELEMENTS\n - unused property fields: 0\n - enum length: invalid\n - stable_map\n - undetectable\n - non-extensible\n - back pointer: 0x2204c69415c1 <undefined>\n - prototype_validity cell: 0\n - instance descriptors (own) #0: 0x2204c6941271 <Other heap object (STRONG_DESCRIPTOR_ARRAY_TYPE)>\n - prototype: 0x2204c6941341 <null>\n - constructor: 0x2204c6941341 <null>\n - dependent code: 0x2204c6941259 <Other heap object (WEAK_ARRAY_LIST_TYPE)>\n - construction counter: 0\n\n
map-create,17917,0x2204c69411c9
map-details,17917,0x2204c69411c9,0x2204c69411c9: [Map] in ReadOnlySpace\n - type: STRONG_DESCRIPTOR_ARRAY_TYPE\n - instance size: variable\n - elements kind: HOLEY_ELEMENTS\n - unused property fields: 0\n - enum length: invalid\n - stable_map\n - back pointer: 0x2204c69415c1 <undefined>\n - prototype_validity cell: 0\n - instance descriptors (own) #0: 0x2204c6941271 <Other heap object (STRONG_DESCRIPTOR_ARRAY_TYPE)>\n - prototype: 0x2204c6941341 <null>\n - constructor: 0x2204c6941341 <null>\n - dependent code: 0x2204c6941259 <Other heap object (WEAK_ARRAY_LIST_TYPE)>\n - construction counter: 0\n\n
map-create,18292,0x2204c6941211
map-details,18333,0x2204c6941211,0x2204c6941211: [Map] in ReadOnlySpace\n - type: WEAK_ARRAY_LIST_TYPE\n - instance size: variable\n - elements kind: HOLEY_ELEMENTS\n - unused property fields: 0\n - enum length: invalid\n - stable_map\n - non-extensible\n - back pointer: 0x2204c69415c1 <undefined>\n - prototype_validity cell: 0\n - instance descriptors (own) #0: 0x2204c6941271 <Other heap object (STRONG_DESCRIPTOR_ARRAY_TYPE)>\n - prototype: 0x2204c6941341 <null>\n - constructor: 0x2204c6941341 <null>\n - dependent code: 0x2204c6941259 <Other heap object (WEAK_ARRAY_LIST_TYPE)>\n - construction counter: 0\n\n
map-create,18708,0x2204c6941289
map-details,18708,0x2204c6941289,0x2204c6941289: [Map] in ReadOnlySpace\n - type: ENUM_CACHE_TYPE\n - instance size: 24\n - elements kind: HOLEY_ELEMENTS\n - unused property fields: 0\n - enum length: invalid\n - stable_map\n - non-extensible\n - back pointer: 0x2204c69415c1 <undefined>\n - prototype_validity cell: 0\n - instance descriptors (own) #0: 0x2204c6941271 <Other heap object (STRONG_DESCRIPTOR_ARRAY_TYPE)>\n - prototype: 0x2204c6941341 <null>\n - constructor: 0x2204c6941341 <null>\n - dependent code: 0x2204c6941259 <Other heap object (WEAK_ARRAY_LIST_TYPE)>\n - construction counter: 0\n\n
map-create,19042,0x2204c69412e9
map-details,19083,0x2204c69412e9,0x2204c69412e9: [Map] in ReadOnlySpace\n - type: FIXED_ARRAY_TYPE\n - instance size: variable\n - elements kind: HOLEY_ELEMENTS\n - unused property fields: 0\n - enum length: invalid\n - stable_map\n - non-extensible\n - back pointer: 0x2204c69415c1 <undefined>\n - prototype_validity cell: 0\n - instance descriptors (own) #0: 0x2204c6941271 <Other heap object (STRONG_DESCRIPTOR_ARRAY_TYPE)>\n - prototype: 0x2204c6941341 <null>\n - constructor: 0x2204c6941341 <null>\n - dependent code: 0x2204c6941259 <Other heap object (WEAK_ARRAY_LIST_TYPE)>\n - construction counter: 0\n\n
map-create,19417,0x2204c6941371
map-details,19458,0x2204c6941371,0x2204c6941371: [Map] in ReadOnlySpace\n - type: ONE_BYTE_INTERNALIZED_STRING_TYPE\n - instance size: variable\n - elements kind: HOLEY_ELEMENTS\n - unused property fields: 0\n - enum length: invalid\n - stable_map\n - back pointer: 0x2204c69415c1 <undefined>\n - prototype_validity cell: 0\n - instance descriptors (own) #0: 0x2204c6941271 <Other heap object (STRONG_DESCRIPTOR_ARRAY_TYPE)>\n - prototype: 0x2204c6941341 <null>\n - constructor: 0x2204c6941341 <null>\n - dependent code: 0x2204c6941259 <Other heap object (WEAK_ARRAY_LIST_TYPE)>\n - construction counter: 0\n\n
map-create,19750,0x2204c69413e9
map-details,19750,0x2204c69413e9,0x2204c69413e9: [Map] in ReadOnlySpace\n - type: FREE_SPACE_TYPE\n - instance size: variable\n - elements kind: HOLEY_ELEMENTS\n - unused property fields: 0\n - enum length: invalid\n - stable_map\n - back pointer: 0x2204c69415c1 <undefined>\n - prototype_validity cell: 0\n - instance descriptors (own) #0: 0x2204c6941271 <Other heap object (STRONG_DESCRIPTOR_ARRAY_TYPE)>\n - prototype: 0x2204c6941341 <null>\n - constructor: 0x2204c6941341 <null>\n - dependent code: 0x2204c6941259 <Other heap object (WEAK_ARRAY_LIST_TYPE)>\n - construction counter: 0\n\n
map-create,20083,0x2204c6941431
map-details,20083,0x2204c6941431,0x2204c6941431: [Map] in ReadOnlySpace\n - type: FILLER_TYPE\n - instance size: 8\n - elements kind: HOLEY_ELEMENTS\n - unused property fields: 0\n - enum length: invalid\n - stable_map\n - back pointer: 0x2204c69415c1 <undefined>\n - prototype_validity cell: 0\n - instance descriptors (own) #0: 0x2204c6941271 <Other heap object (STRONG_DESCRIPTOR_ARRAY_TYPE)>\n - prototype: 0x2204c6941341 <null>\n

After I manually created a profile directory in the root project directory, then re-execute the above command, it works

pnpm run deopt
> [email protected] deopt /Users/champ/Repos/github/mhevery/JavaScriptVM_under_the_hood
> pnpm build && pnpm dexnode --out ./profile/deopt.log --redirect-code-traces-to=./profile/deopt.ignore ./dist/deopt.js


> [email protected] build /Users/champ/Repos/github/mhevery/JavaScriptVM_under_the_hood
> tsc

> node --log-deopt --redirect-code-traces --redirect-code-traces-to=/var/folders/dc/lvyrwpp97cdcvjdnzfqlbs_m0000gn/T/dexnode-PEz5Nx/code.asm --log-ic --log-maps --log-maps-details --log-code --log-source-code --prof --log-internal-timer-events --detailed-line-info --logfile=/Users/champ/Repos/github/mhevery/JavaScriptVM_under_the_hood/profile/deopt.log --no-logfile-per-isolate --redirect-code-traces-to=./profile/deopt.ignore ./dist/deopt.js
Running 10 iterations.
Starting: A ...
          A 3479.195 us
Starting: B ...
          B 3204.203 us
Starting: C ...
          C 3249.991 us
Starting: D ...
          D 19083.297 us

I don't known why.

pnpm version
{
  JavaScriptVM_under_the_hood: '0.0.1',
  npm: '8.9.0',
  node: '18.2.0',
  v8: '10.1.124.8-node.13',
  uv: '1.43.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '108',
  nghttp2: '1.47.0',
  napi: '8',
  llhttp: '6.0.6',
  openssl: '3.0.3+quic',
  cldr: '41.0',
  icu: '71.1',
  tz: '2022a',
  unicode: '14.0',
  ngtcp2: '0.1.0-DEV',
  nghttp3: '0.1.0-DEV'
}

MacOS: 14.2 Beta (23C5047e)

@H7mei
Copy link

H7mei commented Nov 25, 2023

Thanks, I had a similar problem where a significant number of logs were generated. After creating a directory in the profile folder in the root directory, the issue was resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants