Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9006661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:28:20+00:00 2026-06-16T01:28:20+00:00

I’m a new comer in Google V8 and Javascript, and I’m trying to add

  • 0

I’m a new comer in Google V8 and Javascript, and I’m trying to add a new class to Javascript using C++.

I’ve finished some work using Webkit’s V8 binding, references are: webkit idl and v8 binding

Now I want to integrate it into V8 engine directly, by modifying V8’s code instead of simply using V8’s api to make a extension. In other words, I want to add a new class just like Array type in Javascript, using the same implementation mechanism.

I’ve searched the Internet, including docs in Google, but have only seen guides on embedding V8 with native code.

Where can I find guides about modifying V8’s code?
Or where can I find docs about V8’s design architecture?
Or can anyone describe how V8 implements the Array type in C++?

Thanks a lot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:28:22+00:00Added an answer on June 16, 2026 at 1:28 am

    Firstly, it’s likely that you can actually get away with using the v8 api to do whatever it is that you want to do. You can use it to create prototypes that mostly behave the same as built-in objects, you can bind C++ function calls to JS function calls also. There’s really no reason to modify v8 itself unless you need something to be extremely fast or to inspect or manipulate v8 internals. For instance, Chrome’s DOM implementation uses the v8 API rather than being implemented in v8 directly. The embedder’s guide actually has all the information you need to create “classes” (remember that in JS it’s actually prototype inheritance): https://developers.google.com/v8/embed#templates.

    That said, here’s some good places to look in the source code for say, the array object. I’m not sure off any design doc, you’re probably better off looking at the source.

    The array object itself is here:
    https://code.google.com/p/v8/source/browse/trunk/src/objects.h#8409

    Some of the array api functions are implemented here (many use the same public APIs as you would for extending):
    https://code.google.com/p/v8/source/browse/trunk/src/builtins.cc#511

    Some of the array api functions are implemented in JavaScript: https://code.google.com/p/v8/source/browse/trunk/src/array.js

    Do a search for JSArray and you’ll see much more. Pay particular attention to the bits in the native code generator, because you if you really want to take advantage of some custom type written at this level, you’ll want to write code to generate efficient machine code too, for a bunch of different architectures…

    Edit: Looks like V8 documentation has moved (and are better) than when this answer was written, here’s some quick links to useful documentation:

    • Wiki: https://github.com/v8/v8/wiki/Getting%20Started%20with%20Embedding
    • API docs: http://v8.paulfryzel.com/docs/master/index.html
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am trying to render a haml file in a javascript response like so:
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm making a simple page using Google Maps API 3. My first. One marker
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.