[v8-users] gypfiles/gyp_v8 options to this script

2016-12-07 Thread pavel . d
Is there anywhere documented what options and values does gypfiles/gyp_v8 
 script take ?

-- 
-- 
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/d/optout.


Re: [v8-users] gypfiles/gyp_v8 options to this script

2016-12-07 Thread Jochen Eisinger
no, the options aren't documented :-/

However, gyp is deprecated, have you looked at gn yet?

On Wed, Dec 7, 2016 at 9:30 AM  wrote:

> Is there anywhere documented what options and values does gypfiles/gyp_v8
>  script take ?
>
> --
> --
> 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/d/optout.
>

-- 
-- 
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/d/optout.


Re: [v8-users] Looking for streamlined way to access object properties

2016-12-07 Thread Jochen Eisinger
You could use v8::Object::GetOwnPropertyNames instead of trying each key
individually

On Tue, Dec 6, 2016 at 11:04 PM kent williams 
wrote:

> There's a convention that we use for our C++ native functions called from
> C++, where required arguments are followed (optionally) by an object whose
> properties are additional flags. EG
>
> var num = convertNumber(x);
> var num2 = convertNumber(x, { base: 8 });
>
> Is there a streamlined way to extract properties from this optional object?
>
> I end up doing this:
>
> v8::Local argsObj;
> argsObj.Clear();
> if(args.Length() >=2)
>   argsObj = args[1];
>
> const char *cvval = 0;
> if(!argsObj.IsEmpty()) {
>   v8::Local cvt = v8::String::NewFromUtf8(isolate,
>"convert",
> v8::NewStringType::kNormal).ToLocalChecked();
>   v8::MaybeLocal convertval = argsObj->Get(context,cvt);
>
>   if(!convertval.IsEmpty()) {
> v8::Local cv = convertval.ToLocalChecked();
> v8::String::Utf8Value val2 = cv->ToString();
> cvval = *val2 ? *val2 : 0;
>   }
> }
>
> This seems like a whole lot of work -- way more than Spidermonkey, for
> example.
>
> Are there some convenience functions that make this less painful, or do I
> have to write my own?
>
> 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/d/optout.
>

-- 
-- 
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/d/optout.


Re: [v8-users] gypfiles/gyp_v8 options to this script

2016-12-07 Thread pavel . d
Well i already figured out how to build on windows so i feel comitted to 
gyp :) . However do you know the option to specify os that i want to build 
for , and do you know what values take -Dtarget_arch=  i want to build for 
arm and arm64 and atom32 for android

On Wednesday, December 7, 2016 at 12:01:43 PM UTC+2, Jochen Eisinger wrote:
>
> no, the options aren't documented :-/
>
> However, gyp is deprecated, have you looked at gn yet?
>
> On Wed, Dec 7, 2016 at 9:30 AM > 
> wrote:
>
>> Is there anywhere documented what options and values does gypfiles/gyp_v8 
>>  script take ?
>>
>> -- 
>> -- 
>> v8-users mailing list
>> v8-u...@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+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
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/d/optout.


Re: [v8-users] gypfiles/gyp_v8 options to this script

2016-12-07 Thread Peter Kanev
Hey, do let me know if you succeed in building for android OS under 
Windows. I just tried with GN and cross-compiling and building for android 
seems impossible at the moment. Errors are thrown in your face as early as 
the configuration phase (gn args)

On Wednesday, December 7, 2016 at 12:09:53 PM UTC+2, 
pav...@coherent-labs.com wrote:
>
> Well i already figured out how to build on windows so i feel comitted to 
> gyp :) . However do you know the option to specify os that i want to build 
> for , and do you know what values take -Dtarget_arch=  i want to build for 
> arm and arm64 and atom32 for android
>
> On Wednesday, December 7, 2016 at 12:01:43 PM UTC+2, Jochen Eisinger wrote:
>>
>> no, the options aren't documented :-/
>>
>> However, gyp is deprecated, have you looked at gn yet?
>>
>> On Wed, Dec 7, 2016 at 9:30 AM  wrote:
>>
>>> Is there anywhere documented what options and values does 
>>> gypfiles/gyp_v8  script take ?
>>>
>>> -- 
>>> -- 
>>> v8-users mailing list
>>> v8-u...@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+u...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
-- 
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/d/optout.


