[v8-users] How do compile the code coverage for V8?

2018-09-03 Thread hikai . bep
Hello
I create gn files with args.

gn args test/ --args='target_cpu="x64" v8_target_cpu="arm64" is_debug=true 
v8_code_coverage=true is_clang=false v8_optimized_debug=false'

And I tried compile with gcc 8.1.0 in Ubuntu 16.04 but occured errors.

---
hikai@ubuntu:~/wrap_v8/v8/out.gn$ ninja -C ./test/
ninja: Entering directory `./test/'
[299/1646] CXX obj/lib_wasm_fuzzer_common/wasm-fuzzer-common.o
FAILED: obj/lib_wasm_fuzzer_common/wasm-fuzzer-common.o
g++ -MMD -MF obj/lib_wasm_fuzzer_common/wasm-fuzzer-common.o.d 
-DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 
-DUSE_NSS_CERTS=1 -DUSE_X11=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD 
-DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DCOMPONENT_BUILD 
-DCR_LIBCXX_REVISION=332543 -DCR_LIBCXXABI_REVISION=331450 
-DCR_SYSROOT_HASH=815a8c22f8657fe57d02e2c2d893bcdc25a243cf -D_DEBUG 
-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 
-D_GLIBCXX_DEBUG=1 -DUSING_V8_SHARED -DV8_ENABLE_CHECKS 
-DV8_DEPRECATION_WARNINGS -DV8_IMMINENT_DEPRECATION_WARNINGS 
-DENABLE_DISASSEMBLER -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64 
-DENABLE_MINOR_MC -DOBJECT_PRINT -DVERIFY_HEAP -DV8_TRACE_MAPS 
-DV8_ENABLE_ALLOCATION_TIMEOUT -DV8_ENABLE_FORCE_SLOW_PATH 
-DV8_ENABLE_CHECKS -DV8_DEPRECATION_WARNINGS 
-DV8_IMMINENT_DEPRECATION_WARNINGS -DV8_INTL_SUPPORT 
-DENABLE_HANDLE_ZAPPING -DV8_USE_SNAPSHOT -DV8_USE_EXTERNAL_STARTUP_DATA 
-DV8_CONCURRENT_MARKING -DV8_CHECK_MICROTASKS_SCOPES_CONSISTENCY 
-DV8_EMBEDDED_BUILTINS -DV8_TARGET_ARCH_ARM64 -DDEBUG 
-DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 
-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE=uint16_t -I../.. -Igen 
-I../../include -Igen/include -I../.. -Igen 
-I../../third_party/icu/source/common -I../../third_party/icu/source/i18n 
-fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector 
-Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= 
-funwind-tables -fPIC -pipe 
-B../../third_party/binutils/Linux_x64/Release/bin -pthread -m64 
-march=x86-64 -Wall -Werror -Wno-unused-local-typedefs 
-Wno-maybe-uninitialized -Wno-deprecated-declarations 
-fno-delete-null-pointer-checks -Wno-comments 
-Wno-missing-field-initializers -Wno-unused-parameter 
-fno-omit-frame-pointer -g2 -gsplit-dwarf -fno-builtin-abs 
-Wno-strict-overflow -Wno-return-type -O0 -fprofile-arcs -ftest-coverage 
-fvisibility=default -std=gnu++14 -Wno-narrowing -fno-exceptions -fno-rtti 
-nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include 
-isystem../../buildtools/third_party/libc++abi/trunk/include 
--sysroot=../../build/linux/debian_sid_amd64-sysroot -c 
../../test/fuzzer/wasm-fuzzer-common.cc -o 
obj/lib_wasm_fuzzer_common/wasm-fuzzer-common.o
In file included from ../../src/debug/debug.h:18,
 from ../../src/wasm/wasm-objects.h:9,
 from ../../src/wasm/wasm-objects-inl.h:8,
 from ../../test/fuzzer/wasm-fuzzer-common.cc:13:
../../src/frames.h: In member function ‘void 
v8::internal::InnerPointerToCodeCache::Flush()’:
../../src/frames.h:46:41: error: ‘void* memset(void*, int, size_t)’ 
clearing an object of non-trivial type ‘struct 
v8::internal::InnerPointerToCodeCache::InnerPointerToCodeCacheEntry’; use 
assignment or value-initialization instead [-Werror=class-memaccess]
 memset(_[0], 0, sizeof(cache_));
 ^
../../src/frames.h:35:10: note: ‘struct 
v8::internal::InnerPointerToCodeCache::InnerPointerToCodeCacheEntry’ 
declared here
   struct InnerPointerToCodeCacheEntry {
  ^~~~
cc1plus: all warnings being treated as errors
[303/1646] CXX obj/multi_return_fuzzer/multi-return.o
FAILED: obj/multi_return_fuzzer/multi-return.o
g++ -MMD -MF obj/multi_return_fuzzer/multi-return.o.d 
-DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 
-DUSE_NSS_CERTS=1 -DUSE_X11=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD 
-DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DCOMPONENT_BUILD 
-DCR_LIBCXX_REVISION=332543 -DCR_LIBCXXABI_REVISION=331450 
-DCR_SYSROOT_HASH=815a8c22f8657fe57d02e2c2d893bcdc25a243cf -D_DEBUG 
-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 
-D_GLIBCXX_DEBUG=1 -DUSING_V8_SHARED -DV8_ENABLE_CHECKS 
-DV8_DEPRECATION_WARNINGS -DV8_IMMINENT_DEPRECATION_WARNINGS 
-DENABLE_DISASSEMBLER -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64 
-DENABLE_MINOR_MC -DOBJECT_PRINT -DVERIFY_HEAP -DV8_TRACE_MAPS 
-DV8_ENABLE_ALLOCATION_TIMEOUT -DV8_ENABLE_FORCE_SLOW_PATH 
-DV8_ENABLE_CHECKS -DV8_DEPRECATION_WARNINGS 
-DV8_IMMINENT_DEPRECATION_WARNINGS -DV8_INTL_SUPPORT 
-DENABLE_HANDLE_ZAPPING -DV8_USE_SNAPSHOT -DV8_USE_EXTERNAL_STARTUP_DATA 
-DV8_CONCURRENT_MARKING -DV8_CHECK_MICROTASKS_SCOPES_CONSISTENCY 

Re: [v8-users] Arraybuffer

2018-09-03 Thread dan Med
Can someone help me out?

Il giorno sab 1 set 2018 alle ore 15:30  ha
scritto:

> array_buffer_builder.cc in src /
> third_party /blink
> /renderer
> /
> platform
> 
> /wtf
> 
> /typed_arrays
> 
> /array_buffer_builder.cc
> 
>
> the ArrayBufferBuilder
> 
> ::Append
> 
>  method
> will be called through a view on top of the arraybuffer? something like,
> there's a arraybuffer of 30bytes in length and we define a view on top of
> it (so a typedarray) wehn i call on the new typedarray object the .append
> method it will call ArrayBufferBuilder
> 
> ::Append
> 
> and then inside it's code it will execute ArrayBufferBuilder
> 
> ::ExpandCapacity
> 
>  if
> it needs to reallocate the array ?
>
> if so inside the expandCapacity definition bytes_used
> 
>  referes
> to the elements inside the actual arraybuffer so if i have a arraybuffer
> which is 8 bytes in length [ ][ ][ ][ ][ ][ ][ ][ ] and i fill in only 3
> bytes so
> [1][2][3][ ][ ][ ][ ][ ] the bytes_used
> 
>  when
> retrieved will be set to 3 bytes ??
>
> ArrayBufferBuilder 
> ::ArrayBufferBuilder
>  
> ()
> : bytes_used_ 
> (0),
>  variable_capacity_ 
> (true)
>  {  buffer_ 
> 
>  = 
> 
>  ArrayBuffer 
> ::Create
>  
> 

Re: [v8-users] Help

2018-09-03 Thread dan Med
Can someone help me out ?

Il giorno dom 2 set 2018 alle ore 11:26  ha
scritto:

>  memcpy(static_cast(buffer_->Data()) + bytes_used_,
> data,bytes_to_save);
>
> with this memcpy is it copying from data which is a const char pointer n
> bytes_to_save into the array buffer_ or into a specific offset from the
> array ?
>
> --
> --
> 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] Access violation when constructing a new isolate: invalid builtins?

2018-09-03 Thread Jakob Gruber
Could you open a new bug at crbug.com/v8/new and include minimal repro?

On Mon, Sep 3, 2018 at 6:13 PM, Dickson Tan 
wrote:

> Hi,
>
> I'm getting errors when creating a new context, and it crashes with an
> access violation here on api.cc:
>
>   // Sanity-check that the isolate is initialized and usable.
>
>   CHECK(isolate->builtins()->builtin(i::Builtins::kIllegal)->IsCode());
>
> Which eventually calls line 142 of builtins.cc:
>
> Code* Builtins::builtin(int index) { return isolate_->heap()->builtin(index);
> }
>

Just to be clear, what exactly is crashing? Is the CHECK expectation
failing or something before that?


>
> I'm building with MSVC on windows 10 x64, with the following build flags
>
> is_debug = true
> target_cpu = "x64"
> is_component_build = false
> v8_static_library = true
> v8_enable_i18n_support=false
> is_clang=false
> use_lld = false
> v8_use_snapshot=false
>
> At first, I thought that somehow its not finding my snapshots even though
> its in the correct location, but this occurs even when compiling without
> snapshot support.
>
> I've also done all initialization as per the hello world example, and am
> building against v7.1.0 (pulled from git a few days ago).
>
> Appreciate any 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/d/optout.


[v8-users] Access violation when constructing a new isolate: invalid builtins?

2018-09-03 Thread Dickson Tan
Hi,

I'm getting errors when creating a new context, and it crashes with an 
access violation here on api.cc:

  // Sanity-check that the isolate is initialized and usable.

  CHECK(isolate->builtins()->builtin(i::Builtins::kIllegal)->IsCode());

Which eventually calls line 142 of builtins.cc:

Code* Builtins::builtin(int index) { return 
isolate_->heap()->builtin(index); }

I'm building with MSVC on windows 10 x64, with the following build flags

is_debug = true 
target_cpu = "x64"
is_component_build = false
v8_static_library = true
v8_enable_i18n_support=false
is_clang=false
use_lld = false
v8_use_snapshot=false

At first, I thought that somehow its not finding my snapshots even though 
its in the correct location, but this occurs even when compiling without 
snapshot support.

I've also done all initialization as per the hello world example, and am 
building against v7.1.0 (pulled from git a few days ago).

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