1. 17 Jul, 2013 1 commit
  2. 06 Jun, 2013 1 commit
  3. 26 Apr, 2013 2 commits
  4. 05 Apr, 2013 1 commit
    • mstarzinger@chromium.org's avatar
      Force context allocation for variables in generator scopes. · b6efbd79
      mstarzinger@chromium.org authored
      * src/scopes.h (ForceContextAllocation, has_forced_context_allocation):
        New interface to force context allocation for an entire function's
        scope.
      
      * src/scopes.cc: Unless a new scope is a function scope, if its outer
        scope has forced context allocation, it should also force context
        allocation.
        (MustAllocateInContext): Return true if the scope as a whole has
        forced context allocation.
        (CollectStackAndContextLocals): Allow temporaries to be
        context-allocated.
      
      * src/parser.cc (ParseFunctionLiteral): Force context allocation for
        generator scopes.
      
      * src/v8globals.h (VariableMode): Update comment on TEMPORARY.
      
      * src/arm/full-codegen-arm.cc (Generate):
      * src/ia32/full-codegen-ia32.cc (Generate):
      * src/x64/full-codegen-x64.cc (Generate): Assert that generators have no
        stack slots.
      
      * test/mjsunit/harmony/generators-instantiation.js: New test.
      
      BUG=v8:2355
      TEST=mjsunit/harmony/generators-instantiation
      
      Review URL: https://codereview.chromium.org/13408005
      Patch from Andy Wingo <wingo@igalia.com>.
      
      git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14152 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
      b6efbd79
  5. 28 Feb, 2013 1 commit
  6. 27 Feb, 2013 1 commit
  7. 18 Dec, 2012 1 commit
  8. 17 Dec, 2012 1 commit
  9. 07 Dec, 2012 1 commit
  10. 22 Nov, 2012 1 commit
    • rossberg@chromium.org's avatar
      Get rid of static module allocation, do it in code. · ce05280b
      rossberg@chromium.org authored
      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
      ce05280b
  11. 29 Aug, 2012 1 commit
  12. 28 Aug, 2012 1 commit
    • rossberg@chromium.org's avatar
      Allocate block-scoped global bindings to global context. · ccc827a6
      rossberg@chromium.org authored
      - The global object has a reference to the current global scope chain.
        Running a script adds to the chain if it contains global lexical declarations.
      - Scripts are executed relative to a global, not a native context.
      - Harmony let and const bindings are allocated to the innermost global context;
        var and function still live on the global object.
        (Lexical bindings are not reflected on the global object at all,
        but that will probably change later using accessors, as for modules.)
      - Compilation of scripts now needs a (global) context (previously only eval did).
      - The global scope chain represents one logical scope, so collision tests take
        the chain into account.
      
      R=svenpanne@chromium.org
      BUG=
      
      Review URL: https://chromiumcodereview.appspot.com/10872084
      
      git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12398 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
      ccc827a6
  13. 27 Aug, 2012 1 commit
  14. 23 Aug, 2012 1 commit
  15. 17 Aug, 2012 1 commit
  16. 09 Jul, 2012 3 commits
  17. 03 Jul, 2012 1 commit
  18. 20 Jun, 2012 1 commit
  19. 19 Jun, 2012 1 commit
  20. 13 Jun, 2012 1 commit
  21. 12 Jun, 2012 1 commit
  22. 11 Jun, 2012 1 commit
  23. 18 May, 2012 1 commit
  24. 16 Apr, 2012 2 commits
    • rossberg@chromium.org's avatar
      Implement rudimentary module linking. · ab26fb6b
      rossberg@chromium.org authored
      Constructs the (generally cyclic) graph of module instance objects
      and populates their exports. Any exports other than nested modules
      are currently set to 'undefined' (but already present as properties).
      
      Details:
      - Added new type JSModule for instance objects: a JSObject carrying a context.
      - Statically allocate instance objects for all module literals (in parser 8-}).
      - Extend interfaces to record and unify concrete instance objects,
        and to support iteration over members.
      - Introduce new runtime function for pushing module contexts.
      - Generate code for allocating, initializing, and setting module contexts,
        and for populating instance objects from module literals.
        Currently, all non-module exports are still initialized with 'undefined'.
      - Module aliases are resolved statically, so no special code is required.
      - Make sure that code containing module constructs is never optimized
        (macrofy AST node construction flag setting while we're at it).
      - Add test case checking linkage.
      
      Baseline: http://codereview.chromium.org/9722043/
      
      R=svenpanne@chromium.org,mstarzinger@chromium.org
      BUG=
      TEST=
      
      Review URL: https://chromiumcodereview.appspot.com/9844002
      
      git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11336 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
      ab26fb6b
    • rossberg@chromium.org's avatar
      Refactoring of code generation for declarations, in preparation for modules. · 43a52c4c
      rossberg@chromium.org authored
      Do proper dispatch on declaration type instead of mingling together
      different code generation paths. Once we add more declaration forms,
      this is more scalable.
      
      In separate steps, I'd like to (1) clean up the logic for DeclareGlobal,
      and (2) try to reduce the special handling of the name function var if
      possible.
      
      R=fschneider@chromium.org
      BUG=
      TEST=
      
      Review URL: https://chromiumcodereview.appspot.com/9704054
      
      git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11331 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
      43a52c4c
  25. 12 Apr, 2012 1 commit
  26. 09 Mar, 2012 1 commit
  27. 08 Mar, 2012 1 commit
  28. 23 Feb, 2012 1 commit
  29. 20 Feb, 2012 1 commit
  30. 08 Feb, 2012 1 commit
  31. 02 Feb, 2012 1 commit
  32. 06 Jan, 2012 1 commit
  33. 05 Dec, 2011 1 commit
  34. 29 Nov, 2011 1 commit
  35. 28 Nov, 2011 2 commits