1. 16 Dec, 2014 1 commit
  2. 13 Nov, 2014 1 commit
  3. 12 Nov, 2014 2 commits
  4. 07 Nov, 2014 1 commit
    • dslomov@chromium.org's avatar
      harmony_scoping: Implement lexical bindings at top level · 1a64b02d
      dslomov@chromium.org authored
      This implements correct semantics for "extensible" top level lexical scope.
      The entire lexical scope is represented at runtime by GlobalContextTable, reachable from native context and accumulating global contexts from every script loaded into the context.
      
      When the new script starts executing, it does the following validation:
      - checks the GlobalContextTable and global object (non-configurable own) properties against the set of declarations it introduces and reports potential conflicts.
      - invalidates the conflicting PropertyCells on global object, so that any code depending on them will miss/deopt causing any contextual lookups to be reexecuted under the new bindings
      - adds the lexical bindings it introduces to the GlobalContextTable
      
      Loads and stores for contextual lookups are modified so that they check the GlobalContextTable before looking up properties on global object, thus implementing the shadowing of global object properties by lexical declarations.
      
      R=adamk@chromium.org, rossberg@chromium.org
      
      Review URL: https://codereview.chromium.org/705663004
      
      Cr-Commit-Position: refs/heads/master@{#25220}
      git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25220 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
      1a64b02d
  5. 29 Oct, 2014 1 commit
  6. 10 Sep, 2014 1 commit
  7. 08 Aug, 2014 1 commit
  8. 06 Aug, 2014 1 commit
  9. 04 Aug, 2014 1 commit
  10. 30 Jul, 2014 1 commit
  11. 25 Jul, 2014 1 commit
  12. 12 Jun, 2014 1 commit
  13. 03 Jun, 2014 1 commit
  14. 22 May, 2014 1 commit
  15. 30 Apr, 2014 1 commit
  16. 29 Apr, 2014 1 commit
  17. 17 Apr, 2014 1 commit
  18. 11 Apr, 2014 1 commit
  19. 25 Mar, 2014 1 commit
  20. 24 Mar, 2014 2 commits
  21. 13 Mar, 2014 1 commit
  22. 11 Mar, 2014 1 commit
  23. 25 Oct, 2013 1 commit
  24. 04 Sep, 2013 1 commit
  25. 03 Sep, 2013 1 commit
  26. 19 Jul, 2013 1 commit
  27. 05 Jul, 2013 1 commit
  28. 25 Feb, 2013 1 commit
  29. 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
  30. 23 Oct, 2012 1 commit
  31. 17 Sep, 2012 1 commit
  32. 27 Aug, 2012 1 commit
  33. 17 Aug, 2012 2 commits
  34. 09 Jul, 2012 1 commit
    • rossberg@chromium.org's avatar
      Implement proper module linking. · 98db1a36
      rossberg@chromium.org authored
      Specifically:
      
      - In parser, check that all exports are defined.
      - Move JSModule allocation from parser to scope resolution.
      - Move JSModule linking from full codegen to scope resolution.
      - Implement module accessors for exported value members.
      - Allocate module contexts statically along with JSModules
        (to allow static linking), but chain them when module literal is evaluated.
      - Make module contexts' extension slot refer to resp. JSModule
        (makes modules' ScopeInfo accessible from context).
      - Some other tweaks to context handling in general.
      - Make any code containing module literals (and thus embedding
        static references to JSModules) non-cacheable.
      
      This enables accessing module instance objects as expected.
      Import declarations are a separate feature and do not work yet.
      
      R=mstarzinger@chromium.org
      BUG=v8:1569
      TEST=
      
      Review URL: https://chromiumcodereview.appspot.com/10690043
      
      git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12010 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
      98db1a36
  35. 03 Jul, 2012 1 commit
  36. 15 Nov, 2011 1 commit
    • keuchel@chromium.org's avatar
      Static resolution of outer variables in eval code. · 08c9629f
      keuchel@chromium.org authored
      So far free variables references in eval code are not statically
      resolved. For example in
          function foo() { var x = 1; eval("y = x"); }
      the variable x will get mode DYNAMIC and y will get mode DYNAMIC_GLOBAL,
      i.e. free variable references trigger dynamic lookups with a fast case
      handling for global variables.
      
      The CL introduces static resolution of free variables references in eval
      code. If possible variable references are resolved to bindings belonging to
      outer scopes of the eval call site.
      
      This is achieved by deserializing the outer scope chain using
      Scope::DeserializeScopeChain prior to parsing the eval code similar to lazy
      parsing of functions. The existing code for variable resolution is used,
      however resolution starts at the first outer unresolved scope instead of
      always starting at the root of the scope tree.
      
      This is a prerequisite for statically checking validity of assignments in
      the extended code as specified by the current ES.next draft which will be
      introduced by a subsequent CL. More specifically section 11.13 of revision 4
      of the ES.next draft reads:
      * It is a Syntax Error if the AssignmentExpression is contained in extended
        code and the LeftHandSideExpression is an Identifier that does not
        statically resolve to a declarative environment record binding or if the
        resolved binding is an immutable binding.
      
      TEST=existing tests in mjsunit
      
      Review URL: http://codereview.chromium.org/8508052
      
      git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9999 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
      08c9629f
  37. 03 Nov, 2011 1 commit