[v8-users] Building mksnapshot for Android under Windows

2016-12-07 Thread Peter Kanev
I work on a project that embeds v8 in native Android applications, the v8 
used for all 3 architectures  (arm v7, arm 64, x86) we support is built on 
Linux machines.

As a next step the project must support generation of snapshot blobs for 
those 3 archs, and as such I need to build the mksnapshot tool on Windows, 
to accommodate users developing on Win machines. 

I managed to build only the default `v8` and `mksnapshot` for `x64`, with 
target_os being that of the host - Windows. I seem unable to configure GN 
(using gn args) to build for android. Could I be missing something, or is 
that case not at all supported? What about building for android on Windows 
with Gyp?

Thank you!

-- 
-- 
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/d/optout.


[v8-users] Re: Building mksnapshot for Android under Windows

2016-12-07 Thread pavel . d
What values do you give to -Dtarget_arch= ? , and how do you specify what 
option do you use to specify the target os to gyp_v8


On Wednesday, December 7, 2016 at 1:50:53 PM UTC+2, Peter Kanev wrote:
>
> I work on a project that embeds v8 in native Android applications, the v8 
> used for all 3 architectures  (arm v7, arm 64, x86) we support is built on 
> Linux machines.
>
> As a next step the project must support generation of snapshot blobs for 
> those 3 archs, and as such I need to build the mksnapshot tool on Windows, 
> to accommodate users developing on Win machines. 
>
> I managed to build only the default `v8` and `mksnapshot` for `x64`, with 
> target_os being that of the host - Windows. I seem unable to configure GN 
> (using gn args) to build for android. Could I be missing something, or is 
> that case not at all supported? What about building for android on Windows 
> with Gyp?
>
> Thank you!
>

-- 
-- 
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/d/optout.


Re: [v8-users] Re: Building mksnapshot for Android under Windows

2016-12-07 Thread Peter Kanev
Since I tried building with GN, I supplied arguments in the `gn args` txt
document. `target_os` was set to `android`, there is an explicit assertion
in BUILDCONFIG.gn however in /build/config that checks whether I am on a
linux or mac when targeting android. As far as I am aware building with GYP
(not GN) was possible for android.

On 7 December 2016 at 14:18,  wrote:

> What values do you give to -Dtarget_arch= ? , and how do you specify what
> option do you use to specify the target os to gyp_v8
>
>
> On Wednesday, December 7, 2016 at 1:50:53 PM UTC+2, Peter Kanev wrote:
>>
>> I work on a project that embeds v8 in native Android applications, the v8
>> used for all 3 architectures  (arm v7, arm 64, x86) we support is built on
>> Linux machines.
>>
>> As a next step the project must support generation of snapshot blobs for
>> those 3 archs, and as such I need to build the mksnapshot tool on Windows,
>> to accommodate users developing on Win machines.
>>
>> I managed to build only the default `v8` and `mksnapshot` for `x64`, with
>> target_os being that of the host - Windows. I seem unable to configure GN
>> (using gn args) to build for android. Could I be missing something, or is
>> that case not at all supported? What about building for android on Windows
>> with Gyp?
>>
>> Thank you!
>>
> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "v8-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/v8-users/2MXbdImcK00/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Sincerely,
*Pete.*

-- 
-- 
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/d/optout.


Re: [v8-users] Looking for streamlined way to access object properties

2016-12-07 Thread kent williams
I should maybe try v8::Object::Has -- it looks like it will tell you if an 
object has a property, but it isn't really documented anywhere what it does.

