Re: [v8-users] C++ access to WeakMap and WeakSet

2022-08-26 Thread Alex Kodat
you'd like to do by running a bit of script? > > Cheers, > shu > > On Fri, Aug 26, 2022 at 5:50 AM Alex Kodat > wrote: > >> Is there a way to create and manipulate WeakMaps and WeakSets from C++? >> This seems like such an obvious missing piece in the C++ API

[v8-users] C++ access to WeakMap and WeakSet

2022-08-26 Thread Alex Kodat
Is there a way to create and manipulate WeakMaps and WeakSets from C++? This seems like such an obvious missing piece in the C++ API that I'm sure the answer will be embarrassingly obvious (apologies in advance). -- -- v8-users mailing list v8-users@googlegroups.com

[v8-users] Re: External UTF-8 String

2021-01-12 Thread Alex Kodat
I think the string source needs to be Unicode (or Latin-1) to easily convert from character offsets to byte offsets. Obviously, that's not possible with UTF-8. If you're really concerned about the memory, you could get rid of the original UTF-8 string once it's been converted to Unicode or

[v8-users] Re: Build failure d8 with v8_static_library option on Mac

2021-01-11 Thread Alex Kodat
I've hit this same issue and a similar issue on Windows. To my limited understanding, the problem is in BUILD.gn: v8_source_set("v8_wrappers") { configs = [ ":internal_config" ] sources = [ "src/base/platform/wrappers.h" ] } It seems like maybe this should be a v8_header_set as there's no

Re: [v8-users] GC stack trace

2020-12-15 Thread Alex Kodat
You can use SetFlagsFromString: V8::SetFlagsFromString("--max_heap_size=4096"); // Pick your value I didn't look but I would assume you need to do this before you create the Isolate. There's also the Isolate AddNearHeapLimitCallback method but that's a bit more work to use. On Tuesday,

Re: [v8-users] How to retrieve a class defined in a module?

2020-11-27 Thread Alex Kodat
You wouldn't call it any more than you "call" it in JavaScript. You just get the value via the Object Get function: Local pastries = object->Get(context, String::NewFromUtf8( isolate, "lamingtons").ToLocalChecked()); On Friday, November 27, 2020 at 4:59:00 AM UTC-5 boi...@gmail.com wrote: >

[v8-users] Re: Build arm64 failed on Mac with error "implicit conversion loses integer precision"

2020-11-10 Thread Alex Kodat
Try treat_warnings_as_errors=false On Tuesday, November 10, 2020 at 9:53:22 PM UTC-5 Tie Sun wrote: > I'm trying to build v8(version 8.0) for android on Mac, and my args.gn is > as below: > == > is_debug = false > is_component_build = false > target_os =

[v8-users] Re: Integrating your personal changes as a dependency into V8

2020-10-27 Thread Alex Kodat
I can't imagine you could do much better than maintaining your own V8 branch(es) and just merging V8 changes when you want to upgrade V8. Otherwise you'll have to reinvent some git functionality -- there's no way to avoid merging your changes with V8 changes. If you're willing to go down this

Re: [v8-users] Cleaning up after a Posix fork

2020-09-14 Thread Alex Kodat
What are you trying to accomplish by forking instead of just creating a child process (strictly speaking, still a fork but then an exec)? If you're going to shut down isolates and reinstantiate them, even if you could get it to work, I'm not sure I see how that would be better than starting a

[v8-users] std::atomic in v8.h

