Introduce extended mode.
authorkeuchel@chromium.org <keuchel@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 24 Nov 2011 15:17:04 +0000 (15:17 +0000)
committerkeuchel@chromium.org <keuchel@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 24 Nov 2011 15:17:04 +0000 (15:17 +0000)
commit1e9a7267ab35caf2f32ad591fc5dafaaa03466c0
tree7e2c1fe09c205d49701a695abbc61f228806cef0
parent7e7d4dfd64c33ec57a785592fca46b3d6014f386
Introduce extended mode.

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
70 files changed:
src/accessors.cc
src/arm/code-stubs-arm.cc
src/arm/full-codegen-arm.cc
src/arm/lithium-arm.h
src/arm/lithium-codegen-arm.cc
src/arm/lithium-codegen-arm.h
src/arm/stub-cache-arm.cc
src/ast.cc
src/ast.h
src/bootstrapper.cc
src/code-stubs.h
src/compilation-cache.cc
src/compilation-cache.h
src/compiler.cc
src/compiler.h
src/execution.cc
src/factory.cc
src/factory.h
src/flag-definitions.h
src/full-codegen.cc
src/full-codegen.h
src/globals.h
src/handles.h
src/heap.cc
src/hydrogen-instructions.h
src/hydrogen.cc
src/hydrogen.h
src/ia32/code-stubs-ia32.cc
src/ia32/full-codegen-ia32.cc
src/ia32/lithium-codegen-ia32.cc
src/ia32/lithium-codegen-ia32.h
src/ia32/lithium-ia32.h
src/ia32/stub-cache-ia32.cc
src/ic.cc
src/mips/code-stubs-mips.cc
src/mips/full-codegen-mips.cc
src/mips/lithium-codegen-mips.cc
src/mips/lithium-codegen-mips.h
src/mips/lithium-mips.h
src/mips/stub-cache-mips.cc
src/objects-inl.h
src/objects.cc
src/objects.h
src/parser.cc
src/parser.h
src/preparse-data.h
src/preparser.cc
src/preparser.h
src/runtime.cc
src/runtime.h
src/scopeinfo.cc
src/scopes.cc
src/scopes.h
src/x64/code-stubs-x64.cc
src/x64/full-codegen-x64.cc
src/x64/lithium-codegen-x64.cc
src/x64/lithium-codegen-x64.h
src/x64/lithium-x64.h
src/x64/stub-cache-x64.cc
test/cctest/test-parsing.cc
test/mjsunit/debug-scopes.js
test/mjsunit/harmony/block-conflicts.js
test/mjsunit/harmony/block-for.js
test/mjsunit/harmony/block-leave.js
test/mjsunit/harmony/block-let-crankshaft.js
test/mjsunit/harmony/block-let-declaration.js
test/mjsunit/harmony/block-let-semantics.js
test/mjsunit/harmony/block-scoping.js
test/mjsunit/harmony/debug-blockscopes.js
test/mjsunit/harmony/debug-evaluate-blockscopes.js