[webkit-dev] JavaScriptCore directory reorganization

Maciej Stachowiak mjs at apple.com
Thu Jun 12 23:25:28 PDT 2008


Now that SquirrelFish has landed, I'd like to take a look at  
reorganizing JavaScriptCore's files and directories a bit.

JavaScriptCore has the following subdirectories:

API/
VM/
docs/
icu/
kjs/
os-win32/
pcre/
profiler/
tests/
wtf/

I see a few issues in this organization:

1) API and VM are all-caps, violating our usual all-lowercase scheme  
in JavaScriptCore and WebCore.
2) The split between kjs and VM is ill-defined (kjs includes some  
compiler-related code, the includes some runtime classes)
3) kjs is now a name of only historical relevance.
4) It's a little weird that the profiler has its own directory, but  
not the debugger.

After discussing with Sam and Cameron a bit on IRC, I'd like to  
propose a reorganization roughly as follows:

API --> rename to api
profiler --> rename to tools and move debugger code here too

kjs and VM --> reorganize according to runtime and then execution  
phases. Possible names for these directories:

implementations of builtin types and runtime support code: runtime,  
builtins or library (runtime seems like the most popular choice)
lexer, parser and syntax tree classes (but not the emitCode  
functions): ast, syntax-tree, parser or frontend
CodeGenerator and related, plus various emitCode() functions (split  
out from their home in nodes.cpp): compiler, bytecompiler or codegen
virtual machine and files that are purely about the bytecode execution  
model (such as CodeBlock) but not solely about code generation: vm

We could also take the opportunity to do some file renames, but we can  
do this incrementally. Also these are just rough thoughts, I have not  
thought through where every file should go and what files maybe need  
splitting.

Regards,
Maciej



More information about the webkit-dev mailing list