Hi developers,

I'm created asmjit library that is partially based on V8's sources
(assembler-ia32 and assembler) allowing to generating jit functions in
various projects. The library is embeddable and is based on different
concepts that assembler class in V8.

If there are people interested with this, please mail me to
[email protected] through jabber [email protected].

The concepts I used are different from concepts in V8 by these ways:
- Everything can be operand, functions can assert correct types.
- All registers can be used (AL, AX, EAX, MM1, XMM1, ...) and all
registers size can be
  determined.
- Memory addresses can be also size checked.

Simple code how to demonstrate how I'm talking about:
(in comments is intel syntax for that asm)

  using namespace AsmJit;

  // Create function by dynamic way
  X86 a;

  // push ebp
  a.push(ebp);
  // mov ebp, esp
  a.mov(ebp, esp);

  // mov al, 10
  a.mov(al, 10);
  // mov eax, 1024
  a.mov(eax, imm(1024));
  // mov eax, dword ptr [edx]
  a.mov(eax, dword_ptr(edx));
  // add eax, ebx
  a.add(eax, ebx);
  // add eax, dword ptr [esi + 4]
  a.add(eax, dword_ptr(esi, 4));

  // mov esp, ebp
  a.mov(esp, ebp);
  // pop ebp
  a.pop(ebp);
  // ret
  a.ret();

I created asmjit to generating compositing functions for one graphics
library on-the-fly, so I needed embeddable assebler with liberal
licence (MIT or BSD).

Kind Regards and sorry for my English:)
Petr
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to