V8 does not have a byte code.  If it needs to compile something it
uses the source.  There is no support for compiling everything ahead
of time and throwing away the source.  The code snippets produced by
the print-code option cannot be made into .obj files.  This would
require extensive support from the runtime system.

There are lots of obfuscators for JavaScript.  I think those are your
only real option.

16. dec. 2010 15.21 skrev Adam Strzelecki <[email protected]>:
> Hello,
>
> Since V8 can generate binary native machine code for both x86 & ppc it
> could be a perfect ECMA compatible scripting language for games/game
> engines. So normally you could prototype your app (game) using JIT,
> and what would be desired is to be able to produce binary OBJ or
> assembler source that could be linked together with the whole
> application for release build. So nobody sees your app (game) source
> JS code inside release build.
>
> I know JS uses eval() a lot in many cases, but I don't care if eval()
> wouldn't be available at binary linked code. Most important thing I
> want to achieve is that release builds of the app (game?) do not
> compile anything anymore with JIT, but just relay on the code
> contained by the executable, where one part of the code comes from C/C+
> + compiler and contains some app (game) engine, rest comes from JS V8
> compiler and contains logic. Obviously we link also to V8 library
> which contains internal ECMA/JSscript routines.
>
> Also I would love that V8 is easily hookable to existing C++ classes
> (game engine classes).
>
> So first of all, is it possible? I know debug build of V8 can output
> some machine code log, but is it possible to turn this code easily
> into valid assembler source or OBJ? The perfect situation would be if
> each file.js has generates file.obj containing C function symbol
> "_file" or "_v8_file" that is visible by the rest of application
> during linking phrase, and returning V8 JS type. Also would be great
> if there was some extension for other files inclusion in v8 (or maybe
> there is one already?) that will also join all the JS code from
> several files into single (or several) OBJs.
>
> If this was be feasible I think V8 would be great replacement for Lua
> and .NET/Mono/MonoTouch used by many game engines.
>
> Best regards,
> --
> Adam Strzelecki | nanoant.com
>
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
>



-- 
Erik Corry, Software Engineer
Google Denmark ApS - Frederiksborggade 20B, 1 sal,
1360 København K - Denmark - CVR nr. 28 86 69 84

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to