1. 05 Dec, 2011 1 commit
  2. 29 Nov, 2011 1 commit
  3. 28 Nov, 2011 2 commits
  4. 24 Nov, 2011 1 commit
    • keuchel@chromium.org's avatar
      Introduce extended mode. · 1e9a7267
      keuchel@chromium.org authored
      This CL introduces a third mode next to the non-strict
      (henceforth called 'classic mode') and 'strict mode'
      which is called 'extended mode' as in the current
      ES.next specification drafts. The extended mode is based on
      the 'strict mode' and adds new functionality to it. This
      means that most of the semantics of these two modes
      coincide.
      
      The 'extended mode' is entered instead of the 'strict mode'
      during parsing when using the 'strict mode' directive
      "use strict" and when the the harmony-scoping flag is
      active. This should be changed once it is fully specified how the 'extended mode' is entered.
      
      This change introduces a new 3 valued enum LanguageMode
      (see globals.h) corresponding to the modes which is mostly
      used by the frontend code. This includes the following
      components:
      * (Pre)Parser
      * Compiler
      * SharedFunctionInfo, Scope and ScopeInfo
      * runtime functions: StoreContextSlot,
        ResolvePossiblyDirectEval, InitializeVarGlobal,
        DeclareGlobals
      
      The old enum StrictModeFlag is still used in the backend
      when the distinction between the 'strict mode' and the 'extended mode' does not matter. This includes:
      * SetProperty runtime function, Delete builtin
      * StoreIC and KeyedStoreIC
      * StubCache
      
      Review URL: http://codereview.chromium.org/8417035
      
      git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10062 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
      1e9a7267
  5. 18 Nov, 2011 3 commits
  6. 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
  7. 03 Nov, 2011 4 commits
  8. 02 Nov, 2011 1 commit
  9. 25 Oct, 2011 1 commit
  10. 24 Oct, 2011 1 commit
  11. 21 Oct, 2011 1 commit
    • keuchel@chromium.org's avatar
      Reapply r9673 "Scope tree serialization and ScopeIterator cleanup." · 666c4be2
      keuchel@chromium.org authored
      This also includes the two fixes from r9674 and r9675. Here's the diff
      to the previous CL.
      
       --- a/src/runtime.cc
       +++ b/src/runtime.cc
       @@ -11133,17 +11133,26 @@ class ScopeIterator {
              context_(Context::cast(frame->context())),
              nested_scope_chain_(4) {
      
       +    // Catch the case when the debugger stops in an internal function.
       +    Handle<SharedFunctionInfo> shared_info(function_->shared());
       +    if (shared_info->script() == isolate->heap()->undefined_value()) {
       +      if (shared_info->scope_info()->HasContext()) Next();
       +      return;
       +    }
       +
            // Check whether we are in global code or function code. If there is a stack
            // slot for .result then this function has been created for evaluating
            // global code and it is not a real function.
            // Checking for the existence of .result seems fragile, but the scope info
            // saved with the code object does not otherwise have that information.
       -    int index = function_->shared()->scope_info()->
       +    int index = shared_info->scope_info()->
                StackSlotIndex(isolate_->heap()->result_symbol());
      
            // Reparse the code and analyze the scopes.
            ZoneScope zone_scope(isolate, DELETE_ON_EXIT);
       -    Handle<SharedFunctionInfo> shared_info(function_->shared());
            Handle<Script> script(Script::cast(shared_info->script()));
            Scope* scope;
            if (index >= 0) {
      
      Review URL: http://codereview.chromium.org/8344046
      
      git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9734 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
      666c4be2
  12. 19 Oct, 2011 1 commit
  13. 18 Oct, 2011 1 commit
  14. 17 Oct, 2011 1 commit
  15. 11 Oct, 2011 1 commit
  16. 14 Sep, 2011 1 commit
  17. 09 Sep, 2011 1 commit
  18. 07 Sep, 2011 1 commit
  19. 02 Sep, 2011 1 commit
  20. 01 Sep, 2011 2 commits
  21. 16 Aug, 2011 1 commit
  22. 11 Aug, 2011 1 commit
  23. 18 Jul, 2011 1 commit
  24. 15 Jul, 2011 1 commit
  25. 12 Jul, 2011 1 commit
  26. 04 Jul, 2011 1 commit
  27. 01 Jul, 2011 1 commit
  28. 30 Jun, 2011 1 commit
  29. 16 Jun, 2011 2 commits
  30. 15 Jun, 2011 1 commit
  31. 30 May, 2011 1 commit
  32. 16 May, 2011 1 commit