Version 9 (modified by moo, 8 years ago) (diff)


Module List


Cache opcode into shared memory.

Compiler Sandbox

Setup sandbox for php compiler.

Files: trunk/utils.c trunk/utils.h

Struct Copying

To copy struct safely and efficiently. (xc_processor_store_xc_entry_t + xc_processor_restore_xc_entry_t)

  • Calc size of the whole compiler result. (xc_calc_xc_entry_t)
  • Allocate memory in shm with this size. (xc_mem_malloc)
  • Copy to shm after compile. (xc_store_xc_entry_t)
  • Copy from shm on cache hit. (xc_restore_xc_entry_t)

Files: trunk/processor/

Shared Memory

Shared memory provider. (aka. shm)

Only mmap is supported as shm currently.



Lock provider, to operate shm atomicly.

It's important to note that the "scope" of the lock must be same as of shared memory.

  • Anonymous shared memory <-> Anonymous lock: The shm/lock is shared inside process group
  • Non-Anonymous shared memory <-> Non-Anonymous lock: The shm/lock is shared between different process group

Memory Manager

Memory manager, working on top of shm + lock. It's something like malloc/emalloc family, but works on shm.

Files: trunk/mem.h trunk/mem.c


XCache administration scripts. TheScriptingWay and PhpTepmlating? is used.

Files: trunk/admin/


To optimize opcode. (N/A)


Collect coverage info.

TheScriptingWay isn't used by Coverager itself but Coverager+Viewer. Because you might have many files included and covered in 1 page hit, performance is important making the test faster.

Files: trunk/coverager.h trunk/coverager.c

Coverage Viewer

Produce visual output from the coverage data. PhpTepmlating? is used.

Files: trunk/coverager/

Live Test Runner

An LivingTest? framework that help to hit your code generating coverage data. (TOSHARE)


Assemble from asm code to opcode data. (N/A)


Disassemble opcode data to asm code. We use TheScriptingWay.



Decompile opcode data to php code using Disassembler. This is experminal and is for study only.



Encode opcode data to file. (N/A)


Decode opcode data from file. (aka. loader) (N/A)

Attachments (1)

Download all attachments as: .zip