On Wednesday, December 7, 2016 at 4:03:02 AM UTC-6, Jochen Eisinger wrote:
>
> You could use v8::Object::GetOwnPropertyNames instead of trying each key 
> individually
>
> On Tue, Dec 6, 2016 at 11:04 PM kent williams  > wrote:
>
>> There's a convention that we use for our C++ native functions called from 
>> C++, where required arguments are followed (optionally) by an object whose 
>> properties are additional flags. EG
>>
>> var num = convertNumber(x);
>> var num2 = convertNumber(x, { base: 8 });
>>
>> Is there a streamlined way to extract properties from this optional 
>> object?
>>
>> I end up doing this:
>>
>> v8::Local argsObj;
>> argsObj.Clear();
>> if(args.Length() >=2)
>>   argsObj = args[1];
>>
>> const char *cvval = 0;
>> if(!argsObj.IsEmpty()) {
>>   v8::Local cvt = v8::String::NewFromUtf8(isolate,
>>"convert", 
>> v8::NewStringType::kNormal).ToLocalChecked();
>>   v8::MaybeLocal convertval = argsObj->Get(context,cvt);
>>
>>   if(!convertval.IsEmpty()) {
>> v8::Local cv = convertval.ToLocalChecked();
>> v8::String::Utf8Value val2 = cv->ToString();
>> cvval = *val2 ? *val2 : 0;
>>   }
>> }
>>
>> This seems like a whole lot of work -- way more than Spidermonkey, for 
>> example.
>>
>> Are there some convenience functions that make this less painful, or do I 
>> have to write my own?
>>
>> Thanks!
>>
>> -- 
>> -- 
>> v8-users mailing list
>> v8-u...@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+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
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/d/optout.


[v8-users] CENTOS/RHEL: How to build V8 and then link to it?

2016-12-07 Thread kent williams

What I've done so far:
Based on what I've gathered from the v8 WIKI combined with trial and error 
I use this script

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$(pwd)/depot_tools:${PATH}"
gclient sync
fetch v8
cd v8
gn gen out.gn/x64.debug --args='is_debug=true target_cpu="x64" 
is_component_build=false'
#tools/dev/v8gen.py x64.debug
ninja -C out.gn/x64.debug

That works, but in my opinion this is a whole load of hand waving and 
nonsense.  I'm using depot_tools which has a whole giant CLang++ toolset as 
binaries.  This is no way to run a railroad in my opinion but this is 
Google, they do what they want.

Then I tried the simplest possible thing -- copy shell.cc out of 
v8/samples, and make a CMake project to build it.

project(v8Shell)
link_directories(${V8_DIR}/out.gn/x64.debug/obj)
link_directories(${V8_DIR}/out.gn/x64.release/obj)
link_directories(${V8_DIR}/out.gn/x64.debug/obj/third_party)
link_directories(${V8_DIR}/out.gn/x64.release/obj/third_party)
include_directories(SYSTEM BEFORE
  ${V8_DIR}/include
  ${CMAKE_CURRENT_BINARY_DIR})

set(V8_LIBRARY v8_libplatform v8_libbase icui18n icuuc pthread)
add_executable(shell shell.cc)
target_link_libraries(shell ${V8_LIBRARY})

What happens then is a ton of undefined symbols (output at the end of this 
e-mail).

I've tried the obvious solution -- just install the system v8 package -- 
but the version of v8 that's in the Centos repos is way too old. It doesn't 
support the currently documented API.

Is there a way to just BUILD THE V8 Libraries and link them without 
depot_tools?  Why is this so complicated and obscure?

/usr/bin/c++-std=c++11 -pthread -DLeepDebug -DLeepDebug -g   
CMakeFiles/shell.dir/shell.cc.o  -o shell 
 -L/onderon-home/kwilliams/develop/pagewiz.v8/build/dependencies-install/lib 
 -L/onderon-home/kwilliams/develop/pagewiz.v8/build/v8/out.gn/x64.debug/obj 
 -L/onderon-home/kwilliams/develop/pagewiz.v8/build/v8/out.gn/x64.release/obj 
 
-L/onderon-home/kwilliams/develop/pagewiz.v8/build/v8/out.gn/x64.debug/obj/third_party
 
