Skip to content

valtasar/vm_v8

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 

Repository files navigation

libv8js_example

Repository provides examples of how to solve some tasks in C++ using v8 library.

Dependencies

The following libraries are required to be installed:

libopenssl
V8 # Completed build of V8 libraries can be find in the repository.

Building from source

git clone https://github.com/metahashorg/vm_v8

cd vm_8
cd build
./build.sh

/src directory contains built vm_v8 utility. Before launching the utility, it is needed to run the following command:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:src/v8/lib

Features

  1. Output of the bytecode which corresponds to the code compiled from js file:
./vm_v8 -mode 0 [path to the file containing js-code]

Program redirects the output of ignition compiler to the console.

  1. Counting the number of bytecode instructions for each type of the bytecode.
./vm_v8 -mode 1 [path to the file containing js-code]
  1. Gaining information about the amount of memory allocated during running the script. Two indicators are displayed: heap size and amount of allocated memory.
./vm_v8 -mode 2 [path to the file containing js-code]
  1. Initialization of contract directly in the process memory.
(under development)
  1. Reading contract's status directly from the memory.
(under development)
  1. Testing the work with external variable and function.
./vm_v8 -mode 5 [int32]

Program shows the entered value stored in the native variable using the native function.

  1. Generating SHA-256 hash for a string (js-function: meta_sha256).
./vm_v8 -mode 6 [string]
  1. Verifying ECDSA signature (js-function: meta_MHC_check_sign).
 ./vm_v8 -mode 7

There is no input data. Values are checked by default.

  1. Generating address on the public key.
./vm_v8 -mode 8 [public key in the form of hex string]
  1. Generating cache of the compiled code.
./vm_v8 -mode 9 [address] [path to the file containing js-code]

There will be 3 files created:

      1. [address].dbg  #  debug info.
      2. [address].bt  #  bytecode listing output.
      3. [address].cmpl  #  compiler cache.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 98.1%
  • Other 1.9%