Re: [v8-dev] How to get current release version now that OmahaProxy is down

2023-12-11 Thread Leszek Swirski
You can pipe the chromium version to fetch_version to get the v8_version, e.g. curl "https://chromiumdash.appspot.com/fetch_version?version=$(curl ' https://chromiumdash.appspot.com/fetch_releases?platform=Win32&channel=beta' | jq -r '.[0].version')" | jq -r .v8_version On Tue, Dec 5, 2023 at 7:5

Re: [v8-dev] Failure when building on mac

2023-12-13 Thread Leszek Swirski
This looks like a C++20 build using a non C++20 standard lib. Adding Helmut who landed the change (https://crrev.com/c/5079350) -- if it's causing issues it's an easy revert. On Wed, Dec 13, 2023 at 9:31 AM Meir Shpilraien wrote: > Hey > > Yesterday we started to see failure on our mac build on

Re: [v8-dev] Torque: Aligning Members

2024-01-24 Thread Leszek Swirski
Hi, No, the V8 heap allocation doesn't currently support custom alignment. Are you seeing these be in different cache lines a lot? I could imagine that being a problem for a lot of objects if it's a performance issue. - Leszek On Wed, Jan 24, 2024 at 6:22 PM 'Martin Schwarzl' via v8-dev < v8-dev

Re: [v8-dev] Torque: Aligning Members

2024-01-25 Thread Leszek Swirski
+Samuel There's not really any fully supported mechanism for this at all at the moment; there's some logic for alignment of HeapNumbers so that their double values stay aligned, so you can look for "AllocationAlignment" in the heap directory (and the HeapObject::RequiredAlignment method), but at t

[v8-dev] Fwd: Design doc: template magic for FixedArray C++ layout

2024-02-21 Thread Leszek Swirski
Hi all, As part of the C++ object layout work, I want to refactor (again) how FixedArrays are implemented. PTAL at the design: https://docs.google.com/document/d/1mooqCy71hq4Zk99-PYKkirCw82qJTGgN9ZUxu_t9urw/edit?usp=sharing - Leszek -- -- v8-dev mailing list v8-dev@googlegroups.com http://grou

Re: [v8-dev] v8::Date C++ API additions

2024-02-26 Thread Leszek Swirski
Hi James, Thanks for asking, this seems like a reasonable set of APIs to add, I'll happily review a patch. - Leszek On Sat, Feb 24, 2024 at 8:30 PM 'James Snell' via v8-dev < v8-dev@googlegroups.com> wrote: > Hello all :-) > > Before going through and doing the work, I wanted to ask if the proj

Re: [v8-dev] Is there a way to quickly tell what flags are enabled right now?

2024-03-04 Thread Leszek Swirski
Hi, There's --print-flag-values which prints all flags to stdout. - Leszek On Mon, Mar 4, 2024 at 4:23 AM Wx Gopher wrote: > Hi, > > We wonder if there is a way to tell which flags are enabled for now? > > Thanks > > > -- > -- > v8-dev mailing list > v8-dev@googlegroups.com > http://groups.goo

Re: [v8-dev] Trying to track down error in source location reporting

2024-04-11 Thread Leszek Swirski
Source positions for unoptimized JavaScript are computed lazily, by the Compiler::CollectSourcePositions function , which is called by SharedFunctionInfo::EnsureS

Re: [v8-dev] Snapshot questions

2024-06-03 Thread Leszek Swirski
Hi Ronald, Can you clarify what you're trying to do, with the full example code or a link to a patch? The error you're getting is to do with active global handles, so the cause for the error really depends on what the rest of your code is doing. - Leszek On Sat, Jun 1, 2024 at 6:43 AM 'Ronald Fe

Re: [v8-dev] How to distinguish v8 target arch in torque builtins?

2024-08-07 Thread Leszek Swirski
Why is this different on LoongArch64 to other platforms anyway? Could we sign extend this on all platforms rather than conditionally? cc @Andreas Haas On Wed, Aug 7, 2024 at 11:00 AM 'Nico Hartmann' via v8-dev < v8-dev@googlegroups.com> wrote: > I would give this "condition" a name > `@if(NEEDS_

Re: [v8-dev] Identifying blocks of dead-code elimination

2024-09-09 Thread Leszek Swirski
Hi Rafael, It's not easy to analyze optimizations with turbolizer, it's intended more as a compiler developer tool than an end-user tool. Even if you did, you might be disappointed if the current benchmark is fine and nothing is eliminated right now, but a future iteration of Turbofan/shaft ends u

Re: [v8-dev] Identifying blocks of dead-code elimination

2024-09-09 Thread Leszek Swirski
On Mon, Sep 9, 2024 at 1:57 PM Rafael Gonzaga wrote: > We have previously considered using %DoNotOptimize or even > %OptimizeOnNextCall (to ensure a proper warmup). But, we concluded that it > won't be realistic as some modules might be very well optimized and some of > them will be full of deopt

Re: [v8-dev] Identifying blocks of dead-code elimination

2024-09-15 Thread Leszek Swirski
Hi Rafael, %GetOptimizationStatus(fn) returns the optimization status of `fn` as a non-inlined function; a function can conceptually be in multiple optimization states (e.g. you might still have an interpreted version on the stack, an optimized version elsewhere, multiple inlined version into othe

Re: [v8-dev] TemplateHashMap changes proposal

2016-09-15 Thread Leszek Swirski
Good question, and one I tried at first. Unfortunately, std::unordered_map<> has some disadvantages, namely re-hashing my hashes (which I profiled and it had a noticeable performance penalty), no support (that I could find) for a LookupOrInsert of a non-default value, and prime-number bin counts ra

Re: [v8-dev] TemplateHashMap changes proposal

2016-09-15 Thread Leszek Swirski
I've definitely seen cases of the hash function being passed in as key->hash(). If that's the case, then the templated hash function could, for example, look up the hash on the key object. On Thu, Sep 15, 2016 at 9:43 AM, 'Ross McIlroy' via v8-dev < v8-dev@googlegroups.com> wrote: > On 15 Sep 201

Re: [v8-dev] Javascript AOT compiler for V8 with Ignition

2017-03-13 Thread Leszek Swirski
Hi Dmitry, We've thought about this in the past, but unfortunately it's not that easy. The biggest problem is that parsing isn't just lexing tokens or building an AST - a significant cost is in things like scope resolution and similar complex language features, which we'd still have to either calc

[v8-dev] Re: Suggested usage of --trace-ignition?

2017-05-15 Thread Leszek Swirski
Ah yeah, I have a patch pending for that which optionally includes the code in builds, but still gates the printing behind a flag. I'll upload it tomorrow. On Mon, 15 May 2017, 21:51 Adam Klein, wrote: > As I've been doing some work on Ignition, I've found tracing to be very > useful. However, t

Re: [v8-dev] Re: internal::Register vs interpreter::Register

2017-08-31 Thread Leszek Swirski
On 08/31/2017 12:49 AM, Jakob Kummerow wrote: > the "Jumbo" build (multiple .cc files per compilation unit, saving lots of > >> compile time) is running into the issue of name clashing between > >> v8::internal::Register and v8::internal::interpreter::Register. We have a > few options: Normally

Re: [v8-dev] Re: internal::Register vs interpreter::Register

2017-08-31 Thread Leszek Swirski
On Thu, Aug 31, 2017 at 11:54 AM, wrote: > Here's an example of where I think jumbo builds could possibly introduce > ambiguity in type resolution, even if all code is inside namespace blocks: > > Let's say a source file has some code in the v8::internal::intepreter > namespace which refers to "R

Re: [v8-dev] Re: internal::Register vs interpreter::Register

2017-09-01 Thread Leszek Swirski
d it > either way.) > > On Thu, Aug 31, 2017 at 4:03 AM, Leszek Swirski > wrote: > >> On Thu, Aug 31, 2017 at 11:54 AM, wrote: >> >>> Here's an example of where I think jumbo builds could possibly introduce >>> ambiguity in type resolution, even

Re: [v8-dev] Re: Any reason MaybeLocal doesn't have behavior similar to std::optional - operator bool/*/->

2018-03-06 Thread Leszek Swirski
I think the expected pattern is more along the lines of: > > Local<...> result; > if (v8::JSON::Parse(...).ToLocal(&result)) { > result->Set(...); > } Would that be succinct enough for you, or is it the lack of type deduction of result that is the problem? That could be avoided with some mac

Re: [v8-dev] Re: Any reason MaybeLocal doesn't have behavior similar to std::optional - operator bool/*/->

2018-03-06 Thread Leszek Swirski
t least get that I'll probably just maintain a patched version of v8.h for > my own use and that's just annoying and makes it so I can't share any of > that code with anyone else. > > > --Zac > > > > > > On Tue, Mar 6, 2018 at 2:08

Re: [v8-dev] Trying to compile V8 samples/hello-world.cc on ubuntu

2018-06-03 Thread Leszek Swirski
Hi, You're missing an 'e' in "out.gn/x64.releas/libv8_libplatform.so", it should be "out.gn/x64.release/libv8_libplatform.so" - Leszek On Sun, 3 Jun 2018, 10:23 , wrote: > Trying to compile V8 samples/hello-world.cc on ubuntu with following > command: > > g++ -I. -Iinclude samples/hello-world.

Re: [v8-dev] Interpreter-only execution of Ignition bytecode

2018-07-03 Thread Leszek Swirski
Hi Andrey, --no-opt is what you're looking for (a JS flag, so passed by --js-flags in Chrome). Cheers, Leszek On Tue, Jul 3, 2018 at 5:18 PM Andrey Logvinov wrote: > Is there a way (perhaps using --js-flags) to force interpreter-only > execution of Ignition bytecode, i.e. without ever attempti

Re: [v8-dev] Interpreter-only execution of Ignition bytecode

2018-07-04 Thread Leszek Swirski
at is the difference between using --no-opt and > --minimal (the latter implies --no-opt and --no-use-ic)? Isn't inline > caching incompatible with interpreter execution anyway? > > On Tuesday, July 3, 2018 at 7:22:03 PM UTC+3, Leszek Swirski wrote: >> >> Hi Andrey, >

Re: [v8-dev] Compiled cached data functionality got broken between v8 v6.3 and v6.6

2018-07-04 Thread Leszek Swirski
The same traversal of compiled structures happened in the old system too (since the snapshot has to contain a transitive closure of all objects that the compilation creates, which is more than you might think), it was just hidden from the API. If you were to call Serialize immediately after Compile

Re: [v8-dev] Build v8

2018-08-21 Thread Leszek Swirski
Hi dan, Glad to hear things are working for you. The functions you're looking at are intrinsic/runtime functions, and that syntax is the "natives" syntax, enabled for user code with the "--allow-natives-syntax" flag. Some people have used this in the past to e.g. track optimisation behaviour, like

Re: [v8-dev] Small CL that seems to have been forgotten

2018-10-22 Thread Leszek Swirski
We don't check this on dry-run, afaik, so that dry runs don't fail during the review process (and reviewers can easily see if tests pass). On Mon, Oct 22, 2018 at 11:39 AM Sergiy Byelozyorov wrote: > The presubmit has also failed since an owner of the V8 root directory > needs to LGTM your CL. O

Re: [v8-dev] Re: I think the method SharedFunctionInfo::Name() does not neccessary calling the SharedFunctionInfo::HasSharedName().

2018-11-26 Thread Leszek Swirski
That's a reasonable point, but SFI::HasSharedName also checks for the kNoSharedNameSentinel, which ScopeInfo::HasFunctionName does not. There is a ScopeInfo::HasSharedFunctionName, but that one in turn does not first check for ScopeInfo::HasFunctionName(). Possibly we could add ScopeInfo::HasFuncti

Re: [v8-dev] Re: I think the method SharedFunctionInfo::Name() does not neccessary calling the SharedFunctionInfo::HasSharedName().

2018-11-26 Thread Leszek Swirski
You'd have to check HasFunctionName first, but otherwise yes, I believe this has the same semantics. On Mon, Nov 26, 2018 at 4:16 PM 박한범 wrote: > hello, Leszek Swirski! thanks for answer. > I want to record the name of the function being called through > v8::internal::Executio

Re: [v8-dev] Visualize Abstract Syntax Tree.

2019-01-21 Thread Leszek Swirski
For going through the implementation, you'll mostly be interested in src/ast and src/parsing. In particular: src/ast/ast.h : the AST node classes and the AstNodeFactory which creates them src/parsing/parser-base.h : defines the parts of the parser that are shared between the parser and the pre-par

Re: [v8-dev] Put hooks in operators

2019-03-04 Thread Leszek Swirski
--force-slow-path is a bit confusing, and maybe not well named, I believe it only affects some builtins (regex etc.) For some more detail, a lot of functionality in V8 is implemented multiple times -- common, simpler fast paths (e.g. comparing numbers as you are) are implemented in "assembly" (whi

Re: [v8-dev] Put hooks in operators

2019-03-04 Thread Leszek Swirski
at excecution. What is > the best way to do that ? > > Le lundi 4 mars 2019 13:15:53 UTC+1, Leszek Swirski a écrit : >> >> --force-slow-path is a bit confusing, and maybe not well named, I believe >> it only affects some builtins (regex etc.) >> >> For some mor

Re: [v8-dev] Put hooks in operators

2019-03-04 Thread Leszek Swirski
using CallRuntime (look for CallRuntime(Runtime::kBigIntEqualToNumber,...) as an example RuntimeCall). On Mon, Mar 4, 2019 at 5:41 PM wrote: > I can see bytecode, but i need to see values... > > Le lundi 4 mars 2019 17:21:38 UTC+1, Leszek Swirski a écrit : >> >> That's a

Re: [v8-dev] Determining id of top level / originating script, from JSFunction

2019-05-06 Thread Leszek Swirski
`Script::cast(function->shared()->script()).id()` is your best bet for a straight-up unique ID for a script -- otherwise, you probably want to look at some combination of `String::cast(Script::cast(function->shared()->script()).source())` and line/column offset. On Sun, Apr 28, 2019 at 4:52 PM psn

Re: [v8-dev] Determining id of top level / originating script, from JSFunction

2019-05-06 Thread Leszek Swirski
Function literals won't have a different script id, but `eval` will. This is considered to be a different "script" from a JavaScript semantics point of view, though not necessarily a different "

Re: [v8-dev] Improve performance on JetStream 2

2019-07-16 Thread Leszek Swirski
That's a great investigation, thanks! We can't really fix the benchmark, changing benchmarks invalidates historical data and confuses cross browser comparisons, so we've had to live with more than a few benchmark bugs. However, the closed-over constructor observation is particularly interesting to

Re: [v8-dev] Re: float number accuracy

2019-09-24 Thread Leszek Swirski
e 26, 2019 at 3:50:56 PM UTC+8, Jerry Jin wrote: >> >> thank you, i'll come back later with sample code >> >> On Wednesday, June 26, 2019 at 1:56:34 PM UTC+8, Leszek Swirski wrote: >>> >>> To be clear: both C++ and JS use the exact same "double&q

Re: [v8-dev] Re: Why parseInt("1234fg",16) returns 74575 instead of NaN?

2019-11-06 Thread Leszek Swirski
parseInt is one of the oldest parts of JavaScript, so it's likely that this is because it is (a generalisation of) the same behaviour as atoi in the C standard library, which I guess means you'd have to ask Ken Thompson. My guess would be because it made it possible to parse an integer out of a lon

Re: [v8-dev] idea: polymorphic IC budget theft

2019-12-18 Thread Leszek Swirski
Hi Seth, Thanks for the doc and the in-depth analysis. I think the approach you're proposing is a clever low-memory-cost extension of the current IC mechanism, but I'm not sure it's more than a patch over a system that needs to be more fundamentally re-thought for things like constructors and a ge

Re: [v8-dev] Stable vs Unstable maps

2019-12-30 Thread Leszek Swirski
Hi, A stable map is one from which a transition has never been observed, i.e. it's the leaf of the transition tree and objects with that map can be assumed to be "stable". Perhaps "is_leaf" or "never_transitioned_away_from" could be alternative names but it's a subtle concept to name and naming is

Re: [v8-dev] Stable vs Unstable maps

2020-01-02 Thread Leszek Swirski
ul property especially for optimized code. To be able >>> to exploit this in optimized code, transitioning from a previously stable >>> map will invalidate and deoptimize all optimized code that made use of the >>> map being stable up to this point. >>> >>>

Re: [v8-dev] Stable vs Unstable maps

2020-01-03 Thread Leszek Swirski
ann >>> >>> On Tuesday, December 31, 2019 at 12:46:17 PM UTC-6, Tobias Tebbi wrote: >>>> >>>> As long as a map is stable, no object with this map has changed map, >>>> which is a very useful property especially for optimized code. To b

Re: [v8-dev] IsUndefined and IsNull segfault when compiled without V8_ENABLE_CHECKS

2020-01-06 Thread Leszek Swirski
Interesting, thanks for the report, sorry for not replying earlier but you know, Christmas and all that :). Could you please create a bug on crbug.com/v8 and assign it to ish...@chromium.org (and cc me)? +Igor Sheludko , could this be pointer compression root inference? We might have to copy & pas

Re: [v8-dev] Re: Initiaze v8 engine without built-in functionality .

2020-01-31 Thread Leszek Swirski
If all you want is binary operations and comparisons on numbers and strings, then it could be a fun (and educational!) weekend project to write an infix expression evaluator and drop the V8 dependency entirely. That might be easier than trying to bend a JS engine into evaluating only such a tiny su

Re: [v8-dev] Pointer compression seemingly responsible for large memory leak

2020-02-14 Thread Leszek Swirski
That sounds like a build config mismatch, or something similar -- 31-bit Smis shouldn't cause major breakage, but will if e.g. one header has the build flag enabled and another doesn't. On Fri, Feb 14, 2020 at 3:43 PM wrote: > Sorry, here's a clarification. This is what we're seeing with 8.0: >

Re: [v8-dev] AST -> bytecode -> opcode question

2020-02-17 Thread Leszek Swirski
On Mon, Feb 17, 2020 at 5:46 AM yoshi chen wrote: > I have some confusion around *LdaHole*, and its usage. > Holes are used, in this example, to initialise a lexical variable (i.e. let or const) during its "temporal dead zone", a.k.a "TDZ", which is the time between function entry and the actual

Re: [v8-dev] Where To Suggest BigInt Optimizations

2020-02-24 Thread Leszek Swirski
Hi Jack, First of all, I wanted to make sure that you know that no one thinks of you as "an unthinking ignoramus", nor have you built a negative image. Many of the ideas you're proposing here have also been suggested both internally and externally during the BigInt design and implementation proces

Re: [v8-dev] Splitting ParseInfo

2020-03-06 Thread Leszek Swirski
Hey all, here's a small cleanup proposal based on recent increased off-thread work. Naming is hard so bikeshedding is welcome. On Fri, Mar 6, 2020 at 10:24 AM 'Leszek Swirski (via Google Docs)' via v8-dev wrote: > lesz...@chromium.org has shared a link to the following doc

Re: [v8-dev] Running (ninja -C out.gn/x64.release ) but its not working

2020-03-20 Thread Leszek Swirski
Sounds like you didn't run gn? On Fri, Mar 20, 2020 at 2:36 PM wrote: > I want to build V8 but nothing seem to work..(Please note i'm new to this, > i'm only a full stack developer, no experience with embedding V8 whatsoever) > > COMMAND LINE OUTPUT:- > ninja: error: loading 'build.ninja': The s

Re: [v8-dev] github org repo for vim-torque

2020-05-26 Thread Leszek Swirski
FWIW, I believe vim-plug lets you specify a subdirectory with 'rtp', so something like this might work: Plug 'v8/v8', { 'rtp': '/tools/torque/vim-torque' } On Tue, May 26, 2020 at 3:05 PM Tobias Tebbi wrote: > I looked into it and it's a lot of bureaucracy to get a new repo approved. > Given t

[v8-dev] Fwd: C++ styleguide updated: mutable references and more

2020-06-02 Thread Leszek Swirski
FYI, there have been some Chromium C++ style changes, which are changes V8 also implicitly inherits. -- Forwarded message - From: 'Peter Kasting' via blink-dev Date: Wed, 3 Jun 2020, 00:19 Subject: [blink-dev] C++ styleguide updated: mutable references and more To: Chromium-dev ,

Re: [v8-dev] Cannot call TypeOf on a Value

2020-06-04 Thread Leszek Swirski
Glad to hear you found your mistake; for anyone else having a similar problem and finding this through a search or whatever: they were probably using . instead of -> Specifically, for v8::Local foo, one has to do foo->TypeOf() to access v8::Value::TypeOf, otherwise it's trying to access v8::Local:

Re: [v8-dev] https://v8.dev/blog/fast-properties - How i get them ?

2020-06-30 Thread Leszek Swirski
You want Object.keys to get the actual keys, or Object.entries for key/value pairs. On Tue, Jun 30, 2020

Re: [v8-dev] How i get them : https://v8.dev/blog/fast-properties

2020-07-02 Thread Leszek Swirski
You can access your K object via the context's global object , and then iterate it's properties from there. On Thu, Jul 2, 2020 at 1:47 PM wrote: > i"m trying to get the variable from context / global withou

Re: [v8-dev] How i get them : https://v8.dev/blog/fast-properties

2020-07-02 Thread Leszek Swirski
them are mine > > 3) Local key =obj->Get(m_Context, > v8::String::NewFromUtf8(m_Isolate, "AA")).ToLocalChecked(); > // i got undefined > > Thanks a lot for all your help > Oren > > On Thursday, July 2, 2020 at 2:57:35 PM UTC+3, Leszek Swirski wrote: >> >>

Re: [v8-dev] How i get them : https://v8.dev/blog/fast-properties

2020-07-06 Thread Leszek Swirski
Ah, I didn't pay attention to the "const" there. Yes, those are in the "script context" rather than the global context. Easiest way to get it is probably just to evaluate the string "K" and read the result. Something like: Local K_source = v8::String::NewFromUtf8(isolate, "K"); Local K_script = v

Re: [v8-dev] Use RegExp outside of an Isolate?

2020-08-04 Thread Leszek Swirski
No, you can only access an Isolate (including Contexts in that Isolate) from a single thread. On Tue, Aug 4, 2020 at 5:08 PM Paul Maréchal wrote: > I do have another question before creating another Isolate: Would creating > a new Context (from the main Node Isolate) be suited to work in a threa

Re: [v8-dev] Desire to contribute

2020-08-17 Thread Leszek Swirski
+Jakob Kummerow , who has some work on BigInt. On Sun, Aug 16, 2020 at 11:37 PM wrote: > Hi all, > > On the v8.dev website, it says to come here for guidance on how to > contribute to V8. I'm particularly interested in optimizing the BigInt > routines, since they currently seem to just use the n

Re: [v8-dev] Turning off bytecode caching in service worker cache

2020-09-30 Thread Leszek Swirski
Hi Vittal, This is more a chromium than a V8 question (V8 caches whatever you tell it to via the API). In chromium, I don't believe there's a flag for setting the service worker behaviour specifically, but there is a flag for disabling code caching entirely: --v8-cache-options=none Otherwise, you

Re: [v8-dev] grab source text in parser

2020-10-05 Thread Leszek Swirski
We don't have an API like that in the scanner/parser, for two reasons: a) Chunking -- data comes to the scanner in chunks (e.g. for streaming), and we do very little rewinding when parsing, so we want to be able to discard chunks once they're no longer needed. b) Escaping -- you can have unicode e

Re: [v8-dev] grab source text in parser

2020-10-05 Thread Leszek Swirski
Our current streaming API + off-thread finalization makes that a bit tricky, we don't necessarily have the source text when the constant pool is being filled in. Could you store the positions as raw values in the constant pool (or as a tuple or whatever) and generate the substring at runtime? Do yo

Re: [v8-dev] Re: Breakpoints trigger repeated full-parse of the debugged script

2020-10-06 Thread Leszek Swirski
This might be lazy source positions forcing a reparse, have you tried running with --no-enable-lazy-source-positions? On Tue, Oct 6, 2020 at 3:23 AM Gunes Acar wrote: > The missing screenshot of the trace can be seen at: Github: > https://gist.github.com/gunesacar/b8f82266e93fbfda2bf06c573af3cae

[v8-dev] Abseil in V8

2020-10-13 Thread Leszek Swirski
Hi all, I'm planning on adding Abseil as a dependency in V8, to get rid of some of our hand-rolled base classes and (hopefully) reap the advantages of those engineers' work. An example use would be changing our hand-rolled hashmap to a thin wrapper over absl::flat_hash_map/set: https://chromium-re

Re: [v8-dev] Abseil in V8

2020-10-13 Thread Leszek Swirski
+Victor, do you know whom to communicate this to? On Wed, 14 Oct 2020, 08:49 Yang Guo, wrote: > You might want to give a heads up to Node.js folks. I don't think they > would object, but it would be a courtesy to them. > > Cheers, > > Yang > > On Wed, Oct 14, 2

Re: [v8-dev] Abseil in V8

2020-10-14 Thread Leszek Swirski
g the possibility of changing Node > build system to a CMake/GN hybrid ( > https://github.com/nodejs/TSC/issues/901). > > On Wed, Oct 14, 2020 at 8:52 AM Leszek Swirski > wrote: > >> +Victor, do you know whom to communicate this to? >> >> On Wed, 14 Oct 2020, 08:49

Re: [v8-dev] Abseil in V8

2020-10-16 Thread Leszek Swirski
7;d be ideal, both for code size > reasons and for uniformity across CL authors & reviewers if there was some > agreed-upon end state, at least. Ideally there'd even be a staffed, > prioritized effort to get us from the current state to some future state. > > - Adam >

Re: [v8-dev] Abseil in V8

2020-10-16 Thread Leszek Swirski
CCed the relevant folks on this thread. > > - Adam > > > On Fri, Oct 16, 2020 at 10:56 AM Leszek Swirski > wrote: > >> I saw this effectively as a cleanup project, with as much >> staffing/prioritisation as, say, TNodification. If you have spare headcount >&g

Re: [v8-dev] Abseil in V8

2020-10-18 Thread Leszek Swirski
On Mon, Oct 19, 2020 at 8:01 AM Michael Lippautz wrote: > One caveat: Presumably, this will stay in an internal dependency, so API > types will have to go through std equivalents which sometimes means that > some internal types would not move to absl to avoid conversion. (I still > think this all

Re: [v8-dev] what's differences, "d8 in v8" vs "nodejs"?

2020-11-13 Thread Leszek Swirski
Hi, You can think of V8 as a library used for compiling and running Javascript. Chrome/Chromium, d8 and Node.js are all "embedders" of V8, i.e. applications that use this library. d8 is a very simple, minimal wrapper around the library that we use primarily for debugging, testing, and as a "demo"

Re: [v8-dev] what's differences, "d8 in v8" vs "nodejs"?

2020-11-13 Thread Leszek Swirski
Simply put, because Node.js is huge and does a _lot_ more than just running Javascript. d8 is very much just a simple internal debugging tool, and we want it to stay that way -- otherwise it'll be hard to tell if the issue we're seeing is in "d8 Node" or in V8, and it'll be harder to add support fo

Re: [v8-dev] what's differences, "d8 in v8" vs "nodejs"?

2020-11-13 Thread Leszek Swirski
On Fri, Nov 13, 2020 at 10:21 AM Leszek Swirski wrote: > Simply put, because Node.js is huge and does a _lot_ more than just > running Javascript. d8 is very much just a simple internal debugging tool, > and we want it to stay that way -- otherwise it'll be hard to tell if the >

Re: [v8-dev] what's differences, "d8 in v8" vs "nodejs"?

2020-11-13 Thread Leszek Swirski
build d8 into an npm-compatible node competitor, but then >> that's really just xkcd:927 <https://xkcd.com/927/>. >> >> - Leszek >> >> On Fri, Nov 13, 2020 at 10:21 AM Leszek Swirski >> wrote: >> >>> Simply put, because Node.js is huge and doe

Re: [v8-dev] Weird Crash Occur When Using Snapshot With CodeCache

2020-11-23 Thread Leszek Swirski
The snapshot contains "root" objects that are the same for every V8 instance - the code cache knows these are roots, so it doesn't serialise them because it assumes they'll be available on deserialisation. On Tue, 24 Nov 2020, 03:46 王梓童, wrote: > > Thanks for your reply. Could you explain what c

Re: [v8-dev] Re: Weird Crash Occur When Using Snapshot With CodeCache

2020-11-25 Thread Leszek Swirski
Sure, please feel free to post more questions to this mailing list. On Wed, Nov 25, 2020 at 6:25 AM 王梓童 wrote: > Thanks a lot! There is no crash after modifying the code. Can I add a > friend with you for further discussion about V8? > > 在2020年11月24日星期二 UTC+8 下午11:03:54 写道: > >> Got the same pro

Re: [v8-dev] Constness behavior of Handle vs. Object

2021-04-14 Thread Leszek Swirski
I would imagine this would be solvable by providing different overloads for const and non-const operator-> (and operator*) in Handle. On Wed, Apr 14, 2021 at 11:51 AM 'Jakob Gruber' via v8-dev < v8-dev@googlegroups.com> wrote: > Hi team, > > I came across this yesterday and found the behavior sur

[v8-dev] [Design] Merging bytecodes for switching and resuming generators

2021-05-05 Thread Leszek Swirski
Hi all, We currently generate quite a bit of bytecode boilerplate for generators (incl. async functions). I think we could avoid most of this boilerplate by packing a bunch more complexity into a single SwitchAndResume bytecode. PTAL at this half (maybe 75%) thought-through design: https://docs.g

Re: [v8-dev] Switch statement range checking

2021-05-14 Thread Leszek Swirski
You could save a register and a TestEqual if you did two jumps (one for x=b) but otherwise there's not much you can do for a range check. Keep in mind though that SwitchOnSmi does a range check itself (and falls through on failure), so unless you want to exclude a range that's inside your Switch ra

Re: [v8-dev] Switch statement range checking

2021-05-17 Thread Leszek Swirski
I actually meant implementing a Smi check in the bytecode handler itself, in interpreter-generator.cc , not as additional bytecodes. On Mon, May

Re: [v8-dev] Questions about torque language

2021-05-27 Thread Leszek Swirski
Hi Vini, I'm not sure I understand your question fully, but: 1. You can probably remove CreateHTML entirely with your usecase, and just do the appropriate ANSI code printing in the individual functions, e.g. transitioning javascript builtin StringPrototypeBold( js-i

Re: [v8-dev] Is ArrayTimSortDescriptor constructor used?

2021-06-07 Thread Leszek Swirski
Additionally to what Ross said, interface descriptors recently went through a big refactoring ( https://chromium-review.googlesource.com/c/v8/v8/+/2831872) that devirtualized the CallInterfaceDescriptor base class; and, among other things, removed the v8::internal::TorqueInterfaceDescriptor class,

Re: [v8-dev] Switch statement range checking

2021-06-24 Thread Leszek Swirski
Hi Mihir, Thanks for your contribution! I think you have two good options for followups: a) Port your switch statement prologue from being in bytecodes to being in Sparkplug and TurboFan (effectively, the first version we almost submitted, except working well with the other compilers). b) As

Re: [v8-dev] Switch statement range checking

2021-07-05 Thread Leszek Swirski
(v8-dev to bcc) I replied on the bug, basically I imagine that Switch nodes aren't well supported by the optimizer -- either because of node traversal costs, or because of optimization passes being designed only for Branch. On Wed, Jun 30, 2021 at 5:30 PM Mihir Shah wrote: > Hi, sorry to bug yo

Re: [v8-dev] Switch statement range checking

2021-07-07 Thread Leszek Swirski
v8-dev to bcc It's easier to discuss this further in the doc, but basically in CSA code you can mark a rarely-taken label as "deferred" to move that chunk of code to the end of the generated code. This makes the fast-path of not taking the label faster. On Wed, Jul 7, 2021 at 4:43 PM Mihir Shah

Re: [v8-dev] Switch statement range checking

2021-07-09 Thread Leszek Swirski
There's almost certainly cases in the runtime where we don't normalize a HeapNumber to a Smi -- my comment on floats representable as Smis being normalized to Smis was only for the numbers generated by the parser. On Thu, Jul 8, 2021 at 9:20 PM Mihir Shah wrote: > Hi, > > Also I had another ques

Re: [v8-dev] Switch statement range checking

2021-07-19 Thread Leszek Swirski
Correct, x86, x64, arm and arm64 are all you need to do. On Mon, Jul 19, 2021 at 6:40 AM Mihir Shah wrote: > Hi, > > Just to update, so I implemented the sparkplug code for the x86/arm > machines for 32-bit and 64-bit; I wasn't sure did I need to support MIPS or > any of the other architectures,

Re: [v8-dev] Switch statement range checking

2021-07-20 Thread Leszek Swirski
Turbofan guards against the input value not being a Smi (with CheckSmi). The float conversions that you're seeing are to check if the result of i%7 is representable as Smi, and if not, it deopts (the HeapNumber that would normally be created there is elided, since it doesn't escape the function, th

Re: [v8-dev] Switch statement range checking

2021-07-22 Thread Leszek Swirski
bcc v8-dev, and cc mvstanton@ and neis@ Mike, Georg, can you help Mihir with this? The TL;DR is that he wants to make the SwitchOnSmi bytecode take arbitrary values, not just Smis, where the switch wants to have === behaviour for cases, i.e. fallthrough on non-numbers, and convert HeapNumbers to i

Re: [v8-dev] Re: Avoiding windows.h

2021-07-22 Thread Leszek Swirski
Hi Bruce, Thanks for looking into this, I'd be happy to do code reviews and give advice if you're ok with the EMEA timezone delay - otherwise we've a couple of people in PST too. One question about the proxy types: are we at risk of triggering undefined behaviour by reinterpret casting between th

Re: [v8-dev] Re: Avoiding windows.h

2021-07-23 Thread Leszek Swirski
what the UBSan bots think of it. > Is the regular dry run sufficient? > > On Thu, Jul 22, 2021 at 11:55 AM Leszek Swirski > wrote: > >> Hi Bruce, >> >> Thanks for looking into this, I'd be happy to do code reviews and give >> advice if you're

Re: [v8-dev] Re: Avoiding windows.h

2021-07-23 Thread Leszek Swirski
Or by using std::aligned_storage <https://en.cppreference.com/w/cpp/types/aligned_storage> + some static asserts that sizes match, if we need to actually allocate storage for these types... On Fri, Jul 23, 2021 at 4:40 PM Leszek Swirski wrote: > I don't suppose we could just type

Re: [v8-dev] Switch statement range checking

2021-08-05 Thread Leszek Swirski
This diagram definitely looks like a plausible solution, if those lower-level F2I/I2F nodes are available to you at that point (I think they might be?) -- TF has some amount of restrictions on what "level" of node is available at what stage of the pipeline. As for documentation, we're not in a fan

Re: [v8-dev] Switch statement range checking

2021-08-10 Thread Leszek Swirski
v8-dev to bcc again, please feel free to just email me directly about this rather than messaging the entire mailing list. A new simplified opcode sounds reasonable I think, I'm reasonably sure that creating a node with two outputs is not much more complex than specifying in the opcode constructor

Re: [v8-dev] Utility to check if a given stream can parse as Javascript (ORB)

2021-08-12 Thread Leszek Swirski
> On Thu, Aug 12, 2021 at 9:31 AM 'Hannes Payer' via v8-dev < > v8-dev@googlegroups.com> wrote: > >> Hi Lukasz, >> >> To understand your question correctly: You want an API which returns true >> if the JavaScript input is valid, right? >> >>

Re: [v8-dev] About cpu profiler DCHECK failed.

2021-08-25 Thread Leszek Swirski
Could we flip the order of operations here (first write the values into the red zone, and only then change the stack pointer) to make the push pseudo-atomic? On Wed, Aug 25, 2021 at 12:58 PM Yahan Lu wrote: > Hi all~ > Cpu profiler could excute GetStackSample and run stack StackFrameIterator. >

Re: [v8-dev] Re: About cpu profiler DCHECK failed.

2021-08-25 Thread Leszek Swirski
> > But the new Push does not conform to the assembly manual. > Is this an issue? It feels like a very pragmatic solution. -- -- v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-

Re: [v8-dev] About cpu profiler DCHECK failed.

2021-08-25 Thread Leszek Swirski
That's also a reasonable option, thanks for pointing that out On Wed, Aug 25, 2021 at 2:27 PM Jiivy Qiu wrote: > AFAIK, not only RISC-V has the red zone problem (mean in the prologue > "first reduce sp then store register to stack"), MIPS/MIPS64/PPC/S390/LOONG > as well as ARM64 all have the sam

Re: [v8-dev] Re: Metric for time spent in v8?

2022-01-07 Thread Leszek Swirski
+Camillo Bruni We have a V8.ExecuteMicroSeconds histogram which is enabled for 50% of canary and dev (via the V8SlowHistograms feature flag). Maybe you could somehow in

Re: [v8-dev] V8 typeof(Function(str)) is undefined

2022-01-13 Thread Leszek Swirski
I've tried to reproduce your issue using d8 Realms, but don't see the same error: $ cat /tmp/realmstest.js function testFunction(){ let tmpFunc = Function("(function test(\n) {\nreturn 7;\n})\n"); console.log(typeof tmpFunc); } testFunction(); let realm = Realm.createAllowCrossRealmAccess();

Re: [v8-dev] Would it be possible to have v8 for armv6z -> RaspberryPi 0[W]

2022-02-10 Thread Leszek Swirski
Does the unofficial prebuilt node (e.g. https://unofficial-builds.nodejs.org/download/release/v17.4.0/node-v17.4.0-linux-armv6l.tar.gz) not work? On Thu, Feb 10, 2022 at 3:30 PM Gérard Vidal wrote: > Again thanks for your answer and your time but sadly I am giving up > without succeeding. My onl

  1   2   >