-rdynamic -lv8_libplatform -lv8_libbase -licui18n -licuuc -lpthread 
-Wl,-rpath,/onderon-home/kwilliams/develop/pagewiz.v8/build/dependencies-install/lib:/onderon-home/kwilliams/develop/pagewiz.v8/build/v8/out.gn/x64.debug/obj:/onderon-home/kwilliams/develop/pagewiz.v8/build/v8/out.gn/x64.release/obj:/onderon-home/kwilliams/develop/pagewiz.v8/build/v8/out.gn/x64.debug/obj/third_party
 
CMakeFiles/shell.dir/shell.cc.o: In function `main':
/onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:67: undefined 
reference to `v8::V8::InitializeICUDefaultLocation(char const*, char 
const*)'
/onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:68: undefined 
reference to `v8::V8::InitializeExternalStartupData(char const*)'
/onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:70: undefined 
reference to `v8::V8::InitializePlatform(v8::Platform*)'
/onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:71: undefined 
reference to `v8::V8::Initialize()'
/onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:72: undefined 
reference to `v8::V8::SetFlagsFromCommandLine(int*, char**, bool)'
/onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:75: undefined 
reference to `v8::ArrayBuffer::Allocator::NewDefaultAllocator()'
/onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:76: undefined 
reference to `v8::Isolate::New(v8::Isolate::CreateParams const&)'
/onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:81: undefined 
reference to `v8::HandleScope::HandleScope(v8::Isolate*)'
CMakeFiles/shell.dir/shell.cc.o: In function `Scope':
/usr/local/kwilliams/develop/pagewiz.v8/build/v8/include/v8.h:8027: 
undefined reference to `v8::Context::Enter()'
CMakeFiles/shell.dir/shell.cc.o: In function `~Scope':
/usr/local/kwilliams/develop/pagewiz.v8/build/v8/include/v8.h:8029: 
undefined reference to `v8::Context::Exit()'
CMakeFiles/shell.dir/shell.cc.o: In function `main':
/usr/local/kwilliams/develop/pagewiz.v8/build/v8/include/v8.h:8029: 
undefined reference to `v8::HandleScope::~HandleScope()'
CMakeFiles/shell.dir/shell.cc.o: In function `main':
/onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:91: undefined 
reference to `v8::Isolate::Dispose()'
/onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:92: undefined 
reference to `v8::V8::Dispose()'
/onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:93: undefined 
reference to `v8::V8::ShutdownPlatform()'
CMakeFiles/shell.dir/shell.cc.o: In function `~Scope':
/usr/local/kwilliams/develop/pagewiz.v8/build/v8/include/v8.h:8029: 
undefined reference to `v8::Context::Exit()'
CMakeFiles/shell.dir/shell.cc.o: In function `main':
/onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:81: undefined 
reference to `v8::HandleScope::~HandleScope()'
CMakeFiles/shell.dir/shell.cc.o: In function 
`CreateShellContext(v8::Isolate*)':
/onderon-home/kwilliams/develop/pagewiz.v8/pagewiz

Re: [v8-users] CENTOS/RHEL: How to build V8 and then link to it?

