v8/test/cctest
rossberg@chromium.org ce05280bfc Get rid of static module allocation, do it in code.
Modules now have their own local scope, represented by their own context.
Module instance objects have an accessor for every export that forwards
access to the respective slot from the module's context. (Exports that are
modules themselves, however, are simple data properties.)

All modules have a _hosting_ scope/context, which (currently) is the
(innermost) enclosing global scope. To deal with recursion, nested modules
are hosted by the same scope as global ones.

For every (global or nested) module literal, the hosting context has an
internal slot that points directly to the respective module context. This
enables quick access to (statically resolved) module members by 2-dimensional
access through the hosting context. For example,

  module A {
    let x;
    module B { let y; }
  }
  module C { let z; }

allocates contexts as follows:

[header| .A | .B | .C | A | C ]  (global)
          |    |    |
          |    |    +-- [header| z ]  (module)
          |    |
          |    +------- [header| y ]  (module)
          |
          +------------ [header| x | B ]  (module)

Here, .A, .B, .C are the internal slots pointing to the hosted module
contexts, whereas A, B, C hold the actual instance objects (note that every
module context also points to the respective instance object through its
extension slot in the header).

To deal with arbitrary recursion and aliases between modules,
they are created and initialized in several stages. Each stage applies to
all modules in the hosting global scope, including nested ones.

1. Allocate: for each module _literal_, allocate the module contexts and
   respective instance object and wire them up. This happens in the
   PushModuleContext runtime function, as generated by AllocateModules
   (invoked by VisitDeclarations in the hosting scope).

2. Bind: for each module _declaration_ (i.e. literals as well as aliases),
   assign the respective instance object to respective local variables. This
   happens in VisitModuleDeclaration, and uses the instance objects created
   in the previous stage.
   For each module _literal_, this phase also constructs a module descriptor
   for the next stage. This happens in VisitModuleLiteral.

3. Populate: invoke the DeclareModules runtime function to populate each
   _instance_ object with accessors for it exports. This is generated by
   DeclareModules (invoked by VisitDeclarations in the hosting scope again),
   and uses the descriptors generated in the previous stage.

4. Initialize: execute the module bodies (and other code) in sequence. This
   happens by the separate statements generated for module bodies. To reenter
   the module scopes properly, the parser inserted ModuleStatements.

R=mstarzinger@chromium.org,svenpanne@chromium.org
BUG=

