javascript v8 is an open source JavaScript engine developed by Google, used in Google Chrome and Chromium; V8 compiles JavaScript into machine code before execution, instead of bytecode or interpreting it to execute it. This improves performance.
The operating environment of this article: windows7 system, javascript version 1.8.5, DELL G3 computer
What is javascript v8?
V8 is an open source JavaScript engine developed by Google and used in Google Chrome and Chromium. Lars Bak is the team leader of this project, which is named after the V8 engine.
V8 compiles JavaScript into machine code before execution instead of bytecode or interpreting it to improve performance. Furthermore, methods such as inline caching are used to improve performance. With these features, JavaScript programs compiled with the V8 engine are as fast as binary compilation.
Traditional Javascript is a dynamic language, which can also be called Prototype-based Language. The JavaScript inheritance method is to use prototype. By specifying the prototype attribute, you can specify the target to be inherited. Attributes can be added to or deleted from the object at runtime. The engine will create an attribute dictionary for the object during execution. New attributes must use the dictionary to find the location of the attribute in memory. When V8 adds a new attribute to an object, it uses the last hidden class as the parent category and creates a subcategory of the new attribute's hidden class. In this way, attribute access no longer requires a dynamic dictionary lookup.
In order to shorten the pause caused by garbage collection, V8 uses a stop-the-world, generational, accurate garbage collector. Program execution is temporarily interrupted when recycling is performed, and only the object stack is processed. It also collects pointers of all objects in the memory to avoid memory overflow. V8 assembler is based on Strongtalk assembler.
Recommended study: "javascript basic tutorial"
The above is the detailed content of what is javascript v8. For more information, please follow other related articles on the PHP Chinese website!