2016-12-07 Thread Ben Noordhuis
On Wed, Dec 7, 2016 at 6:31 PM, kent williams  wrote:
>
> What I've done so far:
> Based on what I've gathered from the v8 WIKI combined with trial and error I
> use this script
>
> git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
> export PATH="$(pwd)/depot_tools:${PATH}"
> gclient sync
> fetch v8
> cd v8
> gn gen out.gn/x64.debug --args='is_debug=true target_cpu="x64"
> is_component_build=false'
> #tools/dev/v8gen.py x64.debug
> ninja -C out.gn/x64.debug
>
> That works, but in my opinion this is a whole load of hand waving and
> nonsense.  I'm using depot_tools which has a whole giant CLang++ toolset as
> binaries.  This is no way to run a railroad in my opinion but this is
> Google, they do what they want.
>
> Then I tried the simplest possible thing -- copy shell.cc out of v8/samples,
> and make a CMake project to build it.
>
> project(v8Shell)
> link_directories(${V8_DIR}/out.gn/x64.debug/obj)
> link_directories(${V8_DIR}/out.gn/x64.release/obj)
> link_directories(${V8_DIR}/out.gn/x64.debug/obj/third_party)
> link_directories(${V8_DIR}/out.gn/x64.release/obj/third_party)
> include_directories(SYSTEM BEFORE
>   ${V8_DIR}/include
>   ${CMAKE_CURRENT_BINARY_DIR})
>
> set(V8_LIBRARY v8_libplatform v8_libbase icui18n icuuc pthread)
> add_executable(shell shell.cc)
> target_link_libraries(shell ${V8_LIBRARY})
>
> What happens then is a ton of undefined symbols (output at the end of this
> e-mail).
>
> I've tried the obvious solution -- just install the system v8 package -- but
> the version of v8 that's in the Centos repos is way too old. It doesn't
> support the currently documented API.
>
> Is there a way to just BUILD THE V8 Libraries and link them without
> depot_tools?  Why is this so complicated and obscure?
>
> /usr/bin/c++-std=c++11 -pthread -DLeepDebug -DLeepDebug -g
> CMakeFiles/shell.dir/shell.cc.o  -o shell
> -L/onderon-home/kwilliams/develop/pagewiz.v8/build/dependencies-install/lib
> -L/onderon-home/kwilliams/develop/pagewiz.v8/build/v8/out.gn/x64.debug/obj
> -L/onderon-home/kwilliams/develop/pagewiz.v8/build/v8/out.gn/x64.release/obj
> -L/onderon-home/kwilliams/develop/pagewiz.v8/build/v8/out.gn/x64.debug/obj/third_party
> -rdynamic -lv8_libplatform -lv8_libbase -licui18n -licuuc -lpthread
> -Wl,-rpath,/onderon-home/kwilliams/develop/pagewiz.v8/build/dependencies-install/lib:/onderon-home/kwilliams/develop/pagewiz.v8/build/v8/out.gn/x64.debug/obj:/onderon-home/kwilliams/develop/pagewiz.v8/build/v8/out.gn/x64.release/obj:/onderon-home/kwilliams/develop/pagewiz.v8/build/v8/out.gn/x64.debug/obj/third_party
> CMakeFiles/shell.dir/shell.cc.o: In function `main':
> /onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:67: undefined
> reference to `v8::V8::InitializeICUDefaultLocation(char const*, char
> const*)'
> /onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:68: undefined
> reference to `v8::V8::InitializeExternalStartupData(char const*)'
> /onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:70: undefined
> reference to `v8::V8::InitializePlatform(v8::Platform*)'
> /onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:71: undefined
> reference to `v8::V8::Initialize()'
> /onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:72: undefined
> reference to `v8::V8::SetFlagsFromCommandLine(int*, char**, bool)'
> /onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:75: undefined
> reference to `v8::ArrayBuffer::Allocator::NewDefaultAllocator()'
> /onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:76: undefined
> reference to `v8::Isolate::New(v8::Isolate::CreateParams const&)'
> /onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:81: undefined
> reference to `v8::HandleScope::HandleScope(v8::Isolate*)'
> CMakeFiles/shell.dir/shell.cc.o: In function `Scope':
> /usr/local/kwilliams/develop/pagewiz.v8/build/v8/include/v8.h:8027:
> undefined reference to `v8::Context::Enter()'
> CMakeFiles/shell.dir/shell.cc.o: In function `~Scope':
> /usr/local/kwilliams/develop/pagewiz.v8/build/v8/include/v8.h:8029:
> undefined reference to `v8::Context::Exit()'
> CMakeFiles/shell.dir/shell.cc.o: In function `main':
> /usr/local/kwilliams/develop/pagewiz.v8/build/v8/include/v8.h:8029:
> undefined reference to `v8::HandleScope::~HandleScope()'
> CMakeFiles/shell.dir/shell.cc.o: In function `main':
> /onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:91: undefined
> reference to `v8::Isolate::Dispose()'
> /onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:92: undefined
> reference to `v8::V8::Dispose()'
> /onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:93: undefined
> reference to `v8::V8::ShutdownPlatform()'
> CMakeFiles/shell.dir/shell.cc.o: In function `~Scope':
> /usr/local/kwilliams/develop/pagewiz.v8/build/v8/include/v8.h:8029:
> undefined reference to `v8::Context::Exit()'
> CMakeFiles/shell.dir/shell.cc.o: In function `main':
> /onderon-home/kwilliams/develop/pagewiz.v8/pagewiz/shell.cc:81: und

