We don't really have a policy for the builtins, it's good judgement whether
to use C++ or CSA. I'd say Object.prototype.valueOf is a good starting
point. It can be migrated to a TF_BUILTIN, based on the CodeStubAssembler.
The builtin (with JavaScript linkage) would basically become a wrapper for
the ToObject builtin (which has internal stub linkage). I don't think you
need to touch src/runtime or src/debug for this.

HTH,
Benedikt


Benedikt Meurer |  Software Engineer, V8 |  Google Germany GmbH |
Erika-Mann-Str.
33, 80636 München

Registergericht und -nummer: Hamburg, HRB 86891 | Sitz der Gesellschaft:
Hamburg | Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle

On Wed, Mar 1, 2017 at 11:51 AM, <[email protected]> wrote:

> Hi all!
>
> I am new to V8 project. I am trying to work on crbug.com/v8/6005 (Migrate
> v8natives.js). By referencing commit history and the style of the codes and
> lots help from cs.chromium.org/chromium/src/v8/, I at least figured out
> how to migrate the constants (CL accepted). However, migrating functions is
> a lot harder for me.
>
> Things I feel confused about:
>
>    - In builtins/builtins-object.cc, functions wrapped by BUILTIN()
>    sometimes return Handle<Object>, sometimes Handle<JSReceiver>.
>    - In several commits where JS functions are moved to C++, sometimes
>    runtime/runtime.h, runtime/runtime-{type}.cc and
>    debug/debug-evaluate.cc need to be modified as well, but not always.
>    - How to decide whether to implement the function as C++ builtin or TF
>    builtin?
>
> It will be great someone can guide me through this. Is there existing
> documentation on how V8 codes are organized, how to use certain C++
> functions, https://tc39.github.io/ecma262/ and so on?
>
> Thanks in advance.
>
> Regards,
> Rong Jie
>
> --
> --
> v8-dev mailing list
> [email protected]
> http://groups.google.com/group/v8-dev
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to