Review URL: https://codereview.chromium.org/11093074

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13033 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-22 10:25:22 +00:00
..
cctest.cc Reverting 3174. Aka reapplying 3150, 3151 and 3159. Aka api accessor 2009-11-04 08:51:48 +00:00
cctest.gyp Store Object.observe state per-isolate rather than per-context 2012-11-06 16:47:15 +00:00
cctest.h Make test-dictionary work for GC stress builder. 2012-11-20 10:47:31 +00:00
cctest.status Adjust Android test expectations. 2012-10-19 09:28:23 +00:00
gay-fixed.cc Dtoa for fixed notation. 2010-05-05 13:51:27 +00:00
gay-fixed.h Dtoa for fixed notation. 2010-05-05 13:51:27 +00:00
gay-precision.cc Added precision mode to fast-dtoa. 2010-09-20 09:18:00 +00:00
gay-precision.h Added precision mode to fast-dtoa. 2010-09-20 09:18:00 +00:00
gay-shortest.cc Dtoa for fixed notation. 2010-05-05 13:51:27 +00:00
gay-shortest.h Dtoa for fixed notation. 2010-05-05 13:51:27 +00:00
log-eq-of-logging-and-traversal.js Eliminate the need for code delete events in CPU profiler. 2011-09-14 11:47:03 +00:00
SConscript Implement date library functions in C++. 2012-03-09 12:07:29 +00:00
test-accessors.cc Add isolate accessor to AccessorInfo and Arguments. 2012-04-13 09:38:00 +00:00
test-alloc.cc Rename IsAsciiRepresentation 2012-11-21 10:01:05 +00:00
test-api.cc Rename IsAsciiRepresentation 2012-11-21 10:01:05 +00:00
test-assembler-arm.cc Emit VMLA for multiply-add on ARM 2012-11-14 11:01:18 +00:00
test-assembler-ia32.cc Support multi-byte nop instructions as recommended by 2011-12-02 10:01:50 +00:00
test-assembler-mips.cc MIPS: Added support for Loongson architectures. 2012-03-13 16:18:30 +00:00
test-assembler-x64.cc Cosmetic changes ("set up" is a verb, "setup" is a noun). 2012-01-13 13:09:52 +00:00
test-ast.cc One Zone per CompilationInfo. 2012-06-20 08:58:41 +00:00
test-bignum-dtoa.cc Fix X64 compilation on Windows. 2011-02-03 11:13:04 +00:00
test-bignum.cc Bignum implementation of Strtod. 2010-11-08 11:49:47 +00:00
test-circular-queue.cc Pick the namespace alias 'i' from v8.h. 2011-08-12 09:49:55 +00:00
test-compiler.cc Reduced TLS accesses even further. 2012-11-22 07:58:59 +00:00
test-conversions.cc Cleanup of ScannerConstants, now named UnicodeCache. 2011-04-12 08:27:38 +00:00
test-cpu-profiler.cc Perform CPU sampling by CPU sampling thread only iff processing thread is not running. 2012-11-16 10:38:10 +00:00
test-dataflow.cc One Zone per CompilationInfo. 2012-06-20 08:58:41 +00:00
test-date.cc Implement date library functions in C++. 2012-03-09 12:07:29 +00:00
test-debug.cc Reduced TLS accesses even further. 2012-11-22 07:58:59 +00:00
test-decls.cc Get rid of static module allocation, do it in code. 2012-11-22 10:25:22 +00:00
test-deoptimization.cc Add kAbortIncrementalMarkingMask flag for GC. 2012-03-07 17:52:16 +00:00
test-dictionary.cc Make test-dictionary work for GC stress builder. 2012-11-20 10:47:31 +00:00
test-disasm-arm.cc Emit VMLA for multiply-add on ARM 2012-11-14 11:01:18 +00:00
test-disasm-ia32.cc Support multi-byte nop instructions as recommended by 2011-12-02 10:01:50 +00:00
test-disasm-mips.cc MIPS: Added support for Loongson architectures. 2012-03-13 16:18:30 +00:00
test-disasm-x64.cc Fix MinGW-w64 GCC 4.7 compilation 2012-04-17 14:53:06 +00:00
test-diy-fp.cc Rename files containing underscores. 2010-03-19 12:15:24 +00:00
test-double.cc Remove unused IsNan function 2012-04-23 13:44:06 +00:00
test-dtoa.cc Fix compilation on 64-bit Windows, update Visual Studio projects. 2011-02-03 13:29:10 +00:00
test-fast-dtoa.cc Fix X64 Windows compilation. 2011-02-03 15:14:46 +00:00
test-fixed-dtoa.cc Dtoa for fixed notation. 2010-05-05 13:51:27 +00:00
test-flags.cc Ensure removing processed command line arguments. 2012-06-13 15:02:05 +00:00
test-func-name-inference.cc Fix FindSharedFunctionInfoInScript to not optimize. 2012-09-03 14:23:00 +00:00
test-hashing.cc Minor cleanups of numeric seeded hashing patch. 2012-01-10 13:24:18 +00:00
test-hashmap.cc Make the hash map test run faster by doing less work. 2009-05-15 13:49:00 +00:00
test-heap-profiler.cc Move DescriptorArray into the map. 2012-10-17 13:04:49 +00:00
test-heap.cc Make test-dictionary work for GC stress builder. 2012-11-20 10:47:31 +00:00
test-list.cc Progress towards making Zones independent of Isolates and Threads. 2012-06-04 14:42:58 +00:00
test-liveedit.cc One Zone per CompilationInfo. 2012-06-20 08:58:41 +00:00
test-lock.cc Stop running some liveedit tests (see issue 915). 2010-10-29 07:10:14 +00:00
test-lockers.cc MIPS: Reduced the number of threads in cctest test-lockers. 2011-11-23 08:36:03 +00:00
test-log-stack-tracer.cc When running with --always-opt, don't deoptimize named loads with uninitialized type feedback. 2012-03-21 09:23:09 +00:00
test-log.cc Merge experimental/gc branch to the bleeding_edge. 2011-09-19 18:36:47 +00:00
test-macro-assembler-x64.cc Fix non-ia32 build. 2011-04-01 15:37:59 +00:00
test-mark-compact.cc Refactoring of snapshots. This simplifies and improves 2012-09-14 11:16:56 +00:00
test-object-observe.cc Object.deliverChangeRecords should remove the observer from activeObservers 2012-11-13 15:53:28 +00:00
test-parsing.cc Fix build errors. 2012-11-14 09:32:51 +00:00
test-platform-linux.cc Add OS::GetCurrentProcessId and prepend output from trace-gc with the current pid 2012-07-10 12:52:36 +00:00
test-platform-macos.cc Changed copyright header from google inc. to v8 project authors. 2008-09-09 20:08:45 +00:00
test-platform-nullos.cc Changed copyright header from google inc. to v8 project authors. 2008-09-09 20:08:45 +00:00
test-platform-tls.cc "Deiceolate" Thread classes. 2011-06-10 09:54:04 +00:00
test-platform-win32.cc Add OS::GetCurrentProcessId and prepend output from trace-gc with the current pid 2012-07-10 12:52:36 +00:00
test-profile-generator.cc Merge experimental/gc branch to the bleeding_edge. 2011-09-19 18:36:47 +00:00
test-random.cc Rename Context::global to Context::global_object, 2012-08-17 12:59:00 +00:00
test-regexp.cc Rename SeqAsciiString 2012-11-15 13:31:27 +00:00
test-reloc-info.cc Merge experimental/gc branch to the bleeding_edge. 2011-09-19 18:36:47 +00:00
test-serialize.cc Fixed heap verification guards. 2012-10-15 06:34:22 +00:00
test-sockets.cc Fix cctests using Sockets to be able to run in parallel 2012-10-01 09:41:18 +00:00
test-spaces.cc Reduce initial boot-up memory use. This is an other attempt at what 2012-04-02 08:32:31 +00:00
test-strings.cc Fix edge case of extension with NULL as source string. 2012-09-11 14:16:56 +00:00
test-strtod.cc Revert r10913. 2012-03-05 07:55:27 +00:00
test-thread-termination.cc Fix race condition in test-thread-termination. 2012-04-03 10:15:12 +00:00
test-threads.cc Fixing test case from r9469. 2011-09-28 14:26:23 +00:00
test-unbound-queue.cc Pick the namespace alias 'i' from v8.h. 2011-08-12 09:49:55 +00:00
test-utils.cc Fix build errors. 2012-07-30 08:54:51 +00:00
test-version.cc Update V8 to version 3.0 (re-land r5920). 2010-12-07 11:31:57 +00:00
test-weakmaps.cc Enable --verify-heap in release mode 2012-10-12 11:41:14 +00:00
testcfg.py Fix test runner for Android. 2012-10-19 09:55:27 +00:00