Re: [v8-users] CENTOS/RHEL: How to build V8 and then link to it?

2016-12-07 Thread kent williams
On Wednesday, December 7, 2016 at 11:48:30 AM UTC-6, Ben Noordhuis wrote:
>
>
>
> The link order is fairly crucial.  Try adding -Wl,--no-as-needed.  If 
> linking now succeeds, you know you need to rearrange the -l 
> switches until it works. 

 
Makes no difference.  I can see why there's a problem -- the first few 
undefined symbols reported are defined in api.cc, but the libraries built 
don't include that object file (see below).

The problem is that the build system based on gn doesn't make sense to me, 
and I have a hard time working out how to debug what it's doing.  Not 
including important files in the libraries would explain a lot. Why that's 
happening? no clue

ar -t obj/libv8_libbase.a 
bits.o
cpu.o
stack_trace.o
division-by-constant.o
file-utils.o
functional.o
ieee754.o
logging.o
once.o
condition-variable.o
mutex.o
semaphore.o
time.o
sys-info.o
random-number-generator.o
platform-posix.o
stack_trace_posix.o
platform-linux.o
onderon 
/onderon-home/kwilliams/develop/pagewiz.v8/build/v8/out.gn/x64.debug $ ar 
-t obj/libv8_libplatform.a 
default-platform.o
task-queue.o
trace-buffer.o
trace-config.o
trace-object.o
trace-writer.o
tracing-controller.o
worker-thread.o

-- 
-- 
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/d/optout.


[v8-users] SOLVED Re: CENTOS/RHEL: How to build V8 and then link to it?

2016-12-07 Thread kent williams
OK so I solved this more or less.

1. The GN build is broken with respect to building static libraries.  Once 
you leave 'gn land' and try and build something you're kind of screwed.
2. The deprecated GYP build does the right thing. For the moment I don't 
care if it's deprecated, since I'm going to pick a release tag and stick 
with it.

To build v8:
export PATH="$(pwd)/depot_tools:$PATH"
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
gclient sync
git clone -b 5.7.99 --single-branch 
https://chromium.googlesource.com/v8/v8.git
cd v8
make -j4 native

To build shell.cc with cmake:

project(shell)
cmake_minimum_required(VERSION 2.8)

link_directories(${V8_DIR}/out/native/obj.target/src)
link_directories(${V8_DIR}/out/native/obj.target/third_party)
link_directories(${V8_DIR}/out/native/obj.target/third_party/icu)

set(V8_LIBRARY v8_libplatform v8_base v8_libbase v8_nosnapshot 
v8_libsampler icui18n icuuc pthread)

include_directories(SYSTEM BEFORE ${V8_DIR} ${V8_DIR}/include
  ${CMAKE_CURRENT_BINARY_DIR})

add_executable(shell shell.cc)
target_link_libraries(shell ${V8_LIBRARY})

-- 
-- 
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/d/optout.


Re: [v8-users] Looking for streamlined way to access object properties

2016-12-07 Thread kent williams
I answered my own question again, sort of.

Both v8::Object::Has() and v8::Object::HasOwnProperty() will return true if 
a property exists on an object.

