[v8-users] Re: Making v8::Persistent safe to use

2013-09-17 Thread Dan Carney
On Tuesday, September 17, 2013 12:18:36 AM UTC+2, ioannis wrote:

 So with the resent changes to Persistent how can we store a series of 
 PersistentFunction handles to an STL container like map ?


You definitely want some kind of wrapper, depending on usage, and Jim's 
suggestion is an excellent example.

We're planning to add a UniquePersistent class which has semantics like 
unique_ptr to allow use in std collections.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[v8-users] Re: Making v8::Persistent safe to use

2013-09-17 Thread Dan Carney
The next round of changes to Persistent are in.  V8_USE_UNSAFE_HANDLES no 
longer exists.  Persistent now has a second template parameter that 
controls copy and assignment behaviour.  The default parameters keep the 
behaviour unchanged.  To allow copying one could use such a class as the 
below 

templateclass T
struct CopyablePersistentTraits {
  typedef PersistentT, CopyablePersistentTraitsT  CopyablePersistent;
  static const bool kResetInDestructor = true;
  templateclass S, class M
  static void Copy(const PersistentS, M source, CopyablePersistent* 
dest) {}
};

the Copy function is called on both copy and assign, and the kResetInDestructor 
variable controls whether Reset is called in the destructor.

Setting kResetInDestructor = true is highly recommended, and we plan on 
changing the default traits class at some point to do this.

We will keep the default functionality of disallowing copying and 
assignment as is, as these are expensive operations.  An embedder should 
only perform them intentionally.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[v8-users] Re: New feature: handle eternalization

2013-09-17 Thread Dan Carney
Handle will go away eventually.  New apis will use Local.  Old apis that 
use Handle will migrate to Local.  If you have a Handle, you'll have to do 
LocalX(handle) where needed.

On Tuesday, September 17, 2013 1:07:30 AM UTC+2, ioannis wrote:

 Shouldn't the use of Handle and Local be interchangeable ?
 Has it been decided which of the two will be depreciated in the end ?

 It seems that we cannot assign a Handle value to the Eternal and we need 
 to use Local instead ...


-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [v8-users] How to use V8 as JavaScript parser?

2013-09-17 Thread Andreas Rossberg
On 14 September 2013 13:21, Ivan P. ivan.pizhe...@gmail.com wrote:
 Hello, Does anyone has experience with using V8 as standalone parser?
 Please share any links and/or code if possble.
 The idea is to get AST and traverse it.
 I need only traverse AST, not modify it.

This comes up frequently, but the answer remains the same: scrap the
idea. ;) Neither the V8 parser nor its AST are designed for external
interfacing. In particular (1) V8's AST does not necessarily reflect
JavaScript syntax 1-to-1, (2) we change it all the time, and (3) it
depends on various V8 internals. And since all these points are
important for V8, don't expect the situation to change.

/Andreas

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[v8-users] Builder v8 as a static library for Android

2013-09-17 Thread Diep Nguyen Hoang
Hi, currently I'm trying to build v8 as a static library on Android.

I have successfully finished build command, and 
have libv8_base.arm.a, libv8_nosnapshot.arm.a, libv8_snapshot.a already. 
But when I put them into my project and compile, these .a file seems to be 
directly linked to the .o files, which are result of v8 building. I also 
notice that, size of these .a files is too small (about 1MB), and contains 
no object file but the absolute path to object file (using $ cat).

What I want is static library must contains all object files, not map to 
them, so I can push them to repository, is this right? I used default build 
command (make android_arm.release, OS: Ubuntu 12 and OS X). Now because the 
.a files just contain the paths, not objects themself, my project build 
command is failed.

Please help,
Thanks,

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [v8-users] Builder v8 as a static library for Android

2013-09-17 Thread Ben Noordhuis
On Tue, Sep 17, 2013 at 11:50 AM, Diep Nguyen Hoang
viruslove1...@gmail.com wrote:
 Hi, currently I'm trying to build v8 as a static library on Android.

 I have successfully finished build command, and have libv8_base.arm.a,
 libv8_nosnapshot.arm.a, libv8_snapshot.a already. But when I put them into
 my project and compile, these .a file seems to be directly linked to the .o
 files, which are result of v8 building. I also notice that, size of these .a
 files is too small (about 1MB), and contains no object file but the absolute
 path to object file (using $ cat).

 What I want is static library must contains all object files, not map to
 them, so I can push them to repository, is this right? I used default build
 command (make android_arm.release, OS: Ubuntu 12 and OS X). Now because the
 .a files just contain the paths, not objects themself, my project build
 command is failed.

 Please help,
 Thanks,

