diff options
author | alon@honor <none@none> | 2010-09-25 20:26:16 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-09-25 20:26:16 -0700 |
commit | b94c061e122f155cc5c1262a1bb470cb49ee04b4 (patch) | |
tree | 134322b7ed16b9a3ed805d4663e3233625d5ef7a /src/settings.js | |
parent | 481dec302bfb02b574741c4e505d274718854dff (diff) |
optional memory alignment that matches c/c++; used in clang, not in llvm-gcc
Diffstat (limited to 'src/settings.js')
-rw-r--r-- | src/settings.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/settings.js b/src/settings.js index f84391fd..f6282ed4 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1,3 +1,18 @@ +// Tuning +QUANTUM_SIZE = 1; // This is the size of an individual field in a structure. 1 would + // lead to e.g. doubles and chars both taking 1 memory address. This + // is a form of 'compressed' memory, with shrinking and stretching + // according to the type, when compared to C/C++. On the other hand + // 8 means all fields take 8 memory addresses, so a double takes + // the same as a char. Note that we only actually store something in + // the top address - the others are just empty, an 'alignment cost' + // of sorts. + // + // llvm-gcc works with 1. However, clang uses llvm_memcpy for various + // things, and the number of bytes it copies is hardcoded. A simple + // way to prevent problems with that is to set QUANTUM_SIZE to 8. + // See the 'copyop' automatic test. + // Code embetterments OPTIMIZE = 1; // Optimize llvm operations into js commands RELOOP = 0; // Recreate js native loops from llvm data XXX - disabled pending optimizing rewrite |