(Resend. My previous mail didn't go through.)

Hi there,

(2014/03/30 20:50), Guan Zhi wrote:
> There are  a lot of js files located in the v8 src folder, but I could
> not find where they are used in the source code. Any one know how does
> v8 engine use those js files?

If you grep (or codesearch, which I prefer) 'array.js' and such. You'll
see that it's listed in 'tools/gyp/v8.gyp' and the relevant dependency
file ('out/x64.debug/.deps/$V8/out/x64.debug/obj/gen/libraries.cc.d') having

  cmd_/$V8/x64.debug/obj/gen/libraries.cc :=
LD_LIBRARY_PATH=/$V8/out/x64.debug/lib.host:/$V8/out/x64.debug/lib.target:$$LD_LIBRARY_PATH;
export LD_LIBRARY_PATH; cd ../tools/gyp; mkdir -p
/V8/out/x64.debug/obj/gen; python ../../tools/js2c.py
"/$V8/out/x64.debug/obj/gen/libraries.cc" CORE off ../../src/runtime.js
../../src/v8natives.js ../../src/array.js ../../src/string.js
../../src/uri.js ../../src/math.js ../../src/messages.js
../../src/apinatives.js ../../src/debug-debugger.js
../../src/mirror-debugger.js ../../src/liveedit-debugger.js
../../src/date.js ../../src/json.js ../../src/regexp.js
../../src/arraybuffer.js ../../src/typedarray.js
../../src/object-observe.js ../../src/macros.py ../../src/i18n.js

and that's how 'libraries.cc' is generated. 'libraries.cc' is in turn
used to create 'libv8_nosnapshot.a' and 'libv8_snapshot.a'. It's used in
'Genesis::InstallNatives' → 'Genesis::CompileNative' (this is named such
but it *includes executing the code*) from 'src/bootstrapper.cc'.

If you have doubts, you can check 'out/x64.debug/obj/gen/libraries.cc'
(and make sure you open 'src/natives.h' for the defintion of 'Natives')
but it's a pseudo-binary so browsing it might be troublesome.


'experimental-libraries.cc' is similar but I'll just ignore the details.


Cheers,
Kenny

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to