GYP builds thin archives by default on platforms that support it (the
GNU toolchain on Linux does, don't think OS X does.)  You can disable
it by setting standalone_static_library: 1 in the *.gyp file that
builds the static library, e.g.:

  'targets': [{
'target_name': 'foo',
'type': 'static_library',
'standalone_static_library': 1,
'sources': [ ... ]
  }]

Good luck.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [v8-users] Re: python build/gyp_v8 -Dtarget_arch=x64 -Dcomponent=shared_library

2013-09-17 Thread Jim Acquavella
Getting closer.  Here are my windows errors:

d:\dev\animal\sandboxes\jacquave\v1\shared\third_party\projects\v8\v8c:\Program
 
Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.com /build 
Debug build\All.sln 

Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
1-- Build started: Project: preparser, Configuration: Debug x64 --
1Build started 9/17/2013 9:44:57 AM.
1InitializeBuildStatus:
1  Touching ..\build\Debug\obj\preparser\preparser.unsuccessfulbuild.
1ClCompile:
1  preparser-api.cc
1..\src\preparser-api.cc(174): error C2220: warning treated as error - no 
'object' file generated
1..\src\preparser-api.cc(174): warning C4273: 
'v8::UnicodeInputStream::~UnicodeInputStream' : inconsistent dll linkage
1 
 
d:\dev\animal\sandboxes\jacquave\v1\shared\third_party\projects\v8\v8\src\../include/v8-preparser.h(65)
 
: see previous definition of '{dtor}'
1..\src\preparser-api.cc(177): warning C4273: 'v8::Preparse' : 
inconsistent dll linkage
1 
 
d:\dev\animal\sandboxes\jacquave\v1\shared\third_party\projects\v8\v8\src\../include/v8-preparser.h(79)
 
: see previous definition of 'Preparse'
1
1Build FAILED.
1
1Time Elapsed 00:00:00.87
== Build: 0 succeeded, 1 failed, 13 up-to-date, 0 skipped ==

d:\dev\animal\sandboxes\jacquave\v1\shared\third_party\projects\v8\v8c:\Program
 
Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.com /build 
Release build\All.sln 

Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
1-- Build started: Project: preparser, Configuration: Release x64 
--
1Build started 9/17/2013 9:45:02 AM.
1InitializeBuildStatus:
1  Touching ..\build\Release\obj\preparser\preparser.unsuccessfulbuild.
1ClCompile:
1  preparser-api.cc
1..\src\preparser-api.cc(174): error C2220: warning treated as error - no 
'object' file generated
1..\src\preparser-api.cc(174): warning C4273: 
'v8::UnicodeInputStream::~UnicodeInputStream' : inconsistent dll linkage
1 
 
d:\dev\animal\sandboxes\jacquave\v1\shared\third_party\projects\v8\v8\src\../include/v8-preparser.h(65)
 
: see previous definition of '{dtor}'
1..\src\preparser-api.cc(177): warning C4273: 'v8::Preparse' : 
inconsistent dll linkage
1 
 
d:\dev\animal\sandboxes\jacquave\v1\shared\third_party\projects\v8\v8\src\../include/v8-preparser.h(79)
 
: see previous definition of 'Preparse'
1
1Build FAILED.
1
1Time Elapsed 00:00:00.89
== Build: 0 succeeded, 1 failed, 13 up-to-date, 0 skipped ==


There seems to be some confusion with the v8 export declaration regarding 
preparser.  Is it using v8, or building v8?  It's currently doing both!!

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[v8-users] msvcprtd.lib(MSVCP100D.dll) : error LNK2005: public: static __int64 __cdecl std::numeric_limits__int64::max(void) (?max@?$numeric_limits@_J@std@@SA_JXZ) already defined in v8_base.x64.l

2013-09-17 Thread Jim Acquavella

I'm no longer able to link with the static libraries on windows.  Anyone 
else running into this?  It worked last time I updated about a month ago...

1msvcprtd.lib(MSVCP100D.dll) : error LNK2005: public: static __int64 
__cdecl std::numeric_limits__int64::max(void) 
(?max@?$numeric_limits@_J@std@@SA_JXZ) already defined in 
v8_base.x64.lib(time.obj)
1 Creating library ..\..\lib\win\debug\64\Foo.lib and object 
..\..\lib\win\debug\64\Foo.exp
1LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other 
libs; use /NODEFAULTLIB:library
1..\..\lib\win\debug\64\Fooexe : fatal error LNK1169: one or more multiply 
defined symbols found

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[v8-users] Re: msvcprtd.lib(MSVCP100D.dll) : error LNK2005: public: static __int64 __cdecl std::numeric_limits__int64::max(void) (?max@?$numeric_limits@_J@std@@SA_JXZ) already defined in v8_base.x

2013-09-17 Thread Jim Acquavella
Seems related to icu?

https://bugzilla.mozilla.org/show_bug.cgi?id=899948

I'm not sure how this workaround applies to v8.  Any help would be great 
since I can't workaround this issue using DLLs since they don't build at 
the moment.

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [v8-users] Builder v8 as a static library for Android

2013-09-17 Thread Diep Nguyen Hoang
I have edited my android.gypi like this:

['_type==static_library', {
'ldflags': [
  # Don't export symbols from statically linked libraries.
  '-Wl,--exclude-libs=ALL',
],
'standalone_static_library': 1, 
  }],

And it does not work, my output still 3MB libv8_base.arm.a with bunch of 
object file which do not merged into .a file.

On Tuesday, September 17, 2013 7:48:56 PM UTC+7, Ben Noordhuis wrote:

 On Tue, Sep 17, 2013 at 11:50 AM, Diep Nguyen Hoang 
 virusl...@gmail.com javascript: wrote: 
  Hi, currently I'm trying to build v8 as a static library on Android. 
  
  I have successfully finished build command, and have libv8_base.arm.a, 
  libv8_nosnapshot.arm.a, libv8_snapshot.a already. But when I put them 
 into 
  my project and compile, these .a file seems to be directly linked to the 
 .o 
  files, which are result of v8 building. I also notice that, size of 
 these .a 
  files is too small (about 1MB), and contains no object file but the 
 absolute 
  path to object file (using $ cat). 
  
  What I want is static library must contains all object files, not map to 
  them, so I can push them to repository, is this right? I used default 
 build 
  command (make android_arm.release, OS: Ubuntu 12 and OS X). Now because 
 the 
  .a files just contain the paths, not objects themself, my project build 
  command is failed. 
  
  Please help, 
  Thanks, 

 GYP builds thin archives by default on platforms that support it (the 
 GNU toolchain on Linux does, don't think OS X does.)  You can disable 
 it by setting standalone_static_library: 1 in the *.gyp file that 
 builds the static library, e.g.: 

   'targets': [{ 
 'target_name': 'foo', 
 'type': 'static_library', 
 'standalone_static_library': 1, 
 'sources': [ ... ] 
   }] 

 Good luck. 


-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [v8-users] Builder v8 as a static library for Android

2013-09-17 Thread Diep Nguyen Hoang
Updated: it works, thanks for your help!

On Wednesday, September 18, 2013 8:48:03 AM UTC+7, Diep Nguyen Hoang wrote:

 I have edited my android.gypi like this:

 ['_type==static_library', {
 'ldflags': [
   # Don't export symbols from statically linked libraries.
   '-Wl,--exclude-libs=ALL',
 ],
 'standalone_static_library': 1, 
   }],

 And it does not work, my output still 3MB libv8_base.arm.a with bunch of 
 object file which do not merged into .a file.

 On Tuesday, September 17, 2013 7:48:56 PM UTC+7, Ben Noordhuis wrote:

 On Tue, Sep 17, 2013 at 11:50 AM, Diep Nguyen Hoang 
 virusl...@gmail.com wrote: 
  Hi, currently I'm trying to build v8 as a static library on Android. 
  
  I have successfully finished build command, and have libv8_base.arm.a, 
  libv8_nosnapshot.arm.a, libv8_snapshot.a already. But when I put them 
 into 
  my project and compile, these .a file seems to be directly linked to 
 the .o 
  files, which are result of v8 building. I also notice that, size of 
 these .a 
  files is too small (about 1MB), and contains no object file but the 
 absolute 
  path to object file (using $ cat). 
  
  What I want is static library must contains all object files, not map 
 to 
  them, so I can push them to repository, is this right? I used default 
 build 
  command (make android_arm.release, OS: Ubuntu 12 and OS X). Now because 
 the 
  .a files just contain the paths, not objects themself, my project build 
  command is failed. 
  
  Please help, 
  Thanks, 

 GYP builds thin archives by default on platforms that support it (the 
 GNU toolchain on Linux does, don't think OS X does.)  You can disable 
 it by setting standalone_static_library: 1 in the *.gyp file that 
 builds the static library, e.g.: 

   'targets': [{ 
 'target_name': 'foo', 
 'type': 'static_library', 
 'standalone_static_library': 1, 
 'sources': [ ... ] 
   }] 

 Good luck. 



-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.