2020-08-31 Thread Alex Kodat
In doing a clang build under Windows (for reasons I'll get into in another post) I hit a the following issue: [4/1336] CXX obj/src/inspector/inspector/v8-stack-trace-impl.obj FAILED: obj/src/inspector/inspector/v8-stack-trace-impl.obj ..\..\third_party\llvm-build\Release+Asserts\bin\clang-cl.exe

[v8-users] Re: CpuProfiler sampling and multiple threads

2020-08-03 Thread Alex Kodat
? Thanks and sorry about all the noise. On Sunday, August 2, 2020 at 3:04:03 PM UTC-5, Alex Kodat wrote: > > We're using the CpuProfiler in an Isolate that can have multiple threads > running and and taking turns in the Isolate via Unlocker. Frequently, we > want to profile what

[v8-users] Re: CpuProfiler sampling and multiple threads

2020-08-02 Thread Alex Kodat
as a CpuProfiler setting or on the StartProfiling call.With this approach there would be no extra overhead in getting samples for unlocked threads. On Sunday, August 2, 2020 at 3:04:03 PM UTC-5, Alex Kodat wrote: > > We're using the CpuProfiler in an Isolate that can have multiple threads >

[v8-users] CpuProfiler sampling and multiple threads

2020-08-02 Thread Alex Kodat
We're using the CpuProfiler in an Isolate that can have multiple threads running and and taking turns in the Isolate via Unlocker. Frequently, we want to profile what's happening on a thread so we do a StartProfiling for a thread, let it run for a while, and then collect the results via

Re: [v8-users] V8_31BIT_SMIS_ON_64BIT_ARCH

2020-04-15 Thread Alex Kodat
ERS without V8_31BIT_SMIS_ON_64BIT_ARCH. > > > On Tue, Apr 14, 2020 at 5:56 PM Alex Kodat > wrote: > >> It appears that the default for v8_enable_31bit_smis_on_64bit_arch has >> changed from false to true somewhere between 7.7 (our last build for our >> code) and 8.

[v8-users] V8_31BIT_SMIS_ON_64BIT_ARCH

2020-04-14 Thread Alex Kodat
It appears that the default for v8_enable_31bit_smis_on_64bit_arch has changed from false to true somewhere between 7.7 (our last build for our code) and 8.1 (what we're trying to upgrade to). It appears that if V8_COMPRESS_POINTERS is defined, the setting of V8_31BIT_SMIS_ON_64BIT_ARCH

[v8-users] Loading unaligned UTF-16 data in 7.6

2019-07-17 Thread Alex Kodat
In Reland "[runtime] Speed up String::IsOneByte", the following check was added to NonOneByteStart in src/objects/string.h: DCHECK(IsAligned(reinterpret_cast(chars), sizeof(uc16))); This is part of the very clever word at a time detection of code points > 256. Unfortunately for us, this

[v8-users] Re: Enabling GDB JIT integration in V8

2016-03-11 Thread Alex Kodat
You've probably already figured this out but in case anyone else should stumble over this... because almost anything interesting that one is likely to be tracing will be entered via a stub, --gdbjit is well nigh useless (well, for me anyway) and one needs to use --gdbjit_full. On Wednesday,

Re: [v8-users] Re: Exception::Error result is Local

2016-02-15 Thread Alex Kodat
ld be ok to have it return Local and crash on > anything else inside the API call. It would not break the API since > existing users of this should just compile just fine. > > Accepting patches :) > > On Thursday, February 11, 2016 at 7:58:06 PM UTC+1, Alex Kodat wrote: >&

Re: [v8-users] Re: Exception::Error result is Local

2016-02-11 Thread Alex Kodat
break the API for this small detail. That's just my opinion > though. > > Yang > > On Wednesday, February 10, 2016 at 6:39:44 PM UTC+1, Alex Kodat wrote: >> >> First, I'll confess I'm not a huge fan of MaybeLocal but, leaving that >> aside, even if I accept

[v8-users] Re: Exception::Error result is Local

2016-02-10 Thread Alex Kodat
fails, > undefined is returned. > > On Monday, February 8, 2016 at 9:03:42 PM UTC+1, Alex Kodat wrote: >> >> This must have been asked before but can't find an explanation so ... >> just curious why Exception::Error et al are declared to have a Local >> result i

Re: [v8-users] Re: Exception::Error result is Local

2016-02-10 Thread Alex Kodat
; On Wed, Feb 10, 2016 at 4:26 PM, Alex Kodat <ako...@rocketsoftware.com > > wrote: > >> Thanks for that. I suspected as much. Is v8 really doing embedder's a >> favor by exposing such a catastrophe to them? Presumably, if >> Factory::NewError fails, we're out of

[v8-users] Re: JSON.parse error message

2016-02-08 Thread Alex Kodat
quest sounds reasonable. Though you probably should have > filed an issue to the issue tracker instead. I created a patch for this > https://codereview.chromium.org/1681513002. > > Cheers, > > Yang > > On Monday, February 8, 2016 at 7:32:32 AM UTC+1, Alex Kodat wrote: >>

[v8-users] Exception::Error result is Local

2016-02-08 Thread Alex Kodat
This must have been asked before but can't find an explanation so ... just curious why Exception::Error et al are declared to have a Local result instead of Local. A not uncommon pattern is to create a new Error object and then set some properties on it which requires a ->ToObject or

Re: [v8-users] Farewell Callee

2015-12-11 Thread Alex Kodat
First, I'm really impressed with this group's responsiveness. Awesome! Second, I apologize if I gave folks extra work to do -- my intent was simply to give a heads up to other embedders. As it turns out, I was able to get rid of my two Callee uses. Jochen's suggestion caused a neuron to fire

[v8-users] Farewell Callee

2015-12-10 Thread Alex Kodat
Sorry if this would have been more appropriate on v8-dev but just downloaded the latest and greatest 4.9 commit and discovered that Callee is no longer available in FunctionCallBackInfo. While I'm sure there was a good reason for this, my sample size of one embedder registers one "ouch". Dunno

Re: [v8-users] Farewell Callee

2015-12-10 Thread Alex Kodat
allee. > > Wdyt Enrico? > Toon > > On Thu, Dec 10, 2015, 20:59 Alex Kodat <alex...@gmail.com > > wrote: > >> Sorry if this would have been more appropriate on v8-dev but just >> downloaded the latest and greatest 4.9 commit and discovered that Call

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-31 Thread Alex Kodat
CreateDataProperty or DefineOwnProperty should work. Of course, you have to make sure that the first time the function is accessed via the accessor when you do your override, you have to return the function from the accessor. But I assume you're doing that? On Friday, October 30, 2015 at

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-31 Thread Alex Kodat
tion. In my accessor before I return, I have: > > global->SetAccessor(context,property,0); > global->CreateDataProperty(context,property,obj); > > Then the property becomes undefined the second time on. > > On Saturday, October 31, 2015 at 10:04:24 AM UTC-7, Ale

Re: [v8-users] Re: Function names in CpuProfileNode.

2015-10-31 Thread Alex Kodat
a > context used to take ~2.9ms; after, ~0.5ms. Measured against 3.24. > > On Saturday, October 31, 2015 at 3:56:50 PM UTC-7, Alex Kodat wrote >> >> Sorry, you're right -- I should have researched the history and behavior >> of CreateDataProperty and De

Re: [v8-users] Thread cleanup

2015-10-19 Thread Alex Kodat
at means I don't intend to think through the implications > and/or refactorings that may or may not be necessary or desirable. When in > doubt, I'd prefer to keep everything as it is. > > On Mon, Oct 19, 2015 at 7:56 AM, Alex Kodat <alex...@gmail.com > > wrote: > >

Re: [v8-users] Thread cleanup

2015-10-18 Thread Alex Kodat
AM UTC-7, Alex Kodat wrote: > > Jakob, > > Thanks for that. I might just take a swing at an unintrusive patch. Along > those lines it seems that thread resource cleanup would be closely tied to > the Locker as one would need the isolate lock while freeing > PerIsolateThreadD

[v8-users] Thread cleanup

2015-10-18 Thread Alex Kodat
If I have an app that steadily creates and joins threads, is there a good way of cleaning up the thread-specific data when a thread terminates? Looking at the v8 code, it seems that ThreadManager::FreeThreadResources in v8threads.cc would be a place this might happen when called from the Locker

Re: [v8-users] Thread cleanup

2015-10-18 Thread Alex Kodat
On Sunday, October 18, 2015 at 4:07:07 AM UTC-7, Jakob Kummerow wrote: > > On Sun, Oct 18, 2015 at 8:16 AM, Alex Kodat <alex...@gmail.com > > wrote: > >> If I have an app that steadily creates and joins threads, is there a good >> way of cleaning up the thread-specific