On Wednesday, December 7, 2016 at 10:44:20 AM UTC-6, kent williams wrote:
>
> I should maybe try v8::Object::Has -- it looks like it will tell you if an 
> object has a property, but it isn't really documented anywhere what it does.
>
> On Wednesday, December 7, 2016 at 4:03:02 AM UTC-6, Jochen Eisinger wrote:
>>
>> You could use v8::Object::GetOwnPropertyNames instead of trying each key 
>> individually
>>
>> On Tue, Dec 6, 2016 at 11:04 PM kent williams  
>> wrote:
>>
>>> There's a convention that we use for our C++ native functions called 
>>> from C++, where required arguments are followed (optionally) by an object 
>>> whose properties are additional flags. EG
>>>
>>> var num = convertNumber(x);
>>> var num2 = convertNumber(x, { base: 8 });
>>>
>>> Is there a streamlined way to extract properties from this optional 
>>> object?
>>>
>>> I end up doing this:
>>>
>>> v8::Local argsObj;
>>> argsObj.Clear();
>>> if(args.Length() >=2)
>>>   argsObj = args[1];
>>>
>>> const char *cvval = 0;
>>> if(!argsObj.IsEmpty()) {
>>>   v8::Local cvt = v8::String::NewFromUtf8(isolate,
>>>"convert", 
>>> v8::NewStringType::kNormal).ToLocalChecked();
>>>   v8::MaybeLocal convertval = argsObj->Get(context,cvt);
>>>
>>>   if(!convertval.IsEmpty()) {
>>> v8::Local cv = convertval.ToLocalChecked();
>>> v8::String::Utf8Value val2 = cv->ToString();
>>> cvval = *val2 ? *val2 : 0;
>>>   }
>>> }
>>>
>>> This seems like a whole lot of work -- way more than Spidermonkey, for 
>>> example.
>>>
>>> Are there some convenience functions that make this less painful, or do 
>>> I have to write my own?
>>>
>>> Thanks!
>>>
>>> -- 
>>> -- 
>>> v8-users mailing list
>>> v8-u...@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+u...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
-- 
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/d/optout.


[v8-users] What is difference between v8::Object::Has() and v8::Object::HasOwnProperty()?

2016-12-07 Thread kent williams
If this is documented anywhere, I haven't found it.

What is difference between v8::Object::Has() and 
v8::Object::HasOwnProperty()?

for example:

var x = { HasThisProperty : true };

Both functions return true.

What would be a case where one was true and the other false?

-- 
-- 
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/d/optout.


[v8-users] Is it possible to use system ICUUC and ICUIL8N libraries?

2016-12-07 Thread kent williams
I notice that v8 builds it's own ICU libraries. 

Is it possible to suppress this and use the system versions?


-- 
-- 
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/d/optout.


[v8-users] Garbage collections.

2016-12-07 Thread Jane Chen
Just upgraded v8 from 4.6 to 5.3 and found a new behavior:  garbage 
collection can happen in a background thread after 
ContextDisposedNotification and IdleNotificationDeadline return.  My 
idleNotificationDeadline runs in a loop with 1sec increments, and it 
typically comes out after 1 or 2 iterations.

My application has its own book keeping on allocated objects, so when 
IdleNotificationDeadline returns, while still in the Isolate, it forcefully 
cleans up the leftover references held from v8 weak callback params.

Apparently starting from 5.3, a race condition starts to happen during the 
above routine.

I experimented using the GC callbacks to track GC activity.  But even when 
the callback indicates GC is done, I still run into the race condition.

I'd hate to put in a mutex just for this due to performance concerns.  
Would be nice to have a reliably way to tell when GC is done.

Appreciate any advice on this.


-- 
-- 
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/d/optout.


Re: [v8-users] What is difference between v8::Object::Has() and v8::Object::HasOwnProperty()?

2016-12-07 Thread Jakob Kummerow
See https://tc39.github.io/ecma262/#sec-hasproperty vs.
https://tc39.github.io/ecma262/#sec-hasownproperty.


On Wed, Dec 7, 2016 at 2:48 PM, kent williams 
wrote:

> If this is documented anywhere, I haven't found it.
>
> What is difference between v8::Object::Has() and
> v8::Object::HasOwnProperty()?
>
> for example:
>
> var x = { HasThisProperty : true };
>
> Both functions return true.
>
> What would be a case where one was true and the other false?
>
> --
> --
> 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/d/optout.
>

-- 
-- 
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/d/optout.