Included mjsunit JavaScript test suite and C++ unit tests.

Changed the shell sample to not print the result of executing a script provided on the command line.

Fixed issue when building samples on Windows using a shared V8 library.  Added visibility option on Linux build which makes the generated library 18% smaller.

Changed build system to accept multiple build modes in one build and generate separate objects, libraries and executables for each mode.

Removed deferred negation optimization (a * -b => -(a * b)) since this visibly changes operand conversion order.

Improved parsing performance by introducing stack guard in preparsing.  Without a stack guard preparsing always bails out with stack overflow.

Changed shell sample to take flags directly from the command-line. Added API call that implements this.

Added load, quit and version functions to the shell sample so it's easier to run benchmarks and tests.

Fixed issue with building samples and cctests on 64-bit machines.

Fixed bug in the runtime system where the prototype chain was not always searched for a setter when setting a property that does not exist locally.


git-svn-id: http://v8.googlecode.com/svn/trunk@60 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/SConscript b/src/SConscript
index 407ab5f..135af67 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -30,205 +30,37 @@
 root_dir = dirname(File('SConstruct').rfile().abspath)
 sys.path.append(join(root_dir, 'tools'))
 import js2c
-Import('toolchain arch os mode use_snapshot library_type')
+Import('context')
 
 
-BUILD_OPTIONS_MAP = {
-  'gcc': {
-    'debug': {
-      'default': {
-        'CCFLAGS': '$DIALECTFLAGS $WARNINGFLAGS -g -O0',
-        'CPPDEFINES': ['ENABLE_LOGGING_AND_PROFILING', 'ENABLE_DISASSEMBLER', 'DEBUG'],
-        'CXXFLAGS': '$CCFLAGS -fno-rtti -fno-exceptions',
-        'DIALECTFLAGS': '-ansi',
-        'LIBS': 'pthread',
-        'WARNINGFLAGS': '-pedantic -Wall -W -Wno-unused-parameter -Werror'
-      },
-      'dtoa': {
-        'CCFLAGS': '$DIALECTFLAGS $WARNINGFLAGS -g -O0',
-        'CPPDEFINES': ['ENABLE_LOGGING_AND_PROFILING', 'ENABLE_DISASSEMBLER', 'DEBUG'],
-        'CXXFLAGS': '$CCFLAGS -fno-rtti -fno-exceptions',
-        'DIALECTFLAGS': '-ansi',
-        'LIBS': 'pthread',
-        'WARNINGFLAGS': '-Werror'
-      },
-      'jscre': {
-        'CCFLAGS': '$DIALECTFLAGS $WARNINGFLAGS -g -O0',
-        'CPPDEFINES': ['ENABLE_LOGGING_AND_PROFILING', 'ENABLE_DISASSEMBLER', 'DEBUG', 'SUPPORT_UTF8', 'NO_RECURSE', 'SUPPORT_UCP'],
-        'CXXFLAGS': '$CCFLAGS -fno-rtti -fno-exceptions',
-        'DIALECTFLAGS': '-ansi',
-        'LIBS': 'pthread',
-        'WARNINGFLAGS': '-w'
-      }
-    },
-    'release': {
-      'default': {
-        'CCFLAGS': '$DIALECTFLAGS $WARNINGFLAGS -O2',
-        'CPPDEFINES': ['ENABLE_LOGGING_AND_PROFILING'],
-        'CXXFLAGS': '$CCFLAGS -fno-rtti -fno-exceptions',
-        'DIALECTFLAGS': '-ansi',
-        'LIBS': 'pthread',
-        'WARNINGFLAGS': '-pedantic -Wall -W -Wno-unused-parameter -Werror'
-      },
-      'dtoa': {
-        'CCFLAGS': '$DIALECTFLAGS $WARNINGFLAGS -O2',
-        'CPPDEFINES': ['ENABLE_LOGGING_AND_PROFILING'],
-        'CXXFLAGS': '$CCFLAGS -fno-rtti -fno-exceptions',
-        'DIALECTFLAGS': '-ansi',
-        'LIBS': 'pthread',
-        'WARNINGFLAGS': '-Werror'
-      },
-      'jscre': {
-        'CCFLAGS': '$DIALECTFLAGS $WARNINGFLAGS -O2',
-        'CPPDEFINES': ['ENABLE_LOGGING_AND_PROFILING', 'SUPPORT_UTF8', 'NO_RECURSE', 'SUPPORT_UCP'],
-        'CXXFLAGS': '$CCFLAGS -fno-rtti -fno-exceptions',
-        'DIALECTFLAGS': '-ansi',
-        'LIBS': 'pthread',
-        'WARNINGFLAGS': '-w'
-      }
-    }
-  },
-  'msvc': {
-    'debug': {
-      'default': {
-        'ARFLAGS': '/NOLOGO',
-        'CCFLAGS': '$DIALECTFLAGS $WARNINGFLAGS /Od /Gm /MTd',
-        'CCPDBFLAGS': '/Zi',
-        'CPPDEFINES': ['WIN32', '_CRT_SECURE_NO_DEPRECATE', '_CRT_NONSTDC_NO_DEPRECATE', '_USE_32BIT_TIME_T', '_HAS_EXCEPTIONS=0', 'PCRE_STATIC', 'ENABLE_LOGGING_AND_PROFILING', 'DEBUG', '_DEBUG', 'ENABLE_DISASSEMBLER'],
-        'CXXFLAGS': '$CCFLAGS /GS- /GR- /Gy',
-        'DIALECTFLAGS': '/nologo',
-        'LINKFLAGS': '/NOLOGO /MACHINE:X86 /INCREMENTAL:NO /NXCOMPAT /IGNORE:4221 /DEBUG',
-        'PDB': '${TARGET}.pdb',
-        'WARNINGFLAGS': '/W3 /WX /wd4355 /wd4800'
-      },
-      'dtoa': {
-        'ARFLAGS': '/NOLOGO',
-        'CCFLAGS': '$DIALECTFLAGS $WARNINGFLAGS /Od /Gm /MTd',
-        'CCPDBFLAGS': '/Zi',
-        'CPPDEFINES': ['WIN32', '_CRT_SECURE_NO_DEPRECATE', '_CRT_NONSTDC_NO_DEPRECATE', '_USE_32BIT_TIME_T', '_HAS_EXCEPTIONS=0', 'PCRE_STATIC', 'ENABLE_LOGGING_AND_PROFILING', 'DEBUG', '_DEBUG', 'ENABLE_DISASSEMBLER'],
-        'CXXFLAGS': '$CCFLAGS /GS- /GR- /Gy',
-        'DIALECTFLAGS': '/nologo',
-        'LINKFLAGS': '/NOLOGO /MACHINE:X86 /INCREMENTAL:NO /NXCOMPAT /IGNORE:4221 /DEBUG',
-        'PDB': '${TARGET}.pdb',
-        'WARNINGFLAGS': '/WX /wd4018 /wd4244'
-      },
-      'jscre': {
-        'ARFLAGS': '/NOLOGO',
-        'CCFLAGS': '$DIALECTFLAGS $WARNINGFLAGS /Od /Gm /MTd',
-        'CCPDBFLAGS': '/Zi',
-        'CPPDEFINES': ['WIN32', '_CRT_SECURE_NO_DEPRECATE', '_CRT_NONSTDC_NO_DEPRECATE', '_USE_32BIT_TIME_T', '_HAS_EXCEPTIONS=0', 'PCRE_STATIC', 'ENABLE_LOGGING_AND_PROFILING', 'DEBUG', '_DEBUG', 'ENABLE_DISASSEMBLER', 'SUPPORT_UTF8', 'NO_RECURSE', 'SUPPORT_UCP'],
-        'CXXFLAGS': '$CCFLAGS /GS- /GR- /Gy',
-        'DIALECTFLAGS': '/nologo',
-        'LINKFLAGS': '/NOLOGO /MACHINE:X86 /INCREMENTAL:NO /NXCOMPAT /IGNORE:4221 /DEBUG',
-        'PDB': '${TARGET}.pdb',
-        'WARNINGFLAGS': '/W3 /WX /wd4355 /wd4800'
-      }
-    },
-    'release': {
-      'default': {
-        'ARFLAGS': '/NOLOGO',
-        'CCFLAGS': '$DIALECTFLAGS $WARNINGFLAGS /Ox /MT /Ob2 /Oi /Oy',
-        'CCPDBFLAGS': '/Zi',
-        'CPPDEFINES': ['WIN32', '_CRT_SECURE_NO_DEPRECATE', '_CRT_NONSTDC_NO_DEPRECATE', '_USE_32BIT_TIME_T', '_HAS_EXCEPTIONS=0', 'PCRE_STATIC', 'ENABLE_LOGGING_AND_PROFILING'],
-        'CXXFLAGS': '$CCFLAGS /GS- /GR- /Gy',
-        'DIALECTFLAGS': '/nologo',
-        'LINKFLAGS': '/NOLOGO /MACHINE:X86 /INCREMENTAL:NO /NXCOMPAT /IGNORE:4221 /OPT:REF',
-        'PDB': '${TARGET}.pdb',
-        'WARNINGFLAGS': '/W3 /WX /wd4355 /wd4800'
-      },
-      'dtoa': {
-        'ARFLAGS': '/NOLOGO',
-        'CCFLAGS': '$DIALECTFLAGS $WARNINGFLAGS /Ox /MT /Ob2 /Oi /Oy',
-        'CCPDBFLAGS': '/Zi',
-        'CPPDEFINES': ['WIN32', '_CRT_SECURE_NO_DEPRECATE', '_CRT_NONSTDC_NO_DEPRECATE', '_USE_32BIT_TIME_T', '_HAS_EXCEPTIONS=0', 'PCRE_STATIC', 'ENABLE_LOGGING_AND_PROFILING'],
-        'CXXFLAGS': '$CCFLAGS /GS- /GR- /Gy',
-        'DIALECTFLAGS': '/nologo',
-        'LINKFLAGS': '/NOLOGO /MACHINE:X86 /INCREMENTAL:NO /NXCOMPAT /IGNORE:4221 /OPT:REF',
-        'PDB': '${TARGET}.pdb',
-        'WARNINGFLAGS': '/WX /wd4018 /wd4244'
-      },
-      'jscre': {
-        'ARFLAGS': '/NOLOGO',
-        'CCFLAGS': '$DIALECTFLAGS $WARNINGFLAGS /Ox /MT /Ob2 /Oi /Oy',
-        'CCPDBFLAGS': '/Zi',
-        'CPPDEFINES': ['WIN32', '_CRT_SECURE_NO_DEPRECATE', '_CRT_NONSTDC_NO_DEPRECATE', '_USE_32BIT_TIME_T', '_HAS_EXCEPTIONS=0', 'PCRE_STATIC', 'ENABLE_LOGGING_AND_PROFILING', 'SUPPORT_UTF8', 'NO_RECURSE', 'SUPPORT_UCP'],
-        'CXXFLAGS': '$CCFLAGS /GS- /GR- /Gy',
-        'DIALECTFLAGS': '/nologo',
-        'LINKFLAGS': '/NOLOGO /MACHINE:X86 /INCREMENTAL:NO /NXCOMPAT /IGNORE:4221 /OPT:REF',
-        'PDB': '${TARGET}.pdb',
-        'WARNINGFLAGS': '/W3 /WX /wd4355 /wd4800'
-      }
-    }
-  }
-}
-
-
-PLATFORM_INDEPENDENT_SOURCES = '''
-accessors.cc
-allocation.cc
-api.cc
-assembler.cc
-ast.cc
-bootstrapper.cc
-builtins.cc
-checks.cc
-code-stubs.cc
-codegen.cc
-compiler.cc
-contexts.cc
-conversions.cc
-counters.cc
-dateparser.cc
-debug.cc
-disassembler.cc
-execution.cc
-factory.cc
-flags.cc
-frames.cc
-global-handles.cc
-handles.cc
-hashmap.cc
-heap.cc
-ic.cc
-jsregexp.cc
-log.cc
-mark-compact.cc
-messages.cc
-objects-debug.cc
-objects.cc
-parser.cc
-prettyprinter.cc
-property.cc
-rewriter.cc
-runtime.cc
-scanner.cc
-scopeinfo.cc
-scopes.cc
-serialize.cc
-snapshot-common.cc
-spaces.cc
-string-stream.cc
-stub-cache.cc
-token.cc
-top.cc
-unicode.cc
-usage-analyzer.cc
-utils.cc
-v8-counters.cc
-v8.cc
-v8threads.cc
-variables.cc
-zone.cc
-'''.split()
-
-
-PLATFORM_DEPENDENT_SOURCES = {
-  'arch:arm': ['assembler-arm.cc', 'builtins-arm.cc', 'codegen-arm.cc', 'cpu-arm.cc', 'disasm-arm.cc', 'frames-arm.cc', 'ic-arm.cc', 'macro-assembler-arm.cc', 'simulator-arm.cc', 'stub-cache-arm.cc'],
-  'arch:ia32': ['assembler-ia32.cc', 'builtins-ia32.cc', 'codegen-ia32.cc', 'cpu-ia32.cc', 'disasm-ia32.cc', 'frames-ia32.cc', 'ic-ia32.cc', 'macro-assembler-ia32.cc', 'simulator-ia32.cc', 'stub-cache-ia32.cc'],
-  'os:linux': ['platform-linux.cc'],
-  'os:macos': ['platform-macos.cc'],
+SOURCES = {
+  'all': [
+    'accessors.cc', 'allocation.cc', 'api.cc', 'assembler.cc', 'ast.cc',
+    'bootstrapper.cc', 'builtins.cc', 'checks.cc', 'code-stubs.cc',
+    'codegen.cc', 'compiler.cc', 'contexts.cc', 'conversions.cc',
+    'counters.cc', 'dateparser.cc', 'debug.cc', 'disassembler.cc',
+    'execution.cc', 'factory.cc', 'flags.cc', 'frames.cc',
+    'global-handles.cc', 'handles.cc', 'hashmap.cc', 'heap.cc', 'ic.cc',
+    'jsregexp.cc', 'log.cc', 'mark-compact.cc', 'messages.cc', 'objects.cc',
+    'parser.cc', 'property.cc', 'rewriter.cc', 'runtime.cc', 'scanner.cc',
+    'scopeinfo.cc', 'scopes.cc', 'serialize.cc', 'snapshot-common.cc',
+    'spaces.cc', 'string-stream.cc', 'stub-cache.cc', 'token.cc', 'top.cc',
+    'unicode.cc', 'usage-analyzer.cc', 'utils.cc', 'v8-counters.cc',
+    'v8.cc', 'v8threads.cc', 'variables.cc', 'zone.cc'
+  ],
+  'arch:arm':  ['assembler-arm.cc', 'builtins-arm.cc', 'codegen-arm.cc',
+      'cpu-arm.cc', 'disasm-arm.cc', 'frames-arm.cc', 'ic-arm.cc',
+      'macro-assembler-arm.cc', 'stub-cache-arm.cc'],
+  'arch:ia32': ['assembler-ia32.cc', 'builtins-ia32.cc', 'codegen-ia32.cc',
+      'cpu-ia32.cc', 'disasm-ia32.cc', 'frames-ia32.cc', 'ic-ia32.cc',
+      'macro-assembler-ia32.cc', 'stub-cache-ia32.cc'],
+  'simulator:arm': ['simulator-arm.cc'],
+  'os:linux':  ['platform-linux.cc'],
+  'os:macos':  ['platform-macos.cc'],
   'os:nullos': ['platform-nullos.cc'],
-  'os:win32': ['platform-win32.cc']
+  'os:win32':  ['platform-win32.cc'],
+  'mode:release': [],
+  'mode:debug': ['objects-debug.cc', 'prettyprinter.cc']
 }
 
 
@@ -262,66 +94,50 @@
   sys.exit(1)
 
 
-def ConfigureObject(env, input, **kw):
-  if library_type == 'static':
-    return env.StaticObject(input, **kw)
-  elif library_type == 'shared':
-    return env.SharedObject(input, **kw)
-  else:
-    return env.Object(input, **kw)
-
-
 def ConfigureObjectFiles():
   env = Environment()
-  options = BUILD_OPTIONS_MAP[toolchain][mode]['default']
-  env.Replace(**options)
+  env.Replace(**context.flags['v8'])
   env['BUILDERS']['JS2C'] = Builder(action=js2c.JS2C)
   env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET --logfile $LOGFILE')
 
   # Build the standard platform-independent source files.
-  source_files = PLATFORM_INDEPENDENT_SOURCES
-  source_files += PLATFORM_DEPENDENT_SOURCES["arch:%s" % arch]
-  source_files += PLATFORM_DEPENDENT_SOURCES["os:%s" % os]
-  full_source_files = [s for s in source_files]
+  source_files = context.GetRelevantSources(SOURCES)
 
   # Combine the JavaScript library files into a single C++ file and
   # compile it.
   library_files = [s for s in LIBRARY_FILES]
   library_files.append('macros.py')
   libraries_src, libraries_empty_src = env.JS2C(['libraries.cc', 'libraries-empty.cc'], library_files)
-  libraries_obj = ConfigureObject(env, libraries_src, CPPPATH=['.'])
+  libraries_obj = context.ConfigureObject(env, libraries_src, CPPPATH=['.'])
 
   # Build JSCRE.
   jscre_env = env.Copy()
-  jscre_options = BUILD_OPTIONS_MAP[toolchain][mode]['jscre']
-  jscre_env.Replace(**jscre_options)
+  jscre_env.Replace(**context.flags['jscre'])
   jscre_files = [join('third_party', 'jscre', s) for s in JSCRE_FILES]
-  jscre_obj = ConfigureObject(jscre_env, jscre_files)
+  jscre_obj = context.ConfigureObject(jscre_env, jscre_files)
 
   # Build dtoa.
   dtoa_env = env.Copy()
-  dtoa_options = BUILD_OPTIONS_MAP[toolchain][mode]['dtoa']
-  dtoa_env.Replace(**dtoa_options)
+  dtoa_env.Replace(**context.flags['dtoa'])
   dtoa_files = ['dtoa-config.c']
-  dtoa_obj = ConfigureObject(dtoa_env, dtoa_files)
+  dtoa_obj = context.ConfigureObject(dtoa_env, dtoa_files)
 
-  full_source_objs = ConfigureObject(env, full_source_files)
-  non_snapshot_files = [jscre_obj, dtoa_obj, full_source_objs]
-
+  source_objs = context.ConfigureObject(env, source_files)
+  non_snapshot_files = [jscre_obj, dtoa_obj, source_objs]
+  
   # Create snapshot if necessary.
-  empty_snapshot_obj = ConfigureObject(env, 'snapshot-empty.cc')
-  if use_snapshot:
+  empty_snapshot_obj = context.ConfigureObject(env, 'snapshot-empty.cc')
+  if context.use_snapshot:
     mksnapshot_src = 'mksnapshot.cc'
     mksnapshot = env.Program('mksnapshot', [mksnapshot_src, libraries_obj, non_snapshot_files, empty_snapshot_obj], PDB='mksnapshot.exe.pdb')
     snapshot_cc = env.Snapshot('snapshot.cc', mksnapshot, LOGFILE=File('snapshot.log').abspath)
-    snapshot_obj = ConfigureObject(env, snapshot_cc, CPPPATH=['.'])
-    libraries_obj = ConfigureObject(env, libraries_empty_src, CPPPATH=['.'])
+    snapshot_obj = context.ConfigureObject(env, snapshot_cc, CPPPATH=['.'])
+    libraries_obj = context.ConfigureObject(env, libraries_empty_src, CPPPATH=['.'])
   else:
     snapshot_obj = empty_snapshot_obj
 
-  # Return all the object files needed to link the library.
   return [non_snapshot_files, libraries_obj, snapshot_obj]
 
 
-object_files = ConfigureObjectFiles()
-Return('object_files')
+library_objects = ConfigureObjectFiles()
+Return('library_objects')
diff --git a/src/accessors.cc b/src/accessors.cc
index 8c5bf89..7c16dad 100644
--- a/src/accessors.cc
+++ b/src/accessors.cc
@@ -278,10 +278,8 @@
   if (function->has_initial_map()) {
     // If the function has allocated the initial map
     // replace it with a copy containing the new prototype.
-    Object* new_map = function->initial_map()->Copy();
+    Object* new_map = function->initial_map()->CopyDropTransitions();
     if (new_map->IsFailure()) return new_map;
-    Object* result = Map::cast(new_map)->EnsureNoMapTransitions();
-    if (result->IsFailure()) return result;
     function->set_initial_map(Map::cast(new_map));
   }
   Object* prototype = function->SetPrototype(value);
@@ -490,14 +488,12 @@
   }
 
   // Set the new prototype of the object.
-  Object* new_map = current->map()->Copy();
+  Object* new_map = current->map()->CopyDropTransitions();
   if (new_map->IsFailure()) return new_map;
-  Object* result = Map::cast(new_map)->EnsureNoMapTransitions();
-  if (result->IsFailure()) return result;
   Map::cast(new_map)->set_prototype(value);
   current->set_map(Map::cast(new_map));
 
-  // To be consistant with other Set functions, return the value.
+  // To be consistent with other Set functions, return the value.
   return value;
 }
 
diff --git a/src/accessors.h b/src/accessors.h
index d81a0bd..da1a037 100644
--- a/src/accessors.h
+++ b/src/accessors.h
@@ -47,7 +47,7 @@
   V(ScriptType)          \
   V(ObjectPrototype)
 
-// Accessors contains all prodefined proxy accessors.
+// Accessors contains all predefined proxy accessors.
 
 class Accessors : public AllStatic {
  public:
diff --git a/src/api.cc b/src/api.cc
index d8e72eb..5cd5238 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -223,6 +223,11 @@
 }
 
 
+void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) {
+  i::FlagList::SetFlagsFromCommandLine(argc, argv, remove_flags);
+}
+
+
 v8::Handle<Value> ThrowException(v8::Handle<v8::Value> value) {
   if (IsDeadCheck("v8::ThrowException()")) return v8::Handle<Value>();
   i::Top::ScheduleThrow(*Utils::OpenHandle(*value));
@@ -2098,7 +2103,7 @@
 
 
 const char* v8::V8::GetVersion() {
-  return "0.2.3";
+  return "0.2.4";
 }
 
 
diff --git a/src/api.h b/src/api.h
index 45701dc..cd81174 100644
--- a/src/api.h
+++ b/src/api.h
@@ -420,7 +420,7 @@
   char* RestoreThreadHelper(char* from);
   char* ArchiveThreadHelper(char* to);
 
-  DISALLOW_EVIL_CONSTRUCTORS(HandleScopeImplementer);
+  DISALLOW_COPY_AND_ASSIGN(HandleScopeImplementer);
 };
 
 
diff --git a/src/assembler-arm-inl.h b/src/assembler-arm-inl.h
index fbe8cce..6bc900a 100644
--- a/src/assembler-arm-inl.h
+++ b/src/assembler-arm-inl.h
@@ -1,29 +1,38 @@
-// Copyright 2007-2008 Google Inc. All Rights Reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
+// Copyright (c) 1994-2006 Sun Microsystems Inc.
+// All Rights Reserved.
 //
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-//       copyright notice, this list of conditions and the following
-//       disclaimer in the documentation and/or other materials provided
-//       with the distribution.
-//     * Neither the name of Google Inc. nor the names of its
-//       contributors may be used to endorse or promote products derived
-//       from this software without specific prior written permission.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// - Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// - Redistribution in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the
+// distribution.
+//
+// - Neither the name of Sun Microsystems or the names of contributors may
+// be used to endorse or promote products derived from this software without
+// specific prior written permission.
 //
 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+// OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The original source code covered by the above license above has been modified
+// significantly by Google Inc.
+// Copyright 2006-2008 Google Inc. All Rights Reserved.
 
 #ifndef V8_ASSEMBLER_ARM_INL_H_
 #define V8_ASSEMBLER_ARM_INL_H_
diff --git a/src/assembler-arm.cc b/src/assembler-arm.cc
index 70e7b42..de029cd 100644
--- a/src/assembler-arm.cc
+++ b/src/assembler-arm.cc
@@ -1,33 +1,43 @@
-// Copyright 2006-2008 Google Inc. All Rights Reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
+// Copyright (c) 1994-2006 Sun Microsystems Inc.
+// All Rights Reserved.
 //
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-//       copyright notice, this list of conditions and the following
-//       disclaimer in the documentation and/or other materials provided
-//       with the distribution.
-//     * Neither the name of Google Inc. nor the names of its
-//       contributors may be used to endorse or promote products derived
-//       from this software without specific prior written permission.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// - Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// - Redistribution in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the
+// distribution.
+//
+// - Neither the name of Sun Microsystems or the names of contributors may
+// be used to endorse or promote products derived from this software without
+// specific prior written permission.
 //
 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+// OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The original source code covered by the above license above has been modified
+// significantly by Google Inc.
+// Copyright 2006-2008 Google Inc. All Rights Reserved.
 
 #include "v8.h"
 
 #include "assembler-arm-inl.h"
+#include "serialize.h"
 
 namespace v8 { namespace internal {
 
@@ -1443,6 +1453,12 @@
     BlockConstPoolBefore(pc_offset() + kInstrSize);
   }
   if (rinfo.rmode() != no_reloc) {
+    // Don't record external references unless the heap will be serialized.
+    if (rmode == external_reference &&
+        !Serializer::enabled() &&
+        !FLAG_debug_code) {
+      return;
+    }
     ASSERT(buffer_space() >= kMaxRelocSize);  // too late to grow buffer here
     reloc_info_writer.Write(&rinfo);
   }
diff --git a/src/assembler-arm.h b/src/assembler-arm.h
index 43bedff..f8cdb00 100644
--- a/src/assembler-arm.h
+++ b/src/assembler-arm.h
@@ -1,29 +1,38 @@
-// Copyright 2007-2008 Google Inc. All Rights Reserved.
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
+// Copyright (c) 1994-2006 Sun Microsystems Inc.
+// All Rights Reserved.
 //
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-//       copyright notice, this list of conditions and the following
-//       disclaimer in the documentation and/or other materials provided
-//       with the distribution.
-//     * Neither the name of Google Inc. nor the names of its
-//       contributors may be used to endorse or promote products derived
-//       from this software without specific prior written permission.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+// - Redistributions of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// - Redistribution in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the
+// distribution.
+//
+// - Neither the name of Sun Microsystems or the names of contributors may
+// be used to endorse or promote products derived from this software without
+// specific prior written permission.
 //
 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+// OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The original source code covered by the above license above has been modified
+// significantly by Google Inc.
+// Copyright 2006-2008 Google Inc. All Rights Reserved.
 
 // A light-weight ARM Assembler
 // Generates user mode instructions for the ARM architecture up to version 5
diff --git a/src/assembler.h b/src/assembler.h
index 9eb0cea..33fc056 100644
--- a/src/assembler.h
+++ b/src/assembler.h
@@ -329,7 +329,7 @@
   byte* pos_;
   byte* last_pc_;
   intptr_t last_data_;
-  DISALLOW_EVIL_CONSTRUCTORS(RelocInfoWriter);
+  DISALLOW_COPY_AND_ASSIGN(RelocInfoWriter);
 };
 
 
@@ -388,7 +388,7 @@
   RelocInfo rinfo_;
   bool done_;
   int mode_mask_;
-  DISALLOW_EVIL_CONSTRUCTORS(RelocIterator);
+  DISALLOW_COPY_AND_ASSIGN(RelocIterator);
 };
 
 
diff --git a/src/ast.h b/src/ast.h
index 1a5e0e0..55dda26 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -660,12 +660,10 @@
   };
 
   ObjectLiteral(Handle<FixedArray> constant_properties,
-                Expression* result,
                 ZoneList<Property*>* properties,
                 int literal_index)
       : MaterializedLiteral(literal_index),
         constant_properties_(constant_properties),
-        result_(result),
         properties_(properties) {
   }
 
@@ -674,12 +672,10 @@
   Handle<FixedArray> constant_properties() const {
     return constant_properties_;
   }
-  Expression* result() const { return result_; }
   ZoneList<Property*>* properties() const { return properties_; }
 
  private:
   Handle<FixedArray> constant_properties_;
-  Expression* result_;
   ZoneList<Property*>* properties_;
 };
 
@@ -709,20 +705,17 @@
 class ArrayLiteral: public Expression {
  public:
   ArrayLiteral(Handle<FixedArray> literals,
-               Expression* result,
                ZoneList<Expression*>* values)
-      : literals_(literals), result_(result), values_(values) {
+      : literals_(literals), values_(values) {
   }
 
   virtual void Accept(Visitor* v);
 
   Handle<FixedArray> literals() const { return literals_; }
-  Expression* result() const { return result_; }
   ZoneList<Expression*>* values() const { return values_; }
 
  private:
   Handle<FixedArray> literals_;
-  Expression* result_;
   ZoneList<Expression*>* values_;
 };
 
@@ -1119,6 +1112,7 @@
                   Scope* scope,
                   ZoneList<Statement*>* body,
                   int materialized_literal_count,
+                  bool contains_array_literal,
                   int expected_property_count,
                   int num_parameters,
                   int start_position,
@@ -1128,6 +1122,7 @@
         scope_(scope),
         body_(body),
         materialized_literal_count_(materialized_literal_count),
+        contains_array_literal_(contains_array_literal),
         expected_property_count_(expected_property_count),
         num_parameters_(num_parameters),
         start_position_(start_position),
@@ -1151,6 +1146,7 @@
   bool is_expression() const { return is_expression_; }
 
   int materialized_literal_count() { return materialized_literal_count_; }
+  bool contains_array_literal() { return contains_array_literal_; }
   int expected_property_count() { return expected_property_count_; }
   int num_parameters() { return num_parameters_; }
 
@@ -1161,6 +1157,7 @@
   Scope* scope_;
   ZoneList<Statement*>* body_;
   int materialized_literal_count_;
+  bool contains_array_literal_;
   int expected_property_count_;
   int num_parameters_;
   int start_position_;
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index e480cd2..afb3d85 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -95,7 +95,7 @@
  private:
   ScriptType type_;
   FixedArray* cache_;
-  DISALLOW_EVIL_CONSTRUCTORS(SourceCodeCache);
+  DISALLOW_COPY_AND_ASSIGN(SourceCodeCache);
 };
 
 static SourceCodeCache natives_cache(SCRIPT_TYPE_NATIVE);
@@ -379,9 +379,9 @@
 
   // Add prototype.
   PropertyAttributes attributes = static_cast<PropertyAttributes>(
-       (make_prototype_enumerable ? 0 : DONT_ENUM)
-       | DONT_DELETE
-       | (make_prototype_read_only ? READ_ONLY : 0));
+      (make_prototype_enumerable ? 0 : DONT_ENUM)
+      | DONT_DELETE
+      | (make_prototype_read_only ? READ_ONLY : 0));
   result =
       Factory::CopyAppendProxyDescriptor(
           result,
@@ -481,8 +481,8 @@
 
     global_context()->set_initial_object_prototype(*prototype);
     SetPrototype(object_fun, prototype);
-    object_function_map->set_instance_descriptors(
-        DescriptorArray::cast(Heap::empty_fixed_array()));
+    object_function_map->
+      set_instance_descriptors(Heap::empty_descriptor_array());
   }
 
   // Allocate the empty function as the prototype for function ECMAScript
@@ -505,6 +505,7 @@
 
     // Allocate the function map first and then patch the prototype later
     Handle<Map> empty_fm = Factory::CopyMap(fm);
+    empty_fm->set_instance_descriptors(*function_map_descriptors);
     empty_fm->set_prototype(global_context()->object_function()->prototype());
     empty_function->set_map(*empty_fm);
   }
@@ -553,9 +554,11 @@
     // Set the global context for the global object.
     object->set_global_context(*global_context());
 
-    // Security setup. Set the security token of the global object to
-    // itself.
-    object->set_security_token(*object);
+    // Security setup: Set the security token of the global object to
+    // its global context. This makes the security check between two
+    // different contexts fail by default even in case of global
+    // object reinitialization.
+    object->set_security_token(*global_context());
 
     {  // --- G l o b a l   C o n t e x t ---
       // use the empty function as closure (no scope info)
@@ -766,8 +769,8 @@
   ASSERT(Top::context()->IsGlobalContext());
   Handle<Context> context =
       Handle<Context>(use_runtime_context
-                          ? Top::context()->runtime_context()
-                          : Top::context());
+                      ? Top::context()->runtime_context()
+                      : Top::context());
   Handle<JSFunction> fun =
       Factory::NewFunctionFromBoilerplate(boilerplate, context);
 
@@ -775,8 +778,8 @@
   // object as the receiver. Provide no parameters.
   Handle<Object> receiver =
       Handle<Object>(use_runtime_context
-                         ? Top::context()->builtins()
-                         : Top::context()->global());
+                     ? Top::context()->builtins()
+                     : Top::context()->global());
   bool has_pending_exception;
   Handle<Object> result =
       Execution::Call(fun, receiver, 0, NULL, &has_pending_exception);
@@ -1190,7 +1193,8 @@
         }
         case MAP_TRANSITION:
         case CONSTANT_TRANSITION:
-          // Ignore map transitions.
+        case NULL_DESCRIPTOR:
+          // Ignore non-properties.
           break;
         case NORMAL:
           // Do not occur since the from object has fast properties.
@@ -1244,7 +1248,7 @@
 
   // Transfer the prototype (new map is needed).
   Handle<Map> old_to_map = Handle<Map>(to->map());
-  Handle<Map> new_to_map = Factory::CopyMap(old_to_map);
+  Handle<Map> new_to_map = Factory::CopyMapDropTransitions(old_to_map);
   new_to_map->set_prototype(from->map()->prototype());
   to->set_map(*new_to_map);
 }
diff --git a/src/builtins.cc b/src/builtins.cc
index b51c39b..9f95322 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -352,7 +352,7 @@
   HandleScope scope;
 
   // TODO(1238487): This is not nice. We need to get rid of this
-  // retarded behavior and start handling API calls in a more direct
+  // kludgy behavior and start handling API calls in a more direct
   // way - maybe compile specialized stubs lazily?.
 #ifdef USE_OLD_CALLING_CONVENTIONS
   Handle<JSFunction> function =
diff --git a/src/builtins.h b/src/builtins.h
index 603ea48..4e04bbc 100644
--- a/src/builtins.h
+++ b/src/builtins.h
@@ -101,7 +101,6 @@
   V(ADD, 1)                    \
   V(SUB, 1)                    \
   V(MUL, 1)                    \
-  V(MULNEG, 1)                 \
   V(DIV, 1)                    \
   V(MOD, 1)                    \
   V(INC, 0)                    \
diff --git a/src/codegen-arm.cc b/src/codegen-arm.cc
index da7c73f..b71c702 100644
--- a/src/codegen-arm.cc
+++ b/src/codegen-arm.cc
@@ -1084,6 +1084,12 @@
       case Token::SUB: return "GenericBinaryOpStub_SUB";
       case Token::MUL: return "GenericBinaryOpStub_MUL";
       case Token::DIV: return "GenericBinaryOpStub_DIV";
+      case Token::BIT_OR: return "GenericBinaryOpStub_BIT_OR";
+      case Token::BIT_AND: return "GenericBinaryOpStub_BIT_AND";
+      case Token::BIT_XOR: return "GenericBinaryOpStub_BIT_XOR";
+      case Token::SAR: return "GenericBinaryOpStub_SAR";
+      case Token::SHL: return "GenericBinaryOpStub_SHL";
+      case Token::SHR: return "GenericBinaryOpStub_SHR";
       default:         return "GenericBinaryOpStub";
     }
   }
@@ -1175,75 +1181,104 @@
       __ bind(&exit);
       break;
     }
+
+    case Token::BIT_OR:
+    case Token::BIT_AND:
+    case Token::BIT_XOR: {
+      Label slow, exit;
+      // tag check
+      __ orr(r2, r1, Operand(r0));  // r2 = x | y;
+      ASSERT(kSmiTag == 0);  // adjust code below
+      __ tst(r2, Operand(kSmiTagMask));
+      __ b(ne, &slow);
+      switch (op_) {
+        case Token::BIT_OR:  __ orr(r0, r0, Operand(r1)); break;
+        case Token::BIT_AND: __ and_(r0, r0, Operand(r1)); break;
+        case Token::BIT_XOR: __ eor(r0, r0, Operand(r1)); break;
+        default: UNREACHABLE();
+      }
+      __ b(&exit);
+      __ bind(&slow);
+      __ push(r1);  // restore stack
+      __ push(r0);
+      __ mov(r0, Operand(1));  // 1 argument (not counting receiver).
+      switch (op_) {
+        case Token::BIT_OR:  __ InvokeBuiltin("BIT_OR",  1, JUMP_JS); break;
+        case Token::BIT_AND: __ InvokeBuiltin("BIT_AND", 1, JUMP_JS); break;
+        case Token::BIT_XOR: __ InvokeBuiltin("BIT_XOR", 1, JUMP_JS); break;
+        default: UNREACHABLE();
+      }
+      __ bind(&exit);
+      break;
+    }
+
+    case Token::SHL:
+    case Token::SHR:
+    case Token::SAR: {
+      Label slow, exit;
+      // tag check
+      __ orr(r2, r1, Operand(r0));  // r2 = x | y;
+      ASSERT(kSmiTag == 0);  // adjust code below
+      __ tst(r2, Operand(kSmiTagMask));
+      __ b(ne, &slow);
+      // remove tags from operands (but keep sign)
+      __ mov(r3, Operand(r1, ASR, kSmiTagSize));  // x
+      __ mov(r2, Operand(r0, ASR, kSmiTagSize));  // y
+      // use only the 5 least significant bits of the shift count
+      __ and_(r2, r2, Operand(0x1f));
+      // perform operation
+      switch (op_) {
+        case Token::SAR:
+          __ mov(r3, Operand(r3, ASR, r2));
+          // no checks of result necessary
+          break;
+
+        case Token::SHR:
+          __ mov(r3, Operand(r3, LSR, r2));
+          // check that the *unsigned* result fits in a smi
+          // neither of the two high-order bits can be set:
+          // - 0x80000000: high bit would be lost when smi tagging
+          // - 0x40000000: this number would convert to negative when
+          // smi tagging these two cases can only happen with shifts
+          // by 0 or 1 when handed a valid smi
+          __ and_(r2, r3, Operand(0xc0000000), SetCC);
+          __ b(ne, &slow);
+          break;
+
+        case Token::SHL:
+          __ mov(r3, Operand(r3, LSL, r2));
+          // check that the *signed* result fits in a smi
+          __ add(r2, r3, Operand(0x40000000), SetCC);
+          __ b(mi, &slow);
+          break;
+
+        default: UNREACHABLE();
+      }
+      // tag result and store it in r0
+      ASSERT(kSmiTag == 0);  // adjust code below
+      __ mov(r0, Operand(r3, LSL, kSmiTagSize));
+      __ b(&exit);
+      // slow case
+      __ bind(&slow);
+      __ push(r1);  // restore stack
+      __ push(r0);
+      __ mov(r0, Operand(1));  // 1 argument (not counting receiver).
+      switch (op_) {
+        case Token::SAR: __ InvokeBuiltin("SAR", 1, JUMP_JS); break;
+        case Token::SHR: __ InvokeBuiltin("SHR", 1, JUMP_JS); break;
+        case Token::SHL: __ InvokeBuiltin("SHL", 1, JUMP_JS); break;
+        default: UNREACHABLE();
+      }
+      __ bind(&exit);
+      break;
+    }
+
     default: UNREACHABLE();
   }
   __ Ret();
 }
 
 
-class SmiOpStub : public CodeStub {
- public:
-  SmiOpStub(Token::Value op, bool reversed)
-      : op_(op), reversed_(reversed) {}
-
- private:
-  Token::Value op_;
-  bool reversed_;
-
-  Major MajorKey() { return SmiOp; }
-  int MinorKey() {
-    return (op_ == Token::ADD ? 2 : 0) | (reversed_ ? 1 : 0);
-  }
-  void Generate(MacroAssembler* masm);
-  void GenerateShared(MacroAssembler* masm);
-
-  const char* GetName() { return "SmiOpStub"; }
-
-#ifdef DEBUG
-  void Print() {
-    PrintF("SmiOpStub (token %s), (reversed %s)\n",
-           Token::String(op_), reversed_ ? "true" : "false");
-  }
-#endif
-};
-
-
-void SmiOpStub::Generate(MacroAssembler* masm) {
-  switch (op_) {
-    case Token::ADD: {
-      if (!reversed_) {
-        __ sub(r0, r0, Operand(r1));  // revert optimistic add
-        __ push(r0);
-        __ push(r1);
-        __ mov(r0, Operand(1));  // set number of arguments
-        __ InvokeBuiltin("ADD", 1, JUMP_JS);
-      } else {
-        __ sub(r0, r0, Operand(r1));  // revert optimistic add
-        __ push(r1);  // reversed
-        __ push(r0);
-        __ mov(r0, Operand(1));  // set number of arguments
-        __ InvokeBuiltin("ADD", 1, JUMP_JS);
-      }
-      break;
-    }
-    case Token::SUB: {
-      if (!reversed_) {
-        __ push(r0);
-        __ push(r1);
-        __ mov(r0, Operand(1));  // set number of arguments
-        __ InvokeBuiltin("SUB", 1, JUMP_JS);
-      } else {
-        __ push(r1);
-        __ push(r0);
-        __ mov(r0, Operand(1));  // set number of arguments
-        __ InvokeBuiltin("SUB", 1, JUMP_JS);
-      }
-      break;
-    }
-    default: UNREACHABLE();
-  }
-}
-
 void StackCheckStub::Generate(MacroAssembler* masm) {
   Label within_limit;
   __ mov(ip, Operand(ExternalReference::address_of_stack_guard_limit()));
@@ -1866,7 +1901,13 @@
   switch (op) {
     case Token::ADD:  // fall through.
     case Token::SUB:  // fall through.
-    case Token::MUL: {
+    case Token::MUL:
+    case Token::BIT_OR:
+    case Token::BIT_AND:
+    case Token::BIT_XOR:
+    case Token::SHL:
+    case Token::SHR:
+    case Token::SAR: {
       __ pop(r0);  // r0 : y
       __ pop(r1);  // r1 : x
       GenericBinaryOpStub stub(op);
@@ -1886,104 +1927,6 @@
       break;
     }
 
-    case Token::BIT_OR:
-    case Token::BIT_AND:
-    case Token::BIT_XOR: {
-      Label slow, exit;
-      __ pop(r0);  // get y
-      __ pop(r1);  // get x
-      // tag check
-      __ orr(r2, r1, Operand(r0));  // r2 = x | y;
-      ASSERT(kSmiTag == 0);  // adjust code below
-      __ tst(r2, Operand(kSmiTagMask));
-      __ b(ne, &slow);
-      switch (op) {
-        case Token::BIT_OR:  __ orr(r0, r0, Operand(r1)); break;
-        case Token::BIT_AND: __ and_(r0, r0, Operand(r1)); break;
-        case Token::BIT_XOR: __ eor(r0, r0, Operand(r1)); break;
-        default: UNREACHABLE();
-      }
-      __ b(&exit);
-      __ bind(&slow);
-      __ push(r1);  // restore stack
-      __ push(r0);
-      __ mov(r0, Operand(1));  // 1 argument (not counting receiver).
-      switch (op) {
-        case Token::BIT_OR:  __ InvokeBuiltin("BIT_OR",  1, CALL_JS); break;
-        case Token::BIT_AND: __ InvokeBuiltin("BIT_AND", 1, CALL_JS); break;
-        case Token::BIT_XOR: __ InvokeBuiltin("BIT_XOR", 1, CALL_JS); break;
-        default: UNREACHABLE();
-      }
-      __ bind(&exit);
-      break;
-    }
-
-    case Token::SHL:
-    case Token::SHR:
-    case Token::SAR: {
-      Label slow, exit;
-      __ pop(r1);  // get y
-      __ pop(r0);  // get x
-      // tag check
-      __ orr(r2, r1, Operand(r0));  // r2 = x | y;
-      ASSERT(kSmiTag == 0);  // adjust code below
-      __ tst(r2, Operand(kSmiTagMask));
-      __ b(ne, &slow);
-       // get copies of operands
-      __ mov(r3, Operand(r0));
-      __ mov(r2, Operand(r1));
-      // remove tags from operands (but keep sign)
-      __ mov(r3, Operand(r3, ASR, kSmiTagSize));
-      __ mov(r2, Operand(r2, ASR, kSmiTagSize));
-      // use only the 5 least significant bits of the shift count
-      __ and_(r2, r2, Operand(0x1f));
-      // perform operation
-      switch (op) {
-        case Token::SAR:
-          __ mov(r3, Operand(r3, ASR, r2));
-          // no checks of result necessary
-          break;
-
-        case Token::SHR:
-          __ mov(r3, Operand(r3, LSR, r2));
-          // check that the *unsigned* result fits in a smi
-          // neither of the two high-order bits can be set:
-          // - 0x80000000: high bit would be lost when smi tagging
-          // - 0x40000000: this number would convert to negative when
-          // smi tagging these two cases can only happen with shifts
-          // by 0 or 1 when handed a valid smi
-          __ and_(r2, r3, Operand(0xc0000000), SetCC);
-          __ b(ne, &slow);
-          break;
-
-        case Token::SHL:
-          __ mov(r3, Operand(r3, LSL, r2));
-          // check that the *signed* result fits in a smi
-          __ add(r2, r3, Operand(0x40000000), SetCC);
-          __ b(mi, &slow);
-          break;
-
-        default: UNREACHABLE();
-      }
-      // tag result and store it in r0
-      ASSERT(kSmiTag == 0);  // adjust code below
-      __ mov(r0, Operand(r3, LSL, kSmiTagSize));
-      __ b(&exit);
-      // slow case
-      __ bind(&slow);
-      __ push(r0);  // restore stack
-      __ push(r1);
-      __ mov(r0, Operand(1));  // 1 argument (not counting receiver).
-      switch (op) {
-        case Token::SAR: __ InvokeBuiltin("SAR", 1, CALL_JS); break;
-        case Token::SHR: __ InvokeBuiltin("SHR", 1, CALL_JS); break;
-        case Token::SHL: __ InvokeBuiltin("SHL", 1, CALL_JS); break;
-        default: UNREACHABLE();
-      }
-      __ bind(&exit);
-      break;
-    }
-
     case Token::COMMA:
       __ pop(r0);
       // simply discard left value
@@ -1998,6 +1941,82 @@
 }
 
 
+class DeferredInlinedSmiOperation: public DeferredCode {
+ public:
+  DeferredInlinedSmiOperation(CodeGenerator* generator, Token::Value op,
+                              int value, bool reversed) :
+      DeferredCode(generator), op_(op), value_(value), reversed_(reversed) {
+    set_comment("[ DeferredInlinedSmiOperation");
+  }
+
+  virtual void Generate() {
+    switch (op_) {
+      case Token::ADD: {
+        if (reversed_) {
+          // revert optimistic add
+          __ sub(r0, r0, Operand(Smi::FromInt(value_)));
+          __ mov(r1, Operand(Smi::FromInt(value_)));  // x
+        } else {
+          // revert optimistic add
+          __ sub(r1, r0, Operand(Smi::FromInt(value_)));
+          __ mov(r0, Operand(Smi::FromInt(value_)));
+        }
+        break;
+      }
+
+      case Token::SUB: {
+        if (reversed_) {
+          // revert optimistic sub
+          __ rsb(r0, r0, Operand(Smi::FromInt(value_)));
+          __ mov(r1, Operand(Smi::FromInt(value_)));
+        } else {
+          __ add(r1, r0, Operand(Smi::FromInt(value_)));
+          __ mov(r0, Operand(Smi::FromInt(value_)));
+        }
+        break;
+      }
+
+      case Token::BIT_OR:
+      case Token::BIT_XOR:
+      case Token::BIT_AND: {
+        if (reversed_) {
+          __ mov(r1, Operand(Smi::FromInt(value_)));
+        } else {
+          __ mov(r1, Operand(r0));
+          __ mov(r0, Operand(Smi::FromInt(value_)));
+        }
+        break;
+      }
+
+      case Token::SHL:
+      case Token::SHR:
+      case Token::SAR: {
+        if (!reversed_) {
+          __ mov(r1, Operand(r0));
+          __ mov(r0, Operand(Smi::FromInt(value_)));
+        } else {
+          UNREACHABLE();  // should have been handled in SmiOperation
+        }
+        break;
+      }
+
+      default:
+        // other cases should have been handled before this point.
+        UNREACHABLE();
+        break;
+    }
+
+    GenericBinaryOpStub igostub(op_);
+    __ CallStub(&igostub);
+  }
+
+ private:
+  Token::Value op_;
+  int value_;
+  bool reversed_;
+};
+
+
 void ArmCodeGenerator::SmiOperation(Token::Value op,
                                     Handle<Object> value,
                                     bool reversed) {
@@ -2010,45 +2029,108 @@
 
   // sp[0] : operand
 
-  ASSERT(value->IsSmi());
+  int int_value = Smi::cast(*value)->value();
 
   Label exit;
   __ pop(r0);
 
   switch (op) {
     case Token::ADD: {
-      Label slow;
+      DeferredCode* deferred =
+        new DeferredInlinedSmiOperation(this, op, int_value, reversed);
 
-      __ mov(r1, Operand(value));
-      __ add(r0, r0, Operand(r1), SetCC);
-      __ b(vs, &slow);
+      __ add(r0, r0, Operand(value), SetCC);
+      __ b(vs, deferred->enter());
       __ tst(r0, Operand(kSmiTagMask));
-      __ b(eq, &exit);
-      __ bind(&slow);
-
-      SmiOpStub stub(Token::ADD, reversed);
-      __ CallStub(&stub);
+      __ b(ne, deferred->enter());
+      __ bind(deferred->exit());
       break;
     }
 
     case Token::SUB: {
-      Label slow;
+      DeferredCode* deferred =
+        new DeferredInlinedSmiOperation(this, op, int_value, reversed);
 
-      __ mov(r1, Operand(value));
       if (!reversed) {
-        __ sub(r2, r0, Operand(r1), SetCC);
+        __ sub(r0, r0, Operand(value), SetCC);
       } else {
-        __ rsb(r2, r0, Operand(r1), SetCC);
+        __ rsb(r0, r0, Operand(value), SetCC);
       }
-      __ b(vs, &slow);
-      __ tst(r2, Operand(kSmiTagMask));
-      __ mov(r0, Operand(r2), LeaveCC, eq);  // conditionally set r0 to result
-      __ b(eq, &exit);
+      __ b(vs, deferred->enter());
+      __ tst(r0, Operand(kSmiTagMask));
+      __ b(ne, deferred->enter());
+      __ bind(deferred->exit());
+      break;
+    }
 
-      __ bind(&slow);
+    case Token::BIT_OR:
+    case Token::BIT_XOR:
+    case Token::BIT_AND: {
+      DeferredCode* deferred =
+        new DeferredInlinedSmiOperation(this, op, int_value, reversed);
+      __ tst(r0, Operand(kSmiTagMask));
+      __ b(ne, deferred->enter());
+      switch (op) {
+        case Token::BIT_OR:  __ orr(r0, r0, Operand(value)); break;
+        case Token::BIT_XOR: __ eor(r0, r0, Operand(value)); break;
+        case Token::BIT_AND: __ and_(r0, r0, Operand(value)); break;
+        default: UNREACHABLE();
+      }
+      __ bind(deferred->exit());
+      break;
+    }
 
-      SmiOpStub stub(Token::SUB, reversed);
-      __ CallStub(&stub);
+    case Token::SHL:
+    case Token::SHR:
+    case Token::SAR: {
+      if (reversed) {
+        __ mov(ip, Operand(value));
+        __ push(ip);
+        __ push(r0);
+        GenericBinaryOperation(op);
+
+      } else {
+        int shift_value = int_value & 0x1f;  // least significant 5 bits
+        DeferredCode* deferred =
+          new DeferredInlinedSmiOperation(this, op, shift_value, false);
+        __ tst(r0, Operand(kSmiTagMask));
+        __ b(ne, deferred->enter());
+        __ mov(r2, Operand(r0, ASR, kSmiTagSize));  // remove tags
+        switch (op) {
+          case Token::SHL: {
+            __ mov(r2, Operand(r2, LSL, shift_value));
+            // check that the *unsigned* result fits in a smi
+            __ add(r3, r2, Operand(0x40000000), SetCC);
+            __ b(mi, deferred->enter());
+            break;
+          }
+          case Token::SHR: {
+            // LSR by immediate 0 means shifting 32 bits.
+            if (shift_value != 0) {
+              __ mov(r2, Operand(r2, LSR, shift_value));
+            }
+            // check that the *unsigned* result fits in a smi
+            // neither of the two high-order bits can be set:
+            // - 0x80000000: high bit would be lost when smi tagging
+            // - 0x40000000: this number would convert to negative when
+            // smi tagging these two cases can only happen with shifts
+            // by 0 or 1 when handed a valid smi
+            __ and_(r3, r2, Operand(0xc0000000), SetCC);
+            __ b(ne, deferred->enter());
+            break;
+          }
+          case Token::SAR: {
+            if (shift_value != 0) {
+              // ASR by immediate 0 means shifting 32 bits.
+              __ mov(r2, Operand(r2, ASR, shift_value));
+            }
+            break;
+          }
+          default: UNREACHABLE();
+        }
+        __ mov(r0, Operand(r2, LSL, kSmiTagSize));
+        __ bind(deferred->exit());
+      }
       break;
     }
 
@@ -2176,7 +2258,7 @@
   // Slow-case: Non-function called.
   masm->bind(&slow);
   masm->mov(r0, Operand(argc_));  // Setup the number of arguments.
-  masm->InvokeBuiltin("CALL_NON_FUNCTION", 0, JUMP_JS);
+  masm->InvokeBuiltin("CALL_NON_FUNCTION", argc_, JUMP_JS);
 }
 
 
@@ -3354,8 +3436,24 @@
 
 void ArmCodeGenerator::VisitArrayLiteral(ArrayLiteral* node) {
   Comment cmnt(masm_, "[ ArrayLiteral");
-  // Load the resulting object.
-  Load(node->result());
+
+  // Call runtime to create the array literal.
+  __ mov(r0, Operand(node->literals()));
+  __ push(r0);
+  // TODO(1332579): The second argument to CreateArrayLiteral is
+  // supposed to be the literals array of the function of this frame.
+  // Until the new ARM calling convention is in place, that function
+  // is not always available.  Therefore, on ARM we pass in the hole
+  // until the new calling convention is in place.
+  __ mov(r0, Operand(Factory::the_hole_value()));
+  __ push(r0);
+  __ CallRuntime(Runtime::kCreateArrayLiteral, 2);
+
+  // Push the resulting array literal on the stack.
+  __ push(r0);
+
+  // Generate code to set the elements in the array that are not
+  // literals.
   for (int i = 0; i < node->values()->length(); i++) {
     Expression* value = node->values()->at(i);
 
@@ -4072,12 +4170,17 @@
         __ mov(r0, Operand(Factory::undefined_value()));
         break;
 
-      case Token::ADD:
+      case Token::ADD: {
+        // Smi check.
+        Label continue_label;
+        __ tst(r0, Operand(kSmiTagMask));
+        __ b(eq, &continue_label);
         __ push(r0);
         __ mov(r0, Operand(0));  // not counting receiver
         __ InvokeBuiltin("TO_NUMBER", 0, CALL_JS);
+        __ bind(&continue_label);
         break;
-
+      }
       default:
         UNREACHABLE();
     }
diff --git a/src/codegen-ia32.cc b/src/codegen-ia32.cc
index bec5ab4..3e55e8c 100644
--- a/src/codegen-ia32.cc
+++ b/src/codegen-ia32.cc
@@ -189,8 +189,6 @@
   void UnloadReference(Reference* ref);
   friend class Reference;
 
-  bool TryDeferNegate(Expression* x);
-
   // State
   bool has_cc() const  { return cc_reg_ >= 0; }
   CodeGenState::AccessType access() const  { return state_->access(); }
@@ -256,12 +254,14 @@
 
   void GenericBinaryOperation(
       Token::Value op,
-      const OverwriteMode overwrite_mode = NO_OVERWRITE,
-      bool negate_result = false);
+      const OverwriteMode overwrite_mode = NO_OVERWRITE);
   void Comparison(Condition cc, bool strict = false);
 
+  // Inline small integer literals. To prevent long attacker-controlled byte
+  // sequences, we only inline small Smi:s.
+  static const int kMaxSmiInlinedBits = 16;
+  bool IsInlineSmi(Literal* literal);
   void SmiComparison(Condition cc,  Handle<Object> value, bool strict = false);
-
   void SmiOperation(Token::Value op,
                     Handle<Object> value,
                     bool reversed,
@@ -1080,35 +1080,31 @@
 
 class GenericBinaryOpStub: public CodeStub {
  public:
-  GenericBinaryOpStub(Token::Value op, OverwriteMode mode, bool negate_result)
-      : op_(op), mode_(mode), negate_result_(negate_result) { }
+  GenericBinaryOpStub(Token::Value op, OverwriteMode mode)
+      : op_(op), mode_(mode) { }
 
  private:
   Token::Value op_;
   OverwriteMode mode_;
-  bool negate_result_;
 
   const char* GetName();
 
 #ifdef DEBUG
   void Print() {
-    PrintF("GenericBinaryOpStub (op %s), (mode %d), (negate_result %s)\n",
+    PrintF("GenericBinaryOpStub (op %s), (mode %d)\n",
            Token::String(op_),
-           static_cast<int>(mode_),
-           negate_result_ ? "true" : "false");
+           static_cast<int>(mode_));
   }
 #endif
 
-  // Minor key encoding in 16 bits OOOOOOOOOOOOOMMN.
-  class NegateBits: public BitField<bool, 0, 1> {};
-  class ModeBits: public BitField<OverwriteMode, 1, 2> {};
-  class OpBits: public BitField<Token::Value, 3, 13> {};
+  // Minor key encoding in 16 bits OOOOOOOOOOOOOOMM.
+  class ModeBits: public BitField<OverwriteMode, 0, 2> {};
+  class OpBits: public BitField<Token::Value, 2, 14> {};
 
   Major MajorKey() { return GenericBinaryOp; }
   int MinorKey() {
-    // Encode the three parameters in a unique 16 bit value.
-    return NegateBits::encode(negate_result_) |
-           OpBits::encode(op_) |
+    // Encode the parameters in a unique 16 bit value.
+    return OpBits::encode(op_) |
            ModeBits::encode(mode_);
   }
   void Generate(MacroAssembler* masm);
@@ -1134,7 +1130,6 @@
 
 void GenericBinaryOpStub::Generate(MacroAssembler* masm) {
   Label call_runtime;
-  if (negate_result_ && op_ != Token::MUL) UNIMPLEMENTED();
   __ mov(eax, Operand(esp, 1 * kPointerSize));  // Get y.
   __ mov(edx, Operand(esp, 2 * kPointerSize));  // Get x.
 
@@ -1209,13 +1204,6 @@
       __ j(overflow, &non_smi_result, not_taken);
       // ...but operands OK for float arithmetic.
 
-      if (negate_result_) {
-        __ xor_(ecx, Operand(ecx));
-        __ sub(ecx, Operand(eax));
-        // Go slow on overflows.
-        __ j(overflow, &non_smi_result, not_taken);
-        __ mov(eax, Operand(ecx));
-      }
       // If the result is +0 we may need to check if the result should
       // really be -0. Welcome to the -0 fan club.
       __ NegativeZeroTest(eax, ebx, edx, ecx, &non_smi_result);
@@ -1355,7 +1343,6 @@
         case Token::DIV: __ fdivp(1); break;
         default: UNREACHABLE();
       }
-      if (negate_result_) __ fchs();
       __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
       __ ret(2 * kPointerSize);
     }
@@ -1468,9 +1455,7 @@
       __ InvokeBuiltin(Builtins::SUB, JUMP_FUNCTION);
       break;
     case Token::MUL:
-      __ InvokeBuiltin(negate_result_ ? Builtins::MULNEG
-                                      : Builtins::MUL,
-                       JUMP_FUNCTION);
+      __ InvokeBuiltin(Builtins::MUL, JUMP_FUNCTION);
         break;
     case Token::DIV:
       __ InvokeBuiltin(Builtins::DIV, JUMP_FUNCTION);
@@ -1588,10 +1573,11 @@
   Label undo;
   Label slow;
   Label done;
+  Label try_float;
 
-  // Enter runtime system if the value is not a smi.
+  // Check whether the value is a smi.
   __ test(eax, Immediate(kSmiTagMask));
-  __ j(not_zero, &slow, not_taken);
+  __ j(not_zero, &try_float, not_taken);
 
   // Enter runtime system if the value of the expression is zero
   // to make sure that we switch between 0 and -0.
@@ -1609,7 +1595,7 @@
   __ test(eax, Immediate(kSmiTagMask));
   __ j(zero, &done, taken);
 
-  // Undo optimistic sub and enter runtime system.
+  // Restore eax and enter runtime system.
   __ bind(&undo);
   __ mov(eax, Operand(edx));
 
@@ -1620,6 +1606,19 @@
   __ push(ecx);  // push return address
   __ InvokeBuiltin(Builtins::UNARY_MINUS, JUMP_FUNCTION);
 
+  // Try floating point case.
+  __ bind(&try_float);
+  __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset));
+  __ cmp(edx, Factory::heap_number_map());
+  __ j(not_equal, &slow);
+  __ mov(edx, Operand(eax));
+  // edx: operand
+  FloatingPointHelper::AllocateHeapNumber(masm, &undo, ebx, ecx);
+  // eax: allocated 'empty' number
+  __ fld_d(FieldOperand(edx, HeapNumber::kValueOffset));
+  __ fchs();
+  __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
+
   __ bind(&done);
 
   masm->StubReturn(1);
@@ -1725,18 +1724,16 @@
 
 
 void Ia32CodeGenerator::GenericBinaryOperation(Token::Value op,
-                                               OverwriteMode overwrite_mode,
-                                               bool negate_result) {
+                                               OverwriteMode overwrite_mode) {
   Comment cmnt(masm_, "[ BinaryOperation");
   Comment cmnt_token(masm_, Token::String(op));
-  if (negate_result && op != Token::MUL) UNIMPLEMENTED();
   switch (op) {
     case Token::ADD:
     case Token::SUB:
     case Token::MUL:
     case Token::DIV:
     case Token::MOD: {
-      GenericBinaryOpStub stub(op, overwrite_mode, negate_result);
+      GenericBinaryOpStub stub(op, overwrite_mode);
       __ CallStub(&stub);
       __ push(eax);
       break;
@@ -1763,7 +1760,7 @@
       __ bind(&slow);
       __ push(edx);  // restore stack slots
       __ push(eax);
-      GenericBinaryOpStub stub(op, overwrite_mode, false);
+      GenericBinaryOpStub stub(op, overwrite_mode);
       __ CallStub(&stub);
       __ bind(&exit);
       __ push(eax);  // push the result to the stack
@@ -1821,7 +1818,7 @@
       __ bind(&slow);
       __ push(eax);  // restore stack
       __ push(edx);
-        GenericBinaryOpStub stub(op, overwrite_mode, false);
+        GenericBinaryOpStub stub(op, overwrite_mode);
       __ CallStub(&stub);
       __ bind(&exit);
       __ push(eax);
@@ -1851,7 +1848,7 @@
   virtual void Generate() {
     __ push(eax);
     __ push(Immediate(Smi::FromInt(value_)));
-    GenericBinaryOpStub igostub(op_, overwrite_mode_, false);
+    GenericBinaryOpStub igostub(op_, overwrite_mode_);
     __ CallStub(&igostub);
   }
 
@@ -1874,7 +1871,7 @@
   virtual void Generate() {
     __ push(Immediate(Smi::FromInt(value_)));
     __ push(eax);
-    GenericBinaryOpStub igostub(op_, overwrite_mode_, false);
+    GenericBinaryOpStub igostub(op_, overwrite_mode_);
     __ CallStub(&igostub);
   }
 
@@ -1899,7 +1896,7 @@
     __ sub(Operand(eax), immediate);
     __ push(eax);
     __ push(immediate);
-    GenericBinaryOpStub igostub(Token::ADD, overwrite_mode_, false);
+    GenericBinaryOpStub igostub(Token::ADD, overwrite_mode_);
     __ CallStub(&igostub);
   }
 
@@ -1923,7 +1920,7 @@
     __ sub(Operand(eax), immediate);
     __ push(immediate);
     __ push(eax);
-    GenericBinaryOpStub igostub(Token::ADD, overwrite_mode_, false);
+    GenericBinaryOpStub igostub(Token::ADD, overwrite_mode_);
     __ CallStub(&igostub);
   }
 
@@ -1947,7 +1944,7 @@
     __ add(Operand(eax), immediate);
     __ push(eax);
     __ push(immediate);
-    GenericBinaryOpStub igostub(Token::SUB, overwrite_mode_, false);
+    GenericBinaryOpStub igostub(Token::SUB, overwrite_mode_);
     __ CallStub(&igostub);
   }
 
@@ -1973,7 +1970,7 @@
     __ add(eax, Operand(tos_reg_));
     __ push(eax);
     __ push(Operand(tos_reg_));
-    GenericBinaryOpStub igostub(Token::SUB, overwrite_mode_, false);
+    GenericBinaryOpStub igostub(Token::SUB, overwrite_mode_);
     __ CallStub(&igostub);
   }
 
@@ -1999,6 +1996,7 @@
 
   // Get the literal value.
   int int_value = Smi::cast(*value)->value();
+  ASSERT(is_intn(int_value, kMaxSmiInlinedBits));
 
   switch (op) {
     case Token::ADD: {
@@ -2363,8 +2361,11 @@
   // Strict only makes sense for equality comparisons.
   ASSERT(!strict || cc == equal);
 
+  int int_value = Smi::cast(*value)->value();
+  ASSERT(is_intn(int_value, kMaxSmiInlinedBits));
+
   SmiComparisonDeferred* deferred =
-      new SmiComparisonDeferred(this, cc, strict, Smi::cast(*value)->value());
+      new SmiComparisonDeferred(this, cc, strict, int_value);
   __ pop(eax);
   __ test(eax, Immediate(kSmiTagMask));
   __ j(not_zero, deferred->enter(), not_taken);
@@ -2821,6 +2822,7 @@
 
   // body
   __ bind(&loop);
+  CheckStack();  // TODO(1222600): ignore if body contains calls.
   Visit(node->body());
 
   // next
@@ -2838,13 +2840,11 @@
   __ bind(&entry);
   switch (info) {
     case ALWAYS_TRUE:
-      CheckStack();  // TODO(1222600): ignore if body contains calls.
       __ jmp(&loop);
       break;
     case ALWAYS_FALSE:
       break;
     case DONT_KNOW:
-      CheckStack();  // TODO(1222600): ignore if body contains calls.
       LoadCondition(node->cond(), CodeGenState::LOAD, &loop,
                     node->break_target(), true);
       Branch(true, &loop);
@@ -2971,9 +2971,6 @@
   __ mov(eax, Operand(esp, 0 * kPointerSize));  // load the current count
   __ cmp(eax, Operand(esp, kPointerSize));  // compare to the array length
   __ j(above_equal, &cleanup);
-  // TODO(1222589): remove redundant load here, which is only needed in
-  // PUSH_TOS/POP_TOS mode
-  __ mov(eax, Operand(esp, 0 * kPointerSize));  // load the current count
 
   // Get the i'th entry of the array.
   __ mov(edx, Operand(esp, 2 * kPointerSize));
@@ -3435,21 +3432,21 @@
         break;
 
       case CodeGenState::STORE:
-        // Storing a variable must keep the (new) value on the stack. This
-        // is necessary for compiling assignment expressions.
-        // ecx may be loaded with context; used below in RecordWrite.
-        //
         // Note: We will reach here even with node->var()->mode() ==
         // Variable::CONST because of const declarations which will
         // initialize consts to 'the hole' value and by doing so, end
         // up calling this code.
-        __ mov(eax, TOS);
+        __ pop(eax);
         __ mov(SlotOperand(node, ecx), eax);
         if (node->type() == Slot::CONTEXT) {
           // ecx is loaded with context when calling SlotOperand above.
           int offset = FixedArray::kHeaderSize + node->index() * kPointerSize;
           __ RecordWrite(ecx, offset, eax, ebx);
         }
+        // Storing a variable must keep the (new) value on the stack. This
+        // is necessary for compiling assignment expressions.
+        // ecx may be loaded with context; used below in RecordWrite.
+        __ push(eax);
         break;
     }
   }
@@ -3484,7 +3481,16 @@
 
 void Ia32CodeGenerator::VisitLiteral(Literal* node) {
   Comment cmnt(masm_, "[ Literal");
-  __ push(Immediate(node->handle()));
+  if (node->handle()->IsSmi() && !IsInlineSmi(node)) {
+    // To prevent long attacker-controlled byte sequences in code, larger
+    // Smis are loaded in two steps.
+    int bits = reinterpret_cast<int>(*node->handle());
+    __ mov(eax, bits & 0x0000FFFF);
+    __ xor_(eax, bits & 0xFFFF0000);
+    __ push(eax);
+  } else {
+    __ push(Immediate(node->handle()));
+  }
 }
 
 
@@ -3668,8 +3674,21 @@
 
 void Ia32CodeGenerator::VisitArrayLiteral(ArrayLiteral* node) {
   Comment cmnt(masm_, "[ ArrayLiteral");
-  // Load the resulting object.
-  Load(node->result());
+
+  // Call runtime to create the array literal.
+  __ push(Immediate(node->literals()));
+  // Load the function of this frame.
+  __ mov(ecx, FunctionOperand());
+  // Load the literals array of the function.
+  __ mov(ecx, FieldOperand(ecx, JSFunction::kLiteralsOffset));
+  __ push(ecx);
+  __ CallRuntime(Runtime::kCreateArrayLiteral, 2);
+
+  // Push the resulting array literal on the stack.
+  __ push(eax);
+
+  // Generate code to set the elements in the array that are not
+  // literals.
   for (int i = 0; i < node->values()->length(); i++) {
     Expression* value = node->values()->at(i);
 
@@ -3697,6 +3716,13 @@
 }
 
 
+bool Ia32CodeGenerator::IsInlineSmi(Literal* literal) {
+  if (literal == NULL || !literal->handle()->IsSmi()) return false;
+  int int_value = Smi::cast(*literal->handle())->value();
+  return is_intn(int_value, kMaxSmiInlinedBits);
+}
+
+
 void Ia32CodeGenerator::VisitAssignment(Assignment* node) {
   Comment cmnt(masm_, "[ Assignment");
 
@@ -3712,7 +3738,7 @@
   } else {
     GetValue(&target);
     Literal* literal = node->value()->AsLiteral();
-    if (literal != NULL && literal->handle()->IsSmi()) {
+    if (IsInlineSmi(literal)) {
       SmiOperation(node->binary_op(), literal->handle(), false, NO_OVERWRITE);
     } else {
       Load(node->value());
@@ -4578,20 +4604,6 @@
 }
 
 
-// Returns 'true' if able to defer negation to the consuming arithmetic
-// operation.
-bool Ia32CodeGenerator::TryDeferNegate(Expression* x) {
-  UnaryOperation* unary = x->AsUnaryOperation();
-  if (FLAG_defer_negation && unary != NULL && unary->op() == Token::SUB) {
-    Load(unary->expression());
-    return true;
-  } else {
-    Load(x);
-    return false;
-  }
-}
-
-
 void Ia32CodeGenerator::VisitBinaryOperation(BinaryOperation* node) {
   Comment cmnt(masm_, "[ BinaryOperation");
   Token::Value op = node->op();
@@ -4697,25 +4709,18 @@
     Literal* lliteral = node->left()->AsLiteral();
     Literal* rliteral = node->right()->AsLiteral();
 
-    if (rliteral != NULL && rliteral->handle()->IsSmi()) {
+    if (IsInlineSmi(rliteral)) {
       Load(node->left());
       SmiOperation(node->op(), rliteral->handle(), false, overwrite_mode);
 
-    } else if (lliteral != NULL && lliteral->handle()->IsSmi()) {
+    } else if (IsInlineSmi(lliteral)) {
       Load(node->right());
       SmiOperation(node->op(), lliteral->handle(), true, overwrite_mode);
 
     } else {
-      bool negate_result = false;
-      if (node->op() == Token::MUL) {  // Implement only MUL for starters
-        bool left_negated = TryDeferNegate(node->left());
-        bool right_negated = TryDeferNegate(node->right());
-        negate_result = left_negated != right_negated;
-      } else {
-        Load(node->left());
-        Load(node->right());
-      }
-      GenericBinaryOperation(node->op(), overwrite_mode, negate_result);
+      Load(node->left());
+      Load(node->right());
+      GenericBinaryOperation(node->op(), overwrite_mode);
     }
   }
 }
@@ -4916,12 +4921,12 @@
 
   // Optimize for the case where (at least) one of the expressions
   // is a literal small integer.
-  if (left->AsLiteral() != NULL && left->AsLiteral()->handle()->IsSmi()) {
+  if (IsInlineSmi(left->AsLiteral())) {
     Load(right);
     SmiComparison(ReverseCondition(cc), left->AsLiteral()->handle(), strict);
     return;
   }
-  if (right->AsLiteral() != NULL && right->AsLiteral()->handle()->IsSmi()) {
+  if (IsInlineSmi(right->AsLiteral())) {
     Load(left);
     SmiComparison(cc, right->AsLiteral()->handle(), strict);
     return;
@@ -5207,7 +5212,7 @@
     // CopyRegistersFromStackToMemory() but it isn't! esp is assumed
     // correct here, but computed for the other call. Very error
     // prone! FIX THIS.  Actually there are deeper problems with
-    // register saving than this assymetry (see the buganizer report
+    // register saving than this assymetry (see the bug report
     // associated with this issue).
     __ PushRegistersFromMemory(kJSCallerSaved);
   }
diff --git a/src/codegen.cc b/src/codegen.cc
index fc057a9..d450595 100644
--- a/src/codegen.cc
+++ b/src/codegen.cc
@@ -129,6 +129,7 @@
   Handle<JSFunction> function =
       Factory::NewFunctionBoilerplate(node->name(),
                                       node->materialized_literal_count(),
+                                      node->contains_array_literal(),
                                       code);
   CodeGenerator::SetFunctionInfo(function, node->num_parameters(),
                                  node->function_token_position(),
diff --git a/src/codegen.h b/src/codegen.h
index 4782753..ed03dd2 100644
--- a/src/codegen.h
+++ b/src/codegen.h
@@ -90,7 +90,7 @@
 #ifdef DEBUG
   const char* comment_;
 #endif
-  DISALLOW_EVIL_CONSTRUCTORS(DeferredCode);
+  DISALLOW_COPY_AND_ASSIGN(DeferredCode);
 };
 
 
diff --git a/src/compiler.cc b/src/compiler.cc
index 4869b30..7d2e661 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -48,28 +48,6 @@
 #endif
 
 
-// Helper class to keep track of compilation nesting and to do proper
-// cleanups of generated ASTs.
-class CompilationTracker BASE_EMBEDDED {
- public:
-  CompilationTracker() {
-    ++nesting_;
-  }
-
-  ~CompilationTracker() {
-    // If we're leaving the top-level compilation, we must make sure
-    // to get rid of all generated ASTs.
-    if (--nesting_ == 0) Zone::DeleteAll();
-  }
-
- private:
-  static int nesting_;
-};
-
-
-int CompilationTracker::nesting_ = 0;
-
-
 static Handle<Code> MakeCode(FunctionLiteral* literal,
                              Handle<Script> script,
                              bool is_eval) {
@@ -108,7 +86,7 @@
                                        Handle<Script> script,
                                        v8::Extension* extension,
                                        ScriptDataImpl* pre_data) {
-  CompilationTracker tracker;
+  ZoneScope zone_scope(DELETE_ON_EXIT);
 
   // Make sure we have an initial stack limit.
   StackGuard guard;
@@ -158,6 +136,7 @@
   Handle<JSFunction> fun =
       Factory::NewFunctionBoilerplate(lit->name(),
                                       lit->materialized_literal_count(),
+                                      lit->contains_array_literal(),
                                       code);
 
   CodeGenerator::SetFunctionInfo(fun, lit->scope()->num_parameters(),
@@ -231,7 +210,7 @@
 
 
 bool Compiler::CompileLazy(Handle<SharedFunctionInfo> shared) {
-  CompilationTracker tracker;
+  ZoneScope zone_scope(DELETE_ON_EXIT);
 
   // The VM is in the COMPILER state until exiting this function.
   VMState state(COMPILER);
diff --git a/src/debug-delay.js b/src/debug-delay.js
index 321ec3b..19461df 100644
--- a/src/debug-delay.js
+++ b/src/debug-delay.js
@@ -172,7 +172,7 @@
   if (this.condition()) {
     // If break point has condition try to evaluate it in the top frame.
     try {
-      var mirror = exec_state.GetFrame(0).evaluate(this.condition());
+      var mirror = exec_state.frame(0).evaluate(this.condition());
       // If no sensible mirror or non true value break point not triggered.
       if (!(mirror instanceof ValueMirror) || !%ToBoolean(mirror.value_)) {
         return false;
@@ -366,24 +366,6 @@
 }
 
 
-// Helper function to check whether the JSON request is a plain break request.
-// This is used form the runtime handling of pending debug requests. If one of
-// the pending requests is a plain break execution should be broken after
-// processing the pending break requests.
-function IsPlainBreakRequest(json_request) {
-  try {
-    // Convert the JSON string to an object.
-    request = %CompileString('(' + json_request + ')', false)();
-
-    // Check for break command without arguments.
-    return request.command && request.command == "break" && !request.arguments;
-  } catch (e) {
-    // If there is a exception parsing the JSON request just return false.
-    return false;
-  }
-}
-
-
 Debug.addListener = function(listener, opt_data) {
   if (!IS_FUNCTION(listener)) throw new Error('Parameters have wrong types.');
   %AddDebugEventListener(listener, opt_data);
@@ -394,7 +376,7 @@
   %RemoveDebugEventListener(listener);
 };
 
-Debug.Break = function(f) {
+Debug.breakExecution = function(f) {
   %Break();
 };
 
@@ -710,14 +692,15 @@
 }
 
 ExecutionState.prototype.evaluateGlobal = function(source, disable_break) {
-  return %DebugEvaluateGlobal(this.break_id, source, Boolean(disable_break));
+  return MakeMirror(
+      %DebugEvaluateGlobal(this.break_id, source, Boolean(disable_break)));
 };
 
-ExecutionState.prototype.GetFrameCount = function() {
+ExecutionState.prototype.frameCount = function() {
   return %GetFrameCount(this.break_id);
 };
 
-ExecutionState.prototype.GetFrame = function(opt_index) {
+ExecutionState.prototype.frame = function(opt_index) {
   // If no index supplied return the selected frame.
   if (opt_index == null) opt_index = this.selected_frame;
   return new FrameMirror(this.break_id, opt_index);
@@ -729,11 +712,11 @@
 
 ExecutionState.prototype.setSelectedFrame = function(index) {
   var i = %ToNumber(index);
-  if (i < 0 || i >= this.GetFrameCount()) throw new Error('Illegal frame index.');
+  if (i < 0 || i >= this.frameCount()) throw new Error('Illegal frame index.');
   this.selected_frame = i;
 };
 
-ExecutionState.prototype.getSelectedFrame = function() {
+ExecutionState.prototype.selectedFrame = function() {
   return this.selected_frame;
 };
 
@@ -754,22 +737,22 @@
 
 
 BreakEvent.prototype.func = function() {
-  return this.exec_state_.GetFrame(0).func();
+  return this.exec_state_.frame(0).func();
 };
 
 
 BreakEvent.prototype.sourceLine = function() {
-  return this.exec_state_.GetFrame(0).sourceLine();
+  return this.exec_state_.frame(0).sourceLine();
 };
 
 
 BreakEvent.prototype.sourceColumn = function() {
-  return this.exec_state_.GetFrame(0).sourceColumn();
+  return this.exec_state_.frame(0).sourceColumn();
 };
 
 
 BreakEvent.prototype.sourceLineText = function() {
-  return this.exec_state_.GetFrame(0).sourceLineText();
+  return this.exec_state_.frame(0).sourceLineText();
 };
 
 
@@ -797,12 +780,12 @@
     details += 'break';
   }
   details += ' in ';
-  details += this.exec_state_.GetFrame(0).invocationText();
+  details += this.exec_state_.frame(0).invocationText();
   details += ' at ';
-  details += this.exec_state_.GetFrame(0).sourceAndPositionText();
+  details += this.exec_state_.frame(0).sourceAndPositionText();
   details += '\n'
   if (this.func().script()) {
-    details += FrameSourceUnderline(this.exec_state_.GetFrame(0));
+    details += FrameSourceUnderline(this.exec_state_.frame(0));
   }
   return details;
 };
@@ -822,7 +805,7 @@
   var o = { seq: next_response_seq++,
             type: "event",
             event: "break",
-            body: { invocationText: this.exec_state_.GetFrame(0).invocationText(),
+            body: { invocationText: this.exec_state_.frame(0).invocationText(),
                   }
           }
 
@@ -876,22 +859,22 @@
 }
 
 ExceptionEvent.prototype.func = function() {
-  return this.exec_state_.GetFrame(0).func();
+  return this.exec_state_.frame(0).func();
 };
 
 
 ExceptionEvent.prototype.sourceLine = function() {
-  return this.exec_state_.GetFrame(0).sourceLine();
+  return this.exec_state_.frame(0).sourceLine();
 };
 
 
 ExceptionEvent.prototype.sourceColumn = function() {
-  return this.exec_state_.GetFrame(0).sourceColumn();
+  return this.exec_state_.frame(0).sourceColumn();
 };
 
 
 ExceptionEvent.prototype.sourceLineText = function() {
-  return this.exec_state_.GetFrame(0).sourceLineText();
+  return this.exec_state_.frame(0).sourceLineText();
 };
 
 
@@ -906,9 +889,9 @@
   details += '"';
   details += MakeMirror(this.exception_).toText();
   details += '" at ';
-  details += this.exec_state_.GetFrame(0).sourceAndPositionText();
+  details += this.exec_state_.frame(0).sourceAndPositionText();
   details += '\n';
-  details += FrameSourceUnderline(this.exec_state_.GetFrame(0));
+  details += FrameSourceUnderline(this.exec_state_.frame(0));
 
   return details;
 };
@@ -1201,11 +1184,11 @@
 
   // Request source arround current source location.
   request.arguments = {};
-  request.arguments.fromLine = this.exec_state_.GetFrame().sourceLine() - before;
+  request.arguments.fromLine = this.exec_state_.frame().sourceLine() - before;
   if (request.arguments.fromLine < 0) {
     request.arguments.fromLine = 0
   }
-  request.arguments.toLine = this.exec_state_.GetFrame().sourceLine() + after + 1;
+  request.arguments.toLine = this.exec_state_.frame().sourceLine() + after + 1;
 
   return request.toJSONProtocol();
 };
@@ -1610,7 +1593,7 @@
     var f;
     try {
       // Find the function through a global evaluate.
-      f = this.exec_state_.evaluateGlobal(target);
+      f = this.exec_state_.evaluateGlobal(target).value();
     } catch (e) {
       response.failed('Error: "' + %ToString(e) +
                       '" evaluating "' + target + '"');
@@ -1718,7 +1701,7 @@
 
 DebugCommandProcessor.prototype.backtraceRequest_ = function(request, response) {
   // Get the number of frames.
-  var total_frames = this.exec_state_.GetFrameCount();
+  var total_frames = this.exec_state_.frameCount();
 
   // Default frame range to include in backtrace.
   var from_index = 0
@@ -1747,7 +1730,7 @@
   // Create the response body.
   var frames = [];
   for (var i = from_index; i < to_index; i++) {
-    frames.push(this.exec_state_.GetFrame(i));
+    frames.push(this.exec_state_.frame(i));
   }
   response.body = {
     fromFrame: from_index,
@@ -1768,7 +1751,7 @@
   if (request.arguments && request.arguments.number >= 0) {
     this.exec_state_.setSelectedFrame(request.arguments.number);
   }
-  response.body = this.exec_state_.GetFrame();
+  response.body = this.exec_state_.frame();
 };
 
 
@@ -1799,8 +1782,8 @@
   // Global evaluate.
   if (global) {
     // Evaluate in the global context.
-    response.body = MakeMirror(
-        this.exec_state_.evaluateGlobal(expression), Boolean(disable_break));
+    response.body =
+        this.exec_state_.evaluateGlobal(expression), Boolean(disable_break);
     return;
   }
 
@@ -1812,16 +1795,16 @@
   // Check whether a frame was specified.
   if (!IS_UNDEFINED(frame)) {
     var frame_number = %ToNumber(frame);
-    if (frame_number < 0 || frame_number >= this.exec_state_.GetFrameCount()) {
+    if (frame_number < 0 || frame_number >= this.exec_state_.frameCount()) {
       return response.failed('Invalid frame "' + frame + '"');
     }
     // Evaluate in the specified frame.
-    response.body = this.exec_state_.GetFrame(frame_number).evaluate(
+    response.body = this.exec_state_.frame(frame_number).evaluate(
         expression, Boolean(disable_break));
     return;
   } else {
     // Evaluate in the selected frame.
-    response.body = this.exec_state_.GetFrame().evaluate(
+    response.body = this.exec_state_.frame().evaluate(
         expression, Boolean(disable_break));
     return;
   }
@@ -1831,7 +1814,7 @@
 DebugCommandProcessor.prototype.sourceRequest_ = function(request, response) {
   var from_line;
   var to_line;
-  var frame = this.exec_state_.GetFrame();
+  var frame = this.exec_state_.frame();
   if (request.arguments) {
     // Pull out arguments.
     from_line = request.arguments.fromLine;
@@ -1839,10 +1822,10 @@
 
     if (!IS_UNDEFINED(request.arguments.frame)) {
       var frame_number = %ToNumber(request.arguments.frame);
-      if (frame_number < 0 || frame_number >= this.exec_state_.GetFrameCount()) {
+      if (frame_number < 0 || frame_number >= this.exec_state_.frameCount()) {
         return response.failed('Invalid frame "' + frame + '"');
       }
-      frame = this.exec_state_.GetFrame(frame_number);
+      frame = this.exec_state_.frame(frame_number);
     }
   }
 
diff --git a/src/debug.cc b/src/debug.cc
index 45cf7b7..8ba4490 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -1423,28 +1423,6 @@
 }
 
 
-bool Debugger::IsPlainBreakRequest(Handle<Object> request) {
-  // Get the function IsPlainBreakRequest (defined in debug.js).
-  Handle<JSFunction> process_debug_request =
-    Handle<JSFunction>(JSFunction::cast(
-    Debug::debug_context()->global()->GetProperty(
-        *Factory::LookupAsciiSymbol("IsPlainBreakRequest"))));
-
-  // Call ProcessDebugRequest expect String result.
-  bool caught_exception;
-  const int argc = 1;
-  Object** argv[argc] = { request.location() };
-  Handle<Object> result = Execution::TryCall(process_debug_request,
-                                             Factory::undefined_value(),
-                                             argc, argv,
-                                             &caught_exception);
-  if (caught_exception) {
-    return false;
-  }
-  return *result == Heap::true_value();
-}
-
-
 void Debugger::OnException(Handle<Object> exception, bool uncaught) {
   HandleScope scope;
 
@@ -1785,21 +1763,6 @@
 }
 
 
-// Compare a two byte string to an null terminated ASCII string.
-bool DebugMessageThread::TwoByteEqualsAscii(Vector<uint16_t> two_byte,
-                                            const char* ascii) {
-  for (int i = 0; i < two_byte.length(); i++) {
-    if (ascii[i] == '\0') {
-      return false;
-    }
-    if (two_byte[i] != static_cast<uint16_t>(ascii[i])) {
-      return false;
-    }
-  }
-  return ascii[two_byte.length()] == '\0';
-}
-
-
 void DebugMessageThread::Run() {
   // Sends debug events to an installed debugger message callback.
   while (true) {
@@ -1858,60 +1821,6 @@
     return;
   }
 
-  // First process all pending commands in the queue. During this processing
-  // each message is checked to see if it is a plain break command. If there is
-  // a plain break request in the queue or if the queue is empty a break event
-  // is sent to the debugger.
-  bool plain_break = false;
-  if (command_queue_.IsEmpty()) {
-    plain_break = true;
-  } else {
-    // Drain queue.
-    while (!command_queue_.IsEmpty()) {
-      command_received_->Wait();
-      Logger::DebugTag("Get command from command_queue, in drain queue loop.");
-      Vector<uint16_t> command = command_queue_.Get();
-      // Support for sending a break command as just "break" instead of an
-      // actual JSON break command.
-      // If break is made into a separate API call, function
-      // TwoByteEqualsASCII can be removed.
-      if (TwoByteEqualsAscii(command, "break")) {
-        plain_break = true;
-        continue;
-      }
-
-      // Get the command as a string object.
-      Handle<String> command_string;
-      if (!command.is_empty()) {
-        command_string = Factory::NewStringFromTwoByte(
-                             Vector<const uint16_t>(
-                                 reinterpret_cast<const uint16_t*>(
-                                     command.start()),
-                                 command.length()));
-      } else {
-        command_string = Handle<String>();
-      }
-
-      // Process the request.
-      Handle<String> message_string = Debugger::ProcessRequest(exec_state,
-                                                                command_string,
-                                                                false);
-      // Convert text result to UTF-16 string and send it.
-      v8::String::Value val(Utils::ToLocal(message_string));
-      Vector<uint16_t> message(reinterpret_cast<uint16_t*>(*val),
-                                message_string->length());
-      SendMessage(message);
-
-      // Check whether one of the commands is a plain break request.
-      if (!plain_break) {
-        plain_break = Debugger::IsPlainBreakRequest(message_string);
-      }
-    }
-  }
-
-  // If this break event is not to go to the debugger just return.
-  if (!plain_break) return;
-
   // Notify the debugger that a debug event has occoured.
   host_running_ = false;
   SetEventJSONFromEvent(event_data);
@@ -1998,13 +1907,6 @@
   Vector<uint16_t> command_copy = command.Clone();
   Logger::DebugTag("Put command on command_queue.");
   command_queue_.Put(command_copy);
-  // If not in a break schedule a break and send the "request queued" response.
-  if (host_running_) {
-    v8::Debug::DebugBreak();
-    uint16_t buffer[14] = {'r', 'e', 'q', 'u', 'e', 's', 't', ' ',
-        'q', 'u', 'e', 'u', 'e', 'd'};
-    SendMessage(Vector<uint16_t>(buffer, 14));
-  }
   command_received_->Signal();
 }
 
diff --git a/src/debug.h b/src/debug.h
index 3898e84..951acd5 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -121,7 +121,7 @@
   void SetDebugBreak();
   void ClearDebugBreak();
 
-  DISALLOW_EVIL_CONSTRUCTORS(BreakLocationIterator);
+  DISALLOW_COPY_AND_ASSIGN(BreakLocationIterator);
 };
 
 
@@ -317,7 +317,7 @@
   // Code to call for handling debug break on return.
   static Code* debug_break_return_;
 
-  DISALLOW_EVIL_CONSTRUCTORS(Debug);
+  DISALLOW_COPY_AND_ASSIGN(Debug);
 };
 
 
@@ -346,8 +346,6 @@
   static Handle<String> ProcessRequest(Handle<Object> exec_state,
                                        Handle<Object> request,
                                        bool stopped);
-  static bool IsPlainBreakRequest(Handle<Object> request);
-
   static void OnDebugBreak(Handle<Object> break_points_hit);
   static void OnException(Handle<Object> exception, bool uncaught);
   static void OnBeforeCompile(Handle<Script> script);
@@ -422,7 +420,7 @@
  private:
   MessageQueue queue_;
   Mutex* lock_;
-  DISALLOW_EVIL_CONSTRUCTORS(LockingMessageQueue);
+  DISALLOW_COPY_AND_ASSIGN(LockingMessageQueue);
 };
 
 
@@ -465,7 +463,7 @@
   static const int kQueueInitialSize = 4;
   LockingMessageQueue command_queue_;
   LockingMessageQueue message_queue_;
-  DISALLOW_EVIL_CONSTRUCTORS(DebugMessageThread);
+  DISALLOW_COPY_AND_ASSIGN(DebugMessageThread);
 };
 
 
diff --git a/src/factory.cc b/src/factory.cc
index ba7dc3c..8016965 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -172,6 +172,11 @@
 }
 
 
+Handle<Map> Factory::CopyMapDropTransitions(Handle<Map> src) {
+  CALL_HEAP_FUNCTION(src->CopyDropTransitions(), Map);
+}
+
+
 Handle<FixedArray> Factory::CopyFixedArray(Handle<FixedArray> array) {
   CALL_HEAP_FUNCTION(array->Copy(), FixedArray);
 }
@@ -198,12 +203,21 @@
   Handle<JSFunction> result =
       BaseNewFunctionFromBoilerplate(boilerplate, Top::function_map());
   result->set_context(*context);
-  int number_of_literals = boilerplate->literals()->length();
+  int number_of_literals = boilerplate->NumberOfLiterals();
+  Handle<FixedArray> literals =
+      Factory::NewFixedArray(number_of_literals, TENURED);
   if (number_of_literals > 0) {
-    Handle<FixedArray> literals =
-        Factory::NewFixedArray(number_of_literals, TENURED);
-    result->set_literals(*literals);
+    // Store the object, regexp and array functions in the literals
+    // array prefix.  These functions will be used when creating
+    // object, regexp and array literals in this function.
+    literals->set(JSFunction::kLiteralObjectFunctionIndex,
+                  context->global_context()->object_function());
+    literals->set(JSFunction::kLiteralRegExpFunctionIndex,
+                  context->global_context()->regexp_function());
+    literals->set(JSFunction::kLiteralArrayFunctionIndex,
+                  context->global_context()->array_function());
   }
+  result->set_literals(*literals);
   ASSERT(!result->IsBoilerplate());
   return result;
 }
@@ -370,16 +384,20 @@
 
 Handle<JSFunction> Factory::NewFunctionBoilerplate(Handle<String> name,
                                                    int number_of_literals,
+                                                   bool contains_array_literal,
                                                    Handle<Code> code) {
   Handle<JSFunction> function = NewFunctionBoilerplate(name);
   function->set_code(*code);
-  if (number_of_literals > 0) {
-    Handle<FixedArray> literals =
-        Factory::NewFixedArray(number_of_literals, TENURED);
-    function->set_literals(*literals);
-  } else {
-    function->set_literals(Heap::empty_fixed_array());
+  int literals_array_size = number_of_literals;
+  // If the function contains object, regexp or array literals,
+  // allocate extra space for a literals array prefix containing the
+  // object, regexp and array constructor functions.
+  if (number_of_literals > 0 || contains_array_literal) {
+    literals_array_size += JSFunction::kLiteralsPrefixSize;
   }
+  Handle<FixedArray> literals =
+      Factory::NewFixedArray(literals_array_size, TENURED);
+  function->set_literals(*literals);
   ASSERT(!function->has_initial_map());
   ASSERT(!function->has_prototype());
   return function;
@@ -451,11 +469,11 @@
     PropertyAttributes attributes) {
   GC_GREEDY_CHECK();
   CallbacksDescriptor desc(*key, *value, attributes);
-  Object* obj = array->CopyInsert(&desc);
+  Object* obj = array->CopyInsert(&desc, REMOVE_TRANSITIONS);
   if (obj->IsRetryAfterGC()) {
     CALL_GC(obj);
     CallbacksDescriptor desc(*key, *value, attributes);
-    obj = array->CopyInsert(&desc);
+    obj = array->CopyInsert(&desc, REMOVE_TRANSITIONS);
     if (obj->IsFailure()) {
       // TODO(1181417): Fix this.
       V8::FatalProcessOutOfMemory("CopyAppendProxyDescriptor");
@@ -542,8 +560,7 @@
 Handle<JSObject> Factory::NewObjectLiteral(int expected_number_of_properties) {
   Handle<Map> map = Handle<Map>(Top::object_function()->initial_map());
   map = Factory::CopyMap(map);
-  map->set_instance_descriptors(
-      DescriptorArray::cast(Heap::empty_fixed_array()));
+  map->set_instance_descriptors(Heap::empty_descriptor_array());
   map->set_unused_property_fields(expected_number_of_properties);
   CALL_HEAP_FUNCTION(Heap::AllocateJSObjectFromMap(*map, TENURED),
                      JSObject);
@@ -691,7 +708,7 @@
     if (parent->IsUndefined()) break;
     obj = Handle<FunctionTemplateInfo>::cast(parent);
   }
-  if (array->length() > 0) {
+  if (!array->IsEmpty()) {
     map->set_instance_descriptors(*array);
   }
 
diff --git a/src/factory.h b/src/factory.h
index 8a7db40..a0cd936 100644
--- a/src/factory.h
+++ b/src/factory.h
@@ -146,6 +146,8 @@
 
   static Handle<Map> CopyMap(Handle<Map> map);
 
+  static Handle<Map> CopyMapDropTransitions(Handle<Map> map);
+
   static Handle<FixedArray> CopyFixedArray(Handle<FixedArray> array);
 
   // Numbers (eg, literals) are pretenured by the parser.
@@ -237,6 +239,7 @@
 
   static Handle<JSFunction> NewFunctionBoilerplate(Handle<String> name,
                                                    int number_of_literals,
+                                                   bool contains_array_literal,
                                                    Handle<Code> code);
 
   static Handle<JSFunction> NewFunctionBoilerplate(Handle<String> name);
@@ -280,10 +283,6 @@
   SYMBOL_LIST(SYMBOL_ACCESSOR)
 #undef SYMBOL_ACCESSOR
 
-  static Handle<DescriptorArray> empty_descriptor_array() {
-    return Handle<DescriptorArray>::cast(empty_fixed_array());
-  }
-
   static Handle<SharedFunctionInfo> NewSharedFunctionInfo(Handle<String> name);
 
   static Handle<Dictionary> DictionaryAtNumberPut(Handle<Dictionary>,
diff --git a/src/flags.cc b/src/flags.cc
index cb5e08d..7ce4b8a 100644
--- a/src/flags.cc
+++ b/src/flags.cc
@@ -301,8 +301,16 @@
       // lookup the flag
       Flag* flag = Lookup(name);
       if (flag == NULL) {
-        fprintf(stderr, "Error: unrecognized flag %s\n", arg);
-        return j;
+        if (remove_flags) {
+          // We don't recognize this flag but since we're removing
+          // the flags we recognize we assume that the remaining flags
+          // will be processed somewhere else so this flag might make
+          // sense there.
+          continue;
+        } else {
+          fprintf(stderr, "Error: unrecognized flag %s\n", arg);
+          return j;
+        }
       }
 
       // if we still need a flag value, use the next argument if available
@@ -323,7 +331,7 @@
           *flag->bool_variable() = !is_bool;
           break;
         case Flag::INT:
-          *flag->int_variable() = strtol(value, &endp, 10);
+          *flag->int_variable() = strtol(value, &endp, 10);  // NOLINT
           break;
         case Flag::FLOAT:
           *flag->float_variable() = strtod(value, &endp);
diff --git a/src/frames.h b/src/frames.h
index 2b9551c..693cfed 100644
--- a/src/frames.h
+++ b/src/frames.h
@@ -532,7 +532,7 @@
   StackFrame* SingletonFor(StackFrame::Type type, StackFrame::State* state);
 
   friend class StackFrame;
-  DISALLOW_EVIL_CONSTRUCTORS(StackFrameIterator);
+  DISALLOW_COPY_AND_ASSIGN(StackFrameIterator);
 };
 
 
diff --git a/src/globals.h b/src/globals.h
index 4af7a11..7bf5802 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -33,8 +33,8 @@
 #ifdef WIN32
 typedef signed char int8_t;
 typedef unsigned char uint8_t;
-typedef short int16_t;
-typedef unsigned short uint16_t;
+typedef short int16_t;  // NOLINT
+typedef unsigned short uint16_t;  // NOLINT
 typedef int int32_t;
 typedef unsigned int uint32_t;
 typedef __int64 int64_t;
@@ -96,11 +96,11 @@
 const int kMaxInt = 0x7FFFFFFF;
 const int kMinInt = -kMaxInt - 1;
 
-const int kCharSize     = sizeof(char);
-const int kShortSize    = sizeof(short);
-const int kIntSize      = sizeof(int);
-const int kDoubleSize   = sizeof(double);
-const int kPointerSize  = sizeof(void*);
+const int kCharSize     = sizeof(char);    // NOLINT
+const int kShortSize    = sizeof(short);   // NOLINT
+const int kIntSize      = sizeof(int);     // NOLINT
+const int kDoubleSize   = sizeof(double);  // NOLINT
+const int kPointerSize  = sizeof(void*);   // NOLINT
 
 const int kPointerSizeLog2 = 2;
 
@@ -202,7 +202,7 @@
 class Deserializer;
 class MessageLocation;
 class ObjectGroup;
-struct TickSample;
+class TickSample;
 class VirtualMemory;
 class Mutex;
 
@@ -297,14 +297,27 @@
 
 
 // Type of properties.
+// Order of properties is significant.
+// Must fit in the BitField PropertyDetails::TypeField.
+// A copy of this is in mirror-delay.js.
 enum PropertyType {
   NORMAL              = 0,  // only in slow mode
-  MAP_TRANSITION      = 1,  // only in fast mode
+  FIELD               = 1,  // only in fast mode
   CONSTANT_FUNCTION   = 2,  // only in fast mode
-  FIELD               = 3,  // only in fast mode
-  CALLBACKS           = 4,
-  CONSTANT_TRANSITION = 5,  // only in fast mode
-  INTERCEPTOR         = 6
+  CALLBACKS           = 3,
+  INTERCEPTOR         = 4,  // only in lookup results, not in descriptors.
+  FIRST_PHANTOM_PROPERTY_TYPE = 5,  // All properties before this are real.
+  MAP_TRANSITION      = 5,  // only in fast mode
+  CONSTANT_TRANSITION = 6,  // only in fast mode
+  NULL_DESCRIPTOR     = 7   // only in fast mode
+};
+
+
+// Whether to remove map transitions and constant transitions from a
+// DescriptorArray.
+enum TransitionFlag {
+  REMOVE_TRANSITIONS,
+  KEEP_TRANSITIONS
 };
 
 
@@ -405,7 +418,7 @@
 
 // A macro to disallow the evil copy constructor and operator= functions
 // This should be used in the private: declarations for a class
-#define DISALLOW_EVIL_CONSTRUCTORS(TypeName)    \
+#define DISALLOW_COPY_AND_ASSIGN(TypeName)      \
   TypeName(const TypeName&);                    \
   void operator=(const TypeName&)
 
@@ -418,7 +431,7 @@
 // especially useful for classes containing only static methods.
 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
   TypeName();                                    \
-  DISALLOW_EVIL_CONSTRUCTORS(TypeName)
+  DISALLOW_COPY_AND_ASSIGN(TypeName)
 
 
 // Support for tracking C++ memory allocation.  Insert TRACK_MEMORY("Fisk")
diff --git a/src/handles.cc b/src/handles.cc
index 027b1f6..0e8826d 100644
--- a/src/handles.cc
+++ b/src/handles.cc
@@ -108,7 +108,7 @@
   func->shared()->set_expected_nof_properties(nof);
   if (func->has_initial_map()) {
     Handle<Map> new_initial_map =
-        Factory::CopyMap(Handle<Map>(func->initial_map()));
+        Factory::CopyMapDropTransitions(Handle<Map>(func->initial_map()));
     new_initial_map->set_unused_property_fields(nof);
     func->set_initial_map(*new_initial_map);
   }
@@ -215,7 +215,7 @@
 
 Handle<Object> GetProperty(Handle<Object> obj,
                            Handle<Object> key) {
-  CALL_HEAP_FUNCTION(Runtime::GetObjectProperty(obj, *key), Object);
+  CALL_HEAP_FUNCTION(Runtime::GetObjectProperty(obj, key), Object);
 }
 
 
@@ -248,6 +248,11 @@
 }
 
 
+Handle<Object> LookupSingleCharacterStringFromCode(uint32_t index) {
+  CALL_HEAP_FUNCTION(Heap::LookupSingleCharacterStringFromCode(index), Object);
+}
+
+
 Handle<String> SubString(Handle<String> str, int start, int end) {
   CALL_HEAP_FUNCTION(str->Slice(start, end), String);
 }
@@ -256,22 +261,7 @@
 Handle<Object> SetElement(Handle<JSObject> object,
                           uint32_t index,
                           Handle<Object> value) {
-  GC_GREEDY_CHECK();
-  Object* obj = object->SetElement(index, *value);
-  // If you set an element then the object may need to get a new map
-  // which will cause it to grow, which will cause an allocation.
-  // If you know that the object will not grow then perhaps this check
-  // does not apply and you may have to split this method into two
-  // versions.
-  ASSERT(Heap::IsAllocationAllowed());
-  if (obj->IsFailure()) {
-    CALL_GC(obj);
-    obj = object->SetElement(index, *value);
-    if (obj->IsFailure()) {
-      V8::FatalProcessOutOfMemory("Handles");  // TODO(1181417): Fix this.
-    }
-  }
-  return value;
+  CALL_HEAP_FUNCTION(object->SetElement(index, *value), Object);
 }
 
 
diff --git a/src/handles.h b/src/handles.h
index aa5be2f..6fea67b 100644
--- a/src/handles.h
+++ b/src/handles.h
@@ -142,6 +142,8 @@
 Handle<Object> DeleteElement(Handle<JSObject> obj, uint32_t index);
 Handle<Object> DeleteProperty(Handle<JSObject> obj, Handle<String> prop);
 
+Handle<Object> LookupSingleCharacterStringFromCode(uint32_t index);
+
 Handle<JSObject> Copy(Handle<JSObject> obj, PretenureFlag = NOT_TENURED);
 
 // Get the JS object corresponding to the given script; create it
diff --git a/src/heap-inl.h b/src/heap-inl.h
index 49460cc..22ef441 100644
--- a/src/heap-inl.h
+++ b/src/heap-inl.h
@@ -160,14 +160,6 @@
 }
 
 
-Object* Heap::AllocatePropertyStorageForMap(Map* map) {
-  if (map->unused_property_fields() > 0) {
-    return AllocateFixedArray(map->unused_property_fields());
-  }
-  return Heap::empty_fixed_array();
-}
-
-
 AllocationSpace Heap::TargetSpace(HeapObject* object) {
   // Heap numbers and sequential strings are promoted to code space, all
   // other object types are promoted to old space.  We do not use
diff --git a/src/heap.cc b/src/heap.cc
index 2c7660d..b04b4c1 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -861,7 +861,7 @@
   map->set_prototype(null_value());
   map->set_constructor(null_value());
   map->set_instance_size(instance_size);
-  map->set_instance_descriptors(DescriptorArray::cast(empty_fixed_array()));
+  map->set_instance_descriptors(empty_descriptor_array());
   map->set_code_cache(empty_fixed_array());
   map->set_unused_property_fields(0);
   map->set_bit_field(0);
@@ -894,17 +894,20 @@
   if (obj->IsFailure()) return false;
   null_value_ = obj;
 
-  // Fix the instance_descriptors for the existing maps.
-  DescriptorArray* empty_descriptors =
-      DescriptorArray::cast(empty_fixed_array());
+  // Allocate the empty descriptor array.  AllocateMap can now be used.
+  obj = AllocateEmptyFixedArray();
+  if (obj->IsFailure()) return false;
+  // There is a check against empty_descriptor_array() in cast().
+  empty_descriptor_array_ = reinterpret_cast<DescriptorArray*>(obj);
 
-  meta_map()->set_instance_descriptors(empty_descriptors);
+  // Fix the instance_descriptors for the existing maps.
+  meta_map()->set_instance_descriptors(empty_descriptor_array());
   meta_map()->set_code_cache(empty_fixed_array());
 
-  fixed_array_map()->set_instance_descriptors(empty_descriptors);
+  fixed_array_map()->set_instance_descriptors(empty_descriptor_array());
   fixed_array_map()->set_code_cache(empty_fixed_array());
 
-  oddball_map()->set_instance_descriptors(empty_descriptors);
+  oddball_map()->set_instance_descriptors(empty_descriptor_array());
   oddball_map()->set_code_cache(empty_fixed_array());
 
   // Fix prototype object for existing maps.
@@ -1004,6 +1007,7 @@
   if (obj->IsFailure()) return false;
   shared_function_info_map_ = Map::cast(obj);
 
+  ASSERT(!Heap::InNewSpace(Heap::empty_fixed_array()));
   return true;
 }
 
@@ -1108,28 +1112,6 @@
   if (obj->IsFailure()) return false;
   nan_value_ = obj;
 
-  obj = NumberFromDouble(INFINITY, TENURED);
-  if (obj->IsFailure()) return false;
-  infinity_value_ = obj;
-
-  obj = NumberFromDouble(-INFINITY, TENURED);
-  if (obj->IsFailure()) return false;
-  negative_infinity_value_ = obj;
-
-  obj = NumberFromDouble(DBL_MAX, TENURED);
-  if (obj->IsFailure()) return false;
-  number_max_value_ = obj;
-
-  // C++ doesn't provide a constant for the smallest denormalized
-  // double (approx. 5e-324) but only the smallest normalized one
-  // which is somewhat bigger (approx. 2e-308).  So we have to do
-  // this raw conversion hack.
-  uint64_t min_value_bits = 1L;
-  double min_value = *reinterpret_cast<double*>(&min_value_bits);
-  obj = NumberFromDouble(min_value, TENURED);
-  if (obj->IsFailure()) return false;
-  number_min_value_ = obj;
-
   obj = Allocate(oddball_map(), CODE_SPACE);
   if (obj->IsFailure()) return false;
   undefined_value_ = obj;
@@ -1628,9 +1610,8 @@
 
 
 Object* Heap::AllocateArgumentsObject(Object* callee, int length) {
-  // This allocation is odd since allocate an argument object
-  // based on the arguments_boilerplate.
-  // We do this to ensure fast allocation and map sharing.
+  // To get fast allocation and map sharing for arguments objects we
+  // allocate them based on an arguments boilerplate.
 
   // This calls Copy directly rather than using Heap::AllocateRaw so we
   // duplicate the check here.
@@ -1702,7 +1683,7 @@
   ASSERT(map->instance_type() != JS_FUNCTION_TYPE);
 
   // Allocate the backing storage for the properties.
-  Object* properties = AllocatePropertyStorageForMap(map);
+  Object* properties = AllocateFixedArray(map->unused_property_fields());
   if (properties->IsFailure()) return properties;
 
   // Allocate the JSObject.
@@ -1750,7 +1731,7 @@
   ASSERT(map->instance_size() == object->map()->instance_size());
 
   // Allocate the backing storage for the properties.
-  Object* properties = AllocatePropertyStorageForMap(map);
+  Object* properties = AllocateFixedArray(map->unused_property_fields());
   if (properties->IsFailure()) return properties;
 
   // Reset the map for the object.
diff --git a/src/heap.h b/src/heap.h
index cd2fb2a..a40780c 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -101,10 +101,6 @@
   V(Map, one_word_filler_map)                           \
   V(Map, two_word_filler_map)                           \
   V(Object, nan_value)                                  \
-  V(Object, infinity_value)                             \
-  V(Object, negative_infinity_value)                    \
-  V(Object, number_max_value)                           \
-  V(Object, number_min_value)                           \
   V(Object, undefined_value)                            \
   V(Object, minus_zero_value)                           \
   V(Object, null_value)                                 \
@@ -112,6 +108,7 @@
   V(Object, false_value)                                \
   V(String, empty_string)                               \
   V(FixedArray, empty_fixed_array)                      \
+  V(DescriptorArray, empty_descriptor_array)            \
   V(Object, the_hole_value)                             \
   V(Map, neander_map)                                   \
   V(JSObject, message_listeners)                        \
@@ -811,10 +808,6 @@
   // inlined).
   static inline Object* AllocateRawMap(int size_in_bytes);
 
-  // Allocate storage for JSObject properties.
-  // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
-  // failed.
-  static inline Object* AllocatePropertyStorageForMap(Map* map);
 
   // Initializes a JSObject based on its map.
   static void InitializeJSObjectFromMap(JSObject* obj,
diff --git a/src/ic.cc b/src/ic.cc
index 6a414a2..2074a76 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -706,7 +706,7 @@
   if (use_ic) set_target(generic_stub());
 
   // Get the property.
-  return Runtime::GetObjectProperty(object, *key);
+  return Runtime::GetObjectProperty(object, key);
 }
 
 
@@ -801,7 +801,9 @@
   // Check if the given name is an array index.
   uint32_t index;
   if (name->AsArrayIndex(&index)) {
-    SetElement(receiver, index, value);
+    HandleScope scope;
+    Handle<Object> result = SetElement(receiver, index, value);
+    if (result.is_null()) return Failure::Exception();
     return *value;
   }
 
@@ -910,7 +912,9 @@
     // Check if the given name is an array index.
     uint32_t index;
     if (name->AsArrayIndex(&index)) {
-      SetElement(receiver, index, value);
+      HandleScope scope;
+      Handle<Object> result = SetElement(receiver, index, value);
+      if (result.is_null()) return Failure::Exception();
       return *value;
     }
 
diff --git a/src/jsregexp.cc b/src/jsregexp.cc
index b855617..0c22a79 100644
--- a/src/jsregexp.cc
+++ b/src/jsregexp.cc
@@ -85,18 +85,19 @@
 }
 
 
-Handle<Object> RegExpImpl::CreateRegExpLiteral(Handle<String> pattern,
+Handle<Object> RegExpImpl::CreateRegExpLiteral(Handle<JSFunction> constructor,
+                                               Handle<String> pattern,
                                                Handle<String> flags,
                                                bool* has_pending_exception) {
-  // Ensure that RegExp has been loaded.
-  if (!Top::regexp_function()->IsLoaded()) {
-    LoadLazy(Top::regexp_function(), has_pending_exception);
+  // Ensure that the constructor function has been loaded.
+  if (!constructor->IsLoaded()) {
+    LoadLazy(constructor, has_pending_exception);
     if (*has_pending_exception) return Handle<Object>(Failure::Exception());
   }
   // Call the construct code with 2 arguments.
   Object** argv[2] = { Handle<Object>::cast(pattern).location(),
                        Handle<Object>::cast(flags).location() };
-  return Execution::New(Top::regexp_function(), 2, argv, has_pending_exception);
+  return Execution::New(constructor, 2, argv, has_pending_exception);
 }
 
 
diff --git a/src/jsregexp.h b/src/jsregexp.h
index 7a7f7b3..c6316f9 100644
--- a/src/jsregexp.h
+++ b/src/jsregexp.h
@@ -34,7 +34,8 @@
  public:
   // Creates a regular expression literal in the old space.
   // This function calls the garbage collector if necessary.
-  static Handle<Object> CreateRegExpLiteral(Handle<String> pattern,
+  static Handle<Object> CreateRegExpLiteral(Handle<JSFunction> constructor,
+                                            Handle<String> pattern,
                                             Handle<String> flags,
                                             bool* has_pending_exception);
 
diff --git a/src/list.h b/src/list.h
index 283e74f..50b66f8 100644
--- a/src/list.h
+++ b/src/list.h
@@ -108,7 +108,7 @@
   INLINE(T* NewData(int n))  { return static_cast<T*>(P::New(n * sizeof(T))); }
   INLINE(void DeleteData(T* data))  { P::Delete(data); }
 
-  DISALLOW_EVIL_CONSTRUCTORS(List);
+  DISALLOW_COPY_AND_ASSIGN(List);
 };
 
 
diff --git a/src/log.cc b/src/log.cc
index abac0aa..a0d67b9 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -144,16 +144,16 @@
 // Ticker used to provide ticks to the profiler and the sliding state
 // window.
 //
-class Ticker: public ProfileSampler {
+class Ticker: public Sampler {
  public:
   explicit Ticker(int interval):
-      ProfileSampler(interval), window_(NULL), profiler_(NULL) {}
+      Sampler(interval, FLAG_prof), window_(NULL), profiler_(NULL) {}
 
   ~Ticker() { if (IsActive()) Stop(); }
 
   void Tick(TickSample* sample) {
     if (profiler_) profiler_->Insert(sample);
-    if (window_) window_->AddState(Logger::state());
+    if (window_) window_->AddState(sample->state);
   }
 
   void SetWindow(SlidingStateWindow* window) {
diff --git a/src/messages.js b/src/messages.js
index 1630122..49b0241 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -231,7 +231,7 @@
 Script.prototype.initSourceInfo_ = function () {
   // Just return if initialized.
   if (this.lineEnds_) return;
-  
+
   // Collect all line endings.
   this.lineEnds_ = [];
   for (var i = 0; i < this.source.length; i++) {
@@ -240,7 +240,7 @@
       this.lineEnds_.push(i);
     }
   }
-  
+
   // If the script does not end with a line ending add the final end position
   // as just past the last line ending.
   if (this.lineEnds_[this.lineEnds_.length - 1] != this.source.length - 1) {
@@ -258,7 +258,7 @@
 Script.prototype.locationFromPosition = function (position) {
   // Make sure source info has been initialized.
   this.initSourceInfo_();
-  
+
   var lineCount = this.lineCount();
   var line = -1;
   if (position <= this.lineEnds_[0]) {
@@ -271,9 +271,9 @@
       }
     }
   }
-  
+
   if (line == -1) return null;
-  
+
   // Determine start, end and column.
   var start = line == 0 ? 0 : this.lineEnds_[line - 1] + 1;
   var end = this.lineEnds_[line];
@@ -314,7 +314,7 @@
   if (!IS_UNDEFINED(opt_line)) {
     line = opt_line - this.line_offset;
   }
-  
+
   // Default is first column. If on the first line add the offset within the
   // resource.
   var column = opt_column || 0;
diff --git a/src/mirror-delay.js b/src/mirror-delay.js
index f9347bc..c1ffed1 100644
--- a/src/mirror-delay.js
+++ b/src/mirror-delay.js
@@ -94,14 +94,17 @@
 PropertyKind.Indexed = 2;
 
 
-// Different types of properties. NOTE value 1 is missing as it is used
-// internally for map transition.
+// A copy of the PropertyType enum from global.h
 PropertyType = {};
-PropertyType.Normal           = 0;
-PropertyType.ConstantFunction = 2;
-PropertyType.Field            = 3;
-PropertyType.Callbacks        = 4;
-PropertyType.Interceptor      = 5;
+PropertyType.Normal             = 0;
+PropertyType.Field              = 1;
+PropertyType.ConstantFunction   = 2;
+PropertyType.Callbacks          = 3;
+PropertyType.Interceptor        = 4;
+PropertyType.MapTransition      = 5;
+PropertyType.ConstantTransition = 6;
+PropertyType.NullDescriptor     = 7;
+
 
 
 // Different attributes for a property.
diff --git a/src/mksnapshot.cc b/src/mksnapshot.cc
index 5d98469..d0a67ce 100644
--- a/src/mksnapshot.cc
+++ b/src/mksnapshot.cc
@@ -25,6 +25,8 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+// To avoid warnings from <map> on windows we disable exceptions.
+#define _HAS_EXCEPTIONS 0
 #include <signal.h>
 #include <string>
 #include <map>
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index d12b7d3..00b086e 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -133,6 +133,7 @@
       JSBuiltinsObject::cast(this)->JSBuiltinsObjectPrint();
       break;
     case JS_VALUE_TYPE:
+      PrintF("Value wrapper around:");
       JSValue::cast(this)->value()->Print();
       break;
     case CODE_TYPE:
diff --git a/src/objects-inl.h b/src/objects-inl.h
index ed84ce4..f7978ae 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -979,6 +979,13 @@
 }
 
 
+bool DescriptorArray::IsEmpty() {
+  ASSERT(this == Heap::empty_descriptor_array() ||
+         this->length() > 2);
+  return this == Heap::empty_descriptor_array();
+}
+
+
 void DescriptorArray::fast_swap(FixedArray* array, int first, int second) {
   Object* tmp = array->get(first);
   fast_set(array, first, array->get(second));
diff --git a/src/objects.cc b/src/objects.cc
index 4bda9cc..87e07d9 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -918,6 +918,10 @@
 
 
 Object* JSObject::Copy(PretenureFlag pretenure) {
+  // Never used to copy functions.  If functions need to be copied we
+  // have to be careful to clear the literals array.
+  ASSERT(!IsJSFunction());
+
   // Copy the elements and properties.
   Object* elem = FixedArray::cast(elements())->Copy();
   if (elem->IsFailure()) return elem;
@@ -935,11 +939,6 @@
   JSObject::cast(clone)->set_elements(FixedArray::cast(elem));
   JSObject::cast(clone)->set_properties(FixedArray::cast(prop));
 
-  // NOTE: Copy is only used for copying objects and functions from
-  // boilerplates. This means if we have a function the prototype is
-  // not present.
-  ASSERT(!IsJSFunction() || !JSFunction::cast(clone)->has_prototype());
-
   // Return the new clone.
   return clone;
 }
@@ -998,7 +997,7 @@
   // Allocate new instance descriptors with (name, index) added
   FieldDescriptor new_field(name, index, attributes);
   Object* new_descriptors =
-      old_descriptors->CopyInsert(&new_field, true);
+      old_descriptors->CopyInsert(&new_field, REMOVE_TRANSITIONS);
   if (new_descriptors->IsFailure()) return new_descriptors;
 
   // Only allow map transition if the object's map is NOT equal to the
@@ -1017,7 +1016,7 @@
     if (allow_map_transition) {
       // Allocate new instance descriptors for the old map with map transition.
       MapTransitionDescriptor d(name, Map::cast(new_map), attributes);
-      Object* r = old_descriptors->CopyInsert(&d);
+      Object* r = old_descriptors->CopyInsert(&d, KEEP_TRANSITIONS);
       if (r->IsFailure()) return r;
       old_descriptors = DescriptorArray::cast(r);
     }
@@ -1031,8 +1030,7 @@
   } else {
     ASSERT(map()->unused_property_fields() == 0);
 
-    static const int kFastNofProperties = 8;
-    if (properties()->length() > kFastNofProperties) {
+    if (properties()->length() > kMaxFastProperties) {
       Object* obj = NormalizeProperties();
       if (obj->IsFailure()) return obj;
       return AddSlowProperty(name, value, attributes);
@@ -1053,7 +1051,7 @@
     if (allow_map_transition) {
       MapTransitionDescriptor d(name, Map::cast(new_map), attributes);
       // Allocate new instance descriptors for the old map with map transition.
-      Object* r = old_descriptors->CopyInsert(&d);
+      Object* r = old_descriptors->CopyInsert(&d, KEEP_TRANSITIONS);
       if (r->IsFailure()) return r;
       old_descriptors = DescriptorArray::cast(r);
     }
@@ -1076,7 +1074,7 @@
   // Allocate new instance descriptors with (name, function) added
   ConstantFunctionDescriptor d(name, function, attributes);
   Object* new_descriptors =
-      map()->instance_descriptors()->CopyInsert(&d, true);
+      map()->instance_descriptors()->CopyInsert(&d, REMOVE_TRANSITIONS);
   if (new_descriptors->IsFailure()) return new_descriptors;
 
   // Allocate a new map for the object.
@@ -1107,7 +1105,8 @@
     return function;
   }
   ConstTransitionDescriptor mark(name);
-  new_descriptors = old_map->instance_descriptors()->CopyInsert(&mark, false);
+  new_descriptors =
+      old_map->instance_descriptors()->CopyInsert(&mark, KEEP_TRANSITIONS);
   if (new_descriptors->IsFailure()) {
     return function;  // We have accomplished the main goal, so return success.
   }
@@ -1125,23 +1124,15 @@
   if (value->IsJSFunction()) {
     JSFunction* function = JSFunction::cast(value);
 
-    // Allocate new instance descriptors with (name, function) added
-    Object* new_descriptors = map()->instance_descriptors()->Copy();
-    if (new_descriptors->IsFailure()) return new_descriptors;
+    Object* new_map =
+      map()->CopyDropTransitions();
+    if (new_map->IsFailure()) return new_map;
+    set_map(Map::cast(new_map));
 
     // Replace the function entry
-    DescriptorArray* p = DescriptorArray::cast(new_descriptors);
-    for (DescriptorReader r(p); !r.eos(); r.advance()) {
-      if (r.Equals(name)) r.ReplaceConstantFunction(function);
-    }
-
-    // Allocate a new map for the object.
-    Object* new_map = map()->Copy();
-    if (new_map->IsFailure()) return new_map;
-
-    Map::cast(new_map)->
-      set_instance_descriptors(DescriptorArray::cast(new_descriptors));
-    set_map(Map::cast(new_map));
+    int index = map()->instance_descriptors()->Search(name);
+    ASSERT(index != DescriptorArray::kNotFound);
+    map()->instance_descriptors()->ReplaceConstantFunction(index, function);
   } else {
     // Allocate new instance descriptors with updated property index.
     int index = map()->NextFreePropertyIndex();
@@ -1516,62 +1507,66 @@
     && !Top::MayNamedAccess(this, name, v8::ACCESS_SET)) {
     return SetPropertyWithFailedAccessCheck(result, name, value);
   }
-
-  if (result->IsValid()) {
-    if (!result->IsLoaded()) {
-      return SetLazyProperty(result, name, value, attributes);
+  if (result->IsNotFound() || !result->IsProperty()) {
+    // We could not find a local property so let's check whether there is an
+    // accessor that wants to handle the property.
+    LookupResult accessor_result;
+    LookupCallbackSetterInPrototypes(name, &accessor_result);
+    if (accessor_result.IsValid()) {
+      return SetPropertyWithCallback(accessor_result.GetCallbackObject(),
+                                     name,
+                                     value,
+                                     accessor_result.holder());
     }
-    if (result->IsReadOnly() && !result->IsTransitionType()) return value;
-    switch (result->type()) {
-      case NORMAL:
-        property_dictionary()->ValueAtPut(result->GetDictionaryEntry(), value);
-        return value;
-      case FIELD:
-        properties()->set(result->GetFieldIndex(), value);
-        return value;
-      case MAP_TRANSITION:
-        if (attributes == result->GetAttributes()) {
-          // Only use map transition if attributes matches.
-          return AddFastPropertyUsingMap(result->GetTransitionMap(),
-                                         name,
-                                         value);
-        } else {
-          return AddFastProperty(name, value, attributes);
-        }
-      case CONSTANT_FUNCTION:
-        if (value == result->GetConstantFunction()) return value;
-        // Only replace the function if necessary.
-        return ReplaceConstantFunctionProperty(name, value);
-      case CALLBACKS:
-        return SetPropertyWithCallback(result->GetCallbackObject(),
+  }
+  if (result->IsNotFound()) {
+    return AddProperty(name, value, attributes);
+  }
+  if (!result->IsLoaded()) {
+    return SetLazyProperty(result, name, value, attributes);
+  }
+  if (result->IsReadOnly() && result->IsProperty()) return value;
+  // This is a real property that is not read-only, or it is a
+  // transition or null descriptor and there are no setters in the prototypes.
+  switch (result->type()) {
+    case NORMAL:
+      property_dictionary()->ValueAtPut(result->GetDictionaryEntry(), value);
+      return value;
+    case FIELD:
+      properties()->set(result->GetFieldIndex(), value);
+      return value;
+    case MAP_TRANSITION:
+      if (attributes == result->GetAttributes()) {
+        // Only use map transition if the attributes match.
+        return AddFastPropertyUsingMap(result->GetTransitionMap(),
                                        name,
-                                       value,
-                                       result->holder());
-      case INTERCEPTOR:
-        return SetPropertyWithInterceptor(name, value, attributes);
-      case CONSTANT_TRANSITION:
-        // Replace with a MAP_TRANSITION to a new map with a FIELD, even
-        // if the value is a function.
-        // AddProperty has been extended to do this, in this case.
+                                       value);
+      } else {
         return AddFastProperty(name, value, attributes);
-      default:
-        UNREACHABLE();
-    }
+      }
+    case CONSTANT_FUNCTION:
+      if (value == result->GetConstantFunction()) return value;
+      // Only replace the function if necessary.
+      return ReplaceConstantFunctionProperty(name, value);
+    case CALLBACKS:
+      return SetPropertyWithCallback(result->GetCallbackObject(),
+                                     name,
+                                     value,
+                                     result->holder());
+    case INTERCEPTOR:
+      return SetPropertyWithInterceptor(name, value, attributes);
+    case CONSTANT_TRANSITION:
+      // Replace with a MAP_TRANSITION to a new map with a FIELD, even
+      // if the value is a function.
+      // AddProperty has been extended to do this, in this case.
+      return AddFastProperty(name, value, attributes);
+    case NULL_DESCRIPTOR:
+      UNREACHABLE();
+    default:
+      UNREACHABLE();
   }
-
-  // We could not find a local property so let's check whether there is an
-  // accessor that wants to handle the property.
-  LookupResult accessor_result;
-  LookupCallbackSetterInPrototypes(name, &accessor_result);
-  if (accessor_result.IsValid()) {
-    return SetPropertyWithCallback(accessor_result.GetCallbackObject(),
-                                   name,
-                                   value,
-                                   accessor_result.holder());
-  }
-
-  // The property was not found
-  return AddProperty(name, value, attributes);
+  UNREACHABLE();
+  return value;
 }
 
 
@@ -1613,6 +1608,8 @@
       case INTERCEPTOR:
         return SetPropertyWithInterceptor(name, value, NONE);
       case CONSTANT_TRANSITION:
+      case NULL_DESCRIPTOR:
+        UNREACHABLE();
         break;
     }
   }
@@ -1728,7 +1725,12 @@
       case INTERCEPTOR:
         return result->holder()->
           GetPropertyAttributeWithInterceptor(receiver, name, continue_search);
+      case MAP_TRANSITION:
+      case CONSTANT_TRANSITION:
+      case NULL_DESCRIPTOR:
+        return ABSENT;
       default:
+        UNREACHABLE();
         break;
     }
   }
@@ -1791,8 +1793,14 @@
         dictionary = Dictionary::cast(result);
         break;
       }
+      case MAP_TRANSITION:
+      case CONSTANT_TRANSITION:
+      case NULL_DESCRIPTOR:
+      case INTERCEPTOR:
+        break;
       default:
-        ASSERT(details.IsTransition());
+      case NORMAL:
+        UNREACHABLE();
         break;
     }
   }
@@ -1801,17 +1809,15 @@
   int index = map()->instance_descriptors()->NextEnumerationIndex();
   dictionary->SetNextEnumerationIndex(index);
 
-  // Descriptors with type MAP_TRANSITION is ignored.
-
   // Allocate new map.
   obj = map()->Copy();
   if (obj->IsFailure()) return obj;
 
+  // We have now sucessfully allocated all the necessary objects.
+  // Changes can now be made with the guarantee that all of them take effect.
   set_map(Map::cast(obj));
-  map()->
-    set_instance_descriptors(DescriptorArray::cast(Heap::empty_fixed_array()));
+  map()->set_instance_descriptors(Heap::empty_descriptor_array());
 
-  // We have now allocate all the necessary object and change can be applied.
   map()->set_unused_property_fields(0);
   set_properties(dictionary);
 
@@ -2175,34 +2181,6 @@
   return index+1;
 }
 
-Object* Map::EnsureNoMapTransitions() {
-  // Remove all map transitions.
-
-  // Compute the size of the map transition entries to be removed.
-  int nof = 0;
-  for (DescriptorReader r(instance_descriptors()); !r.eos(); r.advance()) {
-    if (r.IsTransition()) nof++;
-  }
-
-  if (nof == 0) return this;
-
-  // Allocate the new descriptor array.
-  Object* result = DescriptorArray::Allocate(
-      instance_descriptors()->number_of_descriptors() - nof);
-  if (result->IsFailure()) return result;
-
-  // Copy the content.
-  DescriptorWriter w(DescriptorArray::cast(result));
-  for (DescriptorReader r(instance_descriptors()); !r.eos(); r.advance()) {
-    if (!r.IsTransition()) w.WriteFrom(&r);
-  }
-  ASSERT(w.eos());
-
-  set_instance_descriptors(DescriptorArray::cast(result));
-
-  return this;
-}
-
 
 AccessorDescriptor* Map::FindAccessor(String* name) {
   for (DescriptorReader r(instance_descriptors()); !r.eos(); r.advance()) {
@@ -2376,7 +2354,8 @@
   if (result->IsFailure()) return result;
   Map::cast(result)->set_prototype(prototype());
   Map::cast(result)->set_constructor(constructor());
-  Map::cast(result)->set_instance_descriptors(instance_descriptors());
+  // Don't copy descriptors, so map transitions always remain a forest.
+  Map::cast(result)->set_instance_descriptors(Heap::empty_descriptor_array());
   // Please note instance_type and instance_size are set when allocated.
   Map::cast(result)->set_unused_property_fields(unused_property_fields());
   Map::cast(result)->set_bit_field(bit_field());
@@ -2385,6 +2364,16 @@
 }
 
 
+Object* Map::CopyDropTransitions() {
+  Object *new_map = Copy();
+  if (new_map->IsFailure()) return new_map;
+  Object* descriptors = instance_descriptors()->RemoveTransitions();
+  if (descriptors->IsFailure()) return descriptors;
+  cast(new_map)->set_instance_descriptors(DescriptorArray::cast(descriptors));
+  return cast(new_map);
+}
+
+
 Object* Map::UpdateCodeCache(String* name, Code* code) {
   ASSERT(code->ic_state() == MONOMORPHIC);
   FixedArray* cache = code_cache();
@@ -2570,20 +2559,33 @@
 }
 
 
+#ifdef DEBUG
+bool FixedArray::IsEqualTo(FixedArray* other) {
+  if (length() != other->length()) return false;
+  for (int i = 0 ; i < length(); ++i) {
+    if (get(i) != other->get(i)) return false;
+  }
+  return true;
+}
+#endif
+
+
 Object* DescriptorArray::Allocate(int number_of_descriptors) {
-  // Allocate the descriptor array.
+  if (number_of_descriptors == 0) {
+    return Heap::empty_descriptor_array();
+  }
+  // Allocate the array of keys.
   Object* array = Heap::AllocateFixedArray(ToKeyIndex(number_of_descriptors));
   if (array->IsFailure()) return array;
-  DescriptorArray* result = DescriptorArray::cast(array);
+  // Do not use DescriptorArray::cast on incomplete object.
+  FixedArray* result = FixedArray::cast(array);
 
   // Allocate the content array and set it in the descriptor array.
   array = Heap::AllocateFixedArray(number_of_descriptors << 1);
   if (array->IsFailure()) return array;
   result->set(kContentArrayIndex, array);
-
-  // Initialize the next enumeration index.
-  result->SetNextEnumerationIndex(PropertyDetails::kInitialIndex);
-
+  result->set(kEnumerationIndexIndex,
+              Smi::FromInt(PropertyDetails::kInitialIndex));
   return result;
 }
 
@@ -2595,7 +2597,7 @@
     FixedArray::cast(get(kEnumerationIndexIndex))->
       set(kEnumCacheBridgeCacheIndex, new_cache);
   } else {
-    if (length() == 0) return;  // Do nothing for empty descriptor array.
+    if (IsEmpty()) return;  // Do nothing for empty descriptor array.
     FixedArray::cast(bridge_storage)->
       set(kEnumCacheBridgeCacheIndex, new_cache);
     fast_set(FixedArray::cast(bridge_storage),
@@ -2614,48 +2616,103 @@
 }
 
 
-Object* DescriptorArray::CopyInsert(Descriptor* desc,
-                                     bool remove_map_transitions) {
-  int transitions = 0;
-  if (remove_map_transitions) {
-    // Compute space from map transitions.
-    for (DescriptorReader r(this); !r.eos(); r.advance()) {
-      if (r.IsTransition()) transitions++;
-    }
-  }
+Object* DescriptorArray::CopyInsert(Descriptor* descriptor,
+                                    TransitionFlag transition_flag) {
+  // Transitions are only kept when inserting another transition.
+  // This precondition is not required by this function's implementation, but
+  // is currently required by the semantics of maps, so we check it.
+  // Conversely, we filter after replacing, so replacing a transition and
+  // removing all other transitions is not supported.
+  bool remove_transitions = transition_flag == REMOVE_TRANSITIONS;
+  ASSERT(remove_transitions == !descriptor->GetDetails().IsTransition());
+  ASSERT(descriptor->GetDetails().type() != NULL_DESCRIPTOR);
 
   // Ensure the key is a symbol.
-  Object* result = desc->KeyToSymbol();
+  Object* result = descriptor->KeyToSymbol();
   if (result->IsFailure()) return result;
 
-  result = Allocate(number_of_descriptors() - transitions + 1);
-  if (result->IsFailure()) return result;
+  int transitions = 0;
+  int null_descriptors = 0;
+  if (remove_transitions) {
+    for (DescriptorReader r(this); !r.eos(); r.advance()) {
+      if (r.IsTransition()) transitions++;
+      if (r.IsNullDescriptor()) null_descriptors++;
+    }
+  } else {
+    for (DescriptorReader r(this); !r.eos(); r.advance()) {
+      if (r.IsNullDescriptor()) null_descriptors++;
+    }
+  }
+  int new_size = number_of_descriptors() - transitions - null_descriptors;
 
+  // If key is in descriptor, we replace it in-place when filtering.
+  int index = Search(descriptor->key());
+  const bool inserting = (index == kNotFound);
+  const bool replacing = !inserting;
+  bool keep_enumeration_index = false;
+  if (inserting) {
+    ++new_size;
+  }
+  if (replacing) {
+    // We are replacing an existing descriptor.  We keep the enumeration
+    // index of a visible property.
+    PropertyType t = PropertyDetails(GetDetails(index)).type();
+    if (t == CONSTANT_FUNCTION ||
+        t == FIELD ||
+        t == CALLBACKS ||
+        t == INTERCEPTOR) {
+      keep_enumeration_index = true;
+    } else if (t == NULL_DESCRIPTOR || remove_transitions) {
+     // Replaced descriptor has been counted as removed if it is null
+     // or a transition that will be replaced.  Adjust count in this case.
+      ++new_size;
+    }
+  }
+  result = Allocate(new_size);
+  if (result->IsFailure()) return result;
+  DescriptorArray* new_descriptors = DescriptorArray::cast(result);
   // Set the enumeration index in the descriptors and set the enumeration index
   // in the result.
-  int index = NextEnumerationIndex();
-  desc->SetEnumerationIndex(index);
-  DescriptorArray::cast(result)->SetNextEnumerationIndex(index + 1);
-
-  // Write the old content and the descriptor information
-  DescriptorWriter w(DescriptorArray::cast(result));
-  DescriptorReader r(this);
-  while (!r.eos() && r.GetKey()->Hash() <= desc->key()->Hash()) {
-    if (!r.IsTransition() || !remove_map_transitions) {
-      w.WriteFrom(&r);
+  int enumeration_index = NextEnumerationIndex();
+  if (!descriptor->GetDetails().IsTransition()) {
+    if (keep_enumeration_index) {
+      descriptor->SetEnumerationIndex(
+          PropertyDetails(GetDetails(index)).index());
+    } else {
+      descriptor->SetEnumerationIndex(enumeration_index);
+      ++enumeration_index;
     }
-    r.advance();
   }
-  w.Write(desc);
-  while (!r.eos()) {
-    if (!r.IsTransition() || !remove_map_transitions) {
-      w.WriteFrom(&r);
-    }
+  new_descriptors->SetNextEnumerationIndex(enumeration_index);
+
+  // Copy the descriptors, filtering out transitions and null descriptors,
+  // and inserting or replacing a descriptor.
+  DescriptorWriter w(new_descriptors);
+  DescriptorReader r(this);
+  uint32_t descriptor_hash = descriptor->key()->Hash();
+
+  for (; !r.eos(); r.advance()) {
+    if (r.GetKey()->Hash() > descriptor_hash ||
+        r.GetKey() == descriptor->GetKey()) break;
+    if (r.IsNullDescriptor()) continue;
+    if (remove_transitions && r.IsTransition()) continue;
+    w.WriteFrom(&r);
+  }
+  w.Write(descriptor);
+  if (replacing) {
+    ASSERT(r.GetKey() == descriptor->GetKey());
     r.advance();
+  } else {
+    ASSERT(r.eos() || r.GetKey()->Hash() > descriptor_hash);
+  }
+  for (; !r.eos(); r.advance()) {
+    if (r.IsNullDescriptor()) continue;
+    if (remove_transitions && r.IsTransition()) continue;
+    w.WriteFrom(&r);
   }
   ASSERT(w.eos());
 
-  return result;
+  return new_descriptors;
 }
 
 
@@ -2707,7 +2764,6 @@
   // Set the enumeration index in the descriptors and set the enumeration index
   // in the result.
   new_descriptors->SetNextEnumerationIndex(NextEnumerationIndex());
-
   // Write the old content and the descriptor information
   DescriptorWriter w(new_descriptors);
   DescriptorReader r(this);
@@ -2723,6 +2779,32 @@
 }
 
 
+Object* DescriptorArray::RemoveTransitions() {
+  // Remove all transitions.  Return a copy of the array with all transitions
+  // removed, or a Failure object if the new array could not be allocated.
+
+  // Compute the size of the map transition entries to be removed.
+  int count_transitions = 0;
+  for (DescriptorReader r(this); !r.eos(); r.advance()) {
+    if (r.IsTransition()) count_transitions++;
+  }
+
+  // Allocate the new descriptor array.
+  Object* result = Allocate(number_of_descriptors() - count_transitions);
+  if (result->IsFailure()) return result;
+  DescriptorArray* new_descriptors = DescriptorArray::cast(result);
+
+  // Copy the content.
+  DescriptorWriter w(new_descriptors);
+  for (DescriptorReader r(this); !r.eos(); r.advance()) {
+    if (!r.IsTransition()) w.WriteFrom(&r);
+  }
+  ASSERT(w.eos());
+
+  return new_descriptors;
+}
+
+
 void DescriptorArray::Sort() {
   // In-place heap sort.
   int len = number_of_descriptors();
@@ -2802,6 +2884,19 @@
 }
 
 
+#ifdef DEBUG
+bool DescriptorArray::IsEqualTo(DescriptorArray* other) {
+  if (IsEmpty()) return other->IsEmpty();
+  if (other->IsEmpty()) return false;
+  if (length() != other->length()) return false;
+  for (int i = 0; i < length(); ++i) {
+    if (get(i) != other->get(i) && i != kContentArrayIndex) return false;
+  }
+  return GetContentArray()->IsEqualTo(other->GetContentArray());
+}
+#endif
+
+
 static StaticResource<StringInputBuffer> string_input_buffer;
 
 
@@ -3766,17 +3861,15 @@
   // See ECMA-262 13.2.2.
   if (!value->IsJSObject()) {
     // Copy the map so this does not affect unrelated functions.
-    // Remove map transitions so we do not lose the prototype
-    // information on map transitions.
-    Object* copy = map()->Copy();
-    if (copy->IsFailure()) return copy;
-    Object* new_map = Map::cast(copy)->EnsureNoMapTransitions();
+    // Remove map transitions because they point to maps with a
+    // different prototype.
+    Object* new_map = map()->CopyDropTransitions();
     if (new_map->IsFailure()) return new_map;
     set_map(Map::cast(new_map));
-
     map()->set_constructor(value);
     map()->set_non_instance_prototype(true);
-    construct_prototype = *Top::initial_object_prototype();
+    construct_prototype =
+        Top::context()->global_context()->initial_object_prototype();
   } else {
     map()->set_non_instance_prototype(false);
   }
@@ -4211,8 +4304,8 @@
       }
       int min = NewElementsCapacity(old_capacity);
       int new_capacity = value > min ? value : min;
-      if (KeepInFastCase(new_capacity) ||
-          new_capacity <= kMaxFastElementsLength) {
+      if (new_capacity <= kMaxFastElementsLength ||
+          !ShouldConvertToSlowElements(new_capacity)) {
         Object* obj = Heap::AllocateFixedArrayWithHoles(new_capacity);
         if (obj->IsFailure()) return obj;
         if (IsJSArray()) JSArray::cast(this)->set_length(smi_length);
@@ -4464,8 +4557,8 @@
   if ((index - elms_length) < kMaxGap) {
     // Try allocating extra space.
     int new_capacity = NewElementsCapacity(index+1);
-    if (KeepInFastCase(new_capacity) ||
-        new_capacity <= kMaxFastElementsLength) {
+    if (new_capacity <= kMaxFastElementsLength ||
+        !ShouldConvertToSlowElements(new_capacity)) {
       ASSERT(static_cast<uint32_t>(new_capacity) > index);
       Object* obj = Heap::AllocateFixedArrayWithHoles(new_capacity);
       if (obj->IsFailure()) return obj;
@@ -4520,7 +4613,7 @@
   }
 
   // Attempt to put this object back in fast case.
-  if (ShouldHaveFastElements()) {
+  if (ShouldConvertToFastElements()) {
     uint32_t new_length = 0;
     if (IsJSArray()) {
       CHECK(Array::IndexFromObject(JSArray::cast(this)->length(), &new_length));
@@ -4672,17 +4765,17 @@
 }
 
 
-bool JSObject::KeepInFastCase(int new_capacity) {
+bool JSObject::ShouldConvertToSlowElements(int new_capacity) {
   ASSERT(HasFastElements());
   // Keep the array in fast case if the current backing storage is
   // almost filled and if the new capacity is no more than twice the
   // old capacity.
   int elements_length = FixedArray::cast(elements())->length();
-  return HasDenseElements() && ((new_capacity / 2) <= elements_length);
+  return !HasDenseElements() || ((new_capacity / 2) > elements_length);
 }
 
 
-bool JSObject::ShouldHaveFastElements() {
+bool JSObject::ShouldConvertToFastElements() {
   ASSERT(!HasFastElements());
   Dictionary* dictionary = Dictionary::cast(elements());
   // If the elements are sparse, we should not go back to fast case.
@@ -4865,8 +4958,15 @@
       case NORMAL:    // fall through.
       case FIELD:     // fall through.
       case CALLBACKS:  // fall through.
-      case CONSTANT_FUNCTION: return true;
-      default: return false;
+      case CONSTANT_FUNCTION:
+        return true;
+      case INTERCEPTOR:
+      case MAP_TRANSITION:
+      case CONSTANT_TRANSITION:
+      case NULL_DESCRIPTOR:
+        return false;
+      default:
+        UNREACHABLE();
     }
   }
 
@@ -5100,8 +5200,9 @@
     }
     ASSERT(!storage || storage->length() >= counter);
   } else {
-    if (storage)
+    if (storage) {
       element_dictionary()->CopyKeysTo(storage, filter);
+    }
     counter = element_dictionary()->NumberOfElementsFilterAttributes(filter);
   }
 
@@ -5507,7 +5608,7 @@
 
 
 Object* Dictionary::EnsureCapacity(int n, Key* key) {
-  // Check whether there is enough enumeration indices for adding n elements.
+  // Check whether there are enough enumeration indices to add n elements.
   if (key->IsStringKey() &&
       !PropertyDetails::IsValidIndex(NextEnumerationIndex() + n)) {
     // If not, we generate new indices for the properties.
@@ -5794,9 +5895,10 @@
   }
 
   // Allocate the instance descriptor.
-  Object* instance_descriptors =
+  Object* descriptors_unchecked =
       DescriptorArray::Allocate(instance_descriptor_length);
-  if (instance_descriptors->IsFailure()) return instance_descriptors;
+  if (descriptors_unchecked->IsFailure()) return descriptors_unchecked;
+  DescriptorArray* descriptors = DescriptorArray::cast(descriptors_unchecked);
 
   int number_of_allocated_fields = number_of_fields + unused_property_fields;
 
@@ -5805,7 +5907,7 @@
   if (fields->IsFailure()) return fields;
 
   // Fill in the instance descriptor and the fields.
-  DescriptorWriter w(DescriptorArray::cast(instance_descriptors));
+  DescriptorWriter w(descriptors);
   int current_offset = 0;
   for (int i = 0; i < capacity; i++) {
     Object* k = KeyAt(i);
@@ -5842,25 +5944,20 @@
   }
   ASSERT(current_offset == number_of_fields);
 
-  // Sort the instance descriptors.
-  DescriptorArray::cast(instance_descriptors)->Sort();
-
+  descriptors->Sort();
   // Allocate new map.
   Object* new_map = obj->map()->Copy();
   if (new_map->IsFailure()) return new_map;
 
   // Transform the object.
-  Map::cast(new_map)->
-      set_instance_descriptors(DescriptorArray::cast(instance_descriptors));
-  Map::cast(new_map)->set_unused_property_fields(unused_property_fields);
   obj->set_map(Map::cast(new_map));
+  obj->map()->set_instance_descriptors(descriptors);
+  obj->map()->set_unused_property_fields(unused_property_fields);
+
   obj->set_properties(FixedArray::cast(fields));
   ASSERT(obj->IsJSObject());
 
-  // Transfer next enumeration index from dictionary to instance descriptors.
-  DescriptorArray::cast(instance_descriptors)->
-      SetNextEnumerationIndex(NextEnumerationIndex());
-
+  descriptors->SetNextEnumerationIndex(NextEnumerationIndex());
   // Check it really works.
   ASSERT(obj->HasFastProperties());
   return obj;
diff --git a/src/objects.h b/src/objects.h
index e337b54..82c6faf 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -52,6 +52,7 @@
 //       - Array
 //         - ByteArray
 //         - FixedArray
+//           - DescriptorArray
 //           - HashTable
 //             - Dictionary
 //             - SymbolTable
@@ -135,8 +136,7 @@
   bool IsTransition() {
     PropertyType t = type();
     ASSERT(t != INTERCEPTOR);
-    if (t == MAP_TRANSITION || t == CONSTANT_TRANSITION) return true;
-    return false;
+    return t == MAP_TRANSITION || t == CONSTANT_TRANSITION;
   }
 
   PropertyAttributes attributes() { return AttributesField::decode(value_); }
@@ -1095,23 +1095,20 @@
 class JSObject: public HeapObject {
  public:
   // [properties]: Backing storage for properties.
-  DECL_ACCESSORS(properties, FixedArray)
+  // properties is a FixedArray in the fast case, and a Dictionary in the
+  // slow case.
+  DECL_ACCESSORS(properties, FixedArray)  // Get and set fast properties.
   inline void initialize_properties();
-
-  // [elements]: The elements in the fast case.
-  DECL_ACCESSORS(elements, HeapObject)
-  inline void initialize_elements();
-
-  // Accessors for properties.
   inline bool HasFastProperties();
+  inline Dictionary* property_dictionary();  // Gets slow properties.
 
-  // Do we want to keep the elements in fast case when increasing the
-  // capacity?
-  bool KeepInFastCase(int new_capacity);
-
-  // Accessors for slow properties
-  inline Dictionary* property_dictionary();  // asserts !HasFastProperties
-  inline Dictionary* element_dictionary();  // asserts !HasFastElements
+  // [elements]: The elements (properties with names that are integers).
+  // elements is a FixedArray in the fast case, and a Dictionary in the slow
+  // case.
+  DECL_ACCESSORS(elements, HeapObject)  // Get and set fast elements.
+  inline void initialize_elements();
+  inline bool HasFastElements();
+  inline Dictionary* element_dictionary();  // Gets slow elements.
 
   Object* SetProperty(String* key,
                       Object* value,
@@ -1188,14 +1185,14 @@
   // Tests for the fast common case for property enumeration.
   bool IsSimpleEnum();
 
-  // Tells whether the backing storage for elements is fast (FixedArray).
-  inline bool HasFastElements();
-
+  // Do we want to keep the elements in fast case when increasing the
+  // capacity?
+  bool ShouldConvertToSlowElements(int new_capacity);
   // Returns true if the backing storage for the slow-case elements of
   // this object takes up nearly as much space as a fast-case backing
   // storage would.  In that case the JSObject should have fast
   // elements.
-  bool ShouldHaveFastElements();
+  bool ShouldConvertToFastElements();
 
   // Return the object's prototype (might be Heap::null_value()).
   inline Object* GetPrototype();
@@ -1370,6 +1367,7 @@
 
   static const uint32_t kMaxGap = 1024;
   static const int kMaxFastElementsLength = 5000;
+  static const int kMaxFastProperties = 8;
 
   // Layout description.
   static const int kPropertiesOffset = HeapObject::kSize;
@@ -1477,6 +1475,8 @@
 #ifdef DEBUG
   void FixedArrayPrint();
   void FixedArrayVerify();
+  // Checks if two FixedArrays have identical contents.
+  bool IsEqualTo(FixedArray* other);
 #endif
 
   // Swap two elements.
@@ -1505,14 +1505,15 @@
 //
 class DescriptorArray: public FixedArray {
  public:
+  // Is this the singleton empty_descriptor_array?
+  inline bool IsEmpty();
   // Returns the number of descriptors in the array.
   int number_of_descriptors() {
-    int len = length();
-    return len == 0 ? 0 : len - kFirstIndex;
+    return IsEmpty() ? 0 : length() - kFirstIndex;
   }
 
   int NextEnumerationIndex() {
-    if (length() == 0) return PropertyDetails::kInitialIndex;
+    if (IsEmpty()) return PropertyDetails::kInitialIndex;
     Object* obj = get(kEnumerationIndexIndex);
     if (obj->IsSmi()) {
       return Smi::cast(obj)->value();
@@ -1524,11 +1525,12 @@
 
   // Set next enumeration index and flush any enum cache.
   void SetNextEnumerationIndex(int value) {
-    fast_set(this, kEnumerationIndexIndex, Smi::FromInt(value));
+    if (!IsEmpty()) {
+      fast_set(this, kEnumerationIndexIndex, Smi::FromInt(value));
+    }
   }
-
   bool HasEnumCache() {
-    return length() > 0 && !get(kEnumerationIndexIndex)->IsSmi();
+    return !IsEmpty() && !get(kEnumerationIndexIndex)->IsSmi();
   }
 
   Object* GetEnumCache() {
@@ -1553,8 +1555,18 @@
   void ReplaceConstantFunction(int descriptor_number, JSFunction* value);
 
   // Copy the descriptor array, insert a new descriptor and optionally
-  // remove map transitions.
-  Object* CopyInsert(Descriptor* desc, bool remove_map_transitions = false);
+  // remove map transitions.  If the descriptor is already present, it is
+  // replaced.  If a replaced descriptor is a real property (not a transition
+  // or null), its enumeration index is kept as is.
+  // If adding a real property, map transitions must be removed.  If adding
+  // a transition, they must not be removed.  All null descriptors are removed.
+  Object* CopyInsert(Descriptor* descriptor, TransitionFlag transition_flag);
+
+  // Makes a copy of the descriptor array with the descriptor with key name
+  // removed.  If name is the empty string, the descriptor array is copied.
+  // Transitions are removed if TransitionFlag is REMOVE_TRANSITIONS.
+  // All null descriptors are removed.
+  Object* CopyRemove(TransitionFlag remove_transitions, String* name);
 
   // Copy the descriptor array, replace the property index and attributes
   // of the named property, but preserve its enumeration index.
@@ -1564,6 +1576,10 @@
   // of the named property.
   Object* CopyRemove(String* name);
 
+  // Remove all transitions.  Return  a copy of the array with all transitions
+  // removed, or a Failure object if the new array could not be allocated.
+  Object* RemoveTransitions();
+
   // Sort the instance descriptors by the hash codes of their keys.
   void Sort();
 
@@ -1579,6 +1595,9 @@
   // with low=0 and high=2.
   int BinarySearch(String* name, int low, int high);
 
+
+  // Allocates a DescriptorArray, but returns the singleton
+  // empty descriptor array object if number_of_descriptors is 0.
   static Object* Allocate(int number_of_descriptors);
 
   // Casting.
@@ -1612,6 +1631,9 @@
 
   // Is the descriptor array sorted and without duplicates?
   bool IsSortedNoDuplicates();
+
+  // Are two DescriptorArrays equal?
+  bool IsEqualTo(DescriptorArray* other);
 #endif
 
   // The maximum number of descriptors we want in a descriptor array (should
@@ -2280,6 +2302,10 @@
   // Returns a copy of the map.
   Object* Copy();
 
+  // Returns a copy of the map, with all transitions dropped from the
+  // instance descriptors.
+  Object* CopyDropTransitions();
+
   // Returns the property index for name (only valid for FAST MODE).
   int PropertyIndexFor(String* name);
 
@@ -2295,9 +2321,6 @@
   // Locate an accessor in the instance descriptor.
   AccessorDescriptor* FindAccessor(String* name);
 
-  // Make sure the instance descriptor has no map transitions
-  Object* EnsureNoMapTransitions();
-
   // Code cache operations.
 
   // Clears the code cache.
@@ -2568,6 +2591,14 @@
   inline bool IsLoaded();
 
   // [literals]: Fixed array holding the materialized literals.
+  //
+  // If the function contains object, regexp or array literals, the
+  // literals array prefix contains the object, regexp, and array
+  // function to be used when creating these literals.  This is
+  // necessary so that we do not dynamically lookup the object, regexp
+  // or array functions.  Performing a dynamic lookup, we might end up
+  // using the functions from a new context that we should not have
+  // access to.
   DECL_ACCESSORS(literals, FixedArray)
 
   // The initial map for an object created by this constructor.
@@ -2620,6 +2651,12 @@
   static const int kLiteralsOffset = kContextOffset + kPointerSize;
   static const int kSize = kLiteralsOffset + kPointerSize;
 
+  // Layout of the literals array.
+  static const int kLiteralsPrefixSize = 3;
+  static const int kLiteralObjectFunctionIndex = 0;
+  static const int kLiteralRegExpFunctionIndex = 1;
+  static const int kLiteralArrayFunctionIndex = 2;
+
  private:
   DISALLOW_IMPLICIT_CONSTRUCTORS(JSFunction);
 };
diff --git a/src/parser.cc b/src/parser.cc
index b491cfb..d9a65f3 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -232,17 +232,32 @@
  public:
   explicit TemporaryScope(Parser* parser);
   ~TemporaryScope();
-  int NextMaterializedLiteralIndex() { return materialized_literal_count_++; }
-  void AddProperty() { expected_property_count_++; }
 
+  int NextMaterializedLiteralIndex() {
+    int next_index =
+        materialized_literal_count_ + JSFunction::kLiteralsPrefixSize;
+    materialized_literal_count_++;
+    return next_index;
+  }
   int materialized_literal_count() { return materialized_literal_count_; }
+
+  void set_contains_array_literal() { contains_array_literal_ = true; }
+  bool contains_array_literal() { return contains_array_literal_; }
+
+  void AddProperty() { expected_property_count_++; }
   int expected_property_count() { return expected_property_count_; }
  private:
   // Captures the number of nodes that need materialization in the
-  // function.  regexp literals, boilerplate for array literals, and
-  // boilerplate for object literals.
+  // function.  regexp literals, and boilerplate for object literals.
   int materialized_literal_count_;
 
+  // Captures whether or not the function contains array literals.  If
+  // the function contains array literals, we have to allocate space
+  // for the array constructor in the literals array of the function.
+  // This array constructor is used when creating the actual array
+  // literals.
+  bool contains_array_literal_;
+
   // Properties count estimation.
   int expected_property_count_;
 
@@ -256,6 +271,7 @@
 
 TemporaryScope::TemporaryScope(Parser* parser)
   : materialized_literal_count_(0),
+    contains_array_literal_(false),
     expected_property_count_(0),
     parser_(parser),
     parent_(parser->temp_scope_) {
@@ -695,7 +711,7 @@
 
 bool Parser::PreParseProgram(unibrow::CharacterStream* stream) {
   StatsRateScope timer(&Counters::pre_parse);
-
+  StackGuard guard;
   AssertNoZoneAllocation assert_no_zone_allocation;
   AssertNoAllocation assert_no_allocation;
   NoHandleAllocation no_handle_allocation;
@@ -715,6 +731,8 @@
 FunctionLiteral* Parser::ParseProgram(Handle<String> source,
                                       unibrow::CharacterStream* stream,
                                       bool in_global_context) {
+  ZoneScope zone_scope(DONT_DELETE_ON_EXIT);
+
   StatsRateScope timer(&Counters::parse);
   Counters::total_parse_size.Increment(source->length());
 
@@ -744,6 +762,7 @@
       result = NEW(FunctionLiteral(no_name, top_scope_,
                                    body.elements(),
                                    temp_scope.materialized_literal_count(),
+                                   temp_scope.contains_array_literal(),
                                    temp_scope.expected_property_count(),
                                    0, 0, source->length(), false));
     } else if (scanner().stack_overflow()) {
@@ -756,7 +775,7 @@
 
   // If there was a syntax error we have to get rid of the AST
   // and it is not safe to do so before the scope has been deleted.
-  if (result == NULL) Zone::DeleteAll();
+  if (result == NULL) zone_scope.DeleteOnExit();
   return result;
 }
 
@@ -765,6 +784,7 @@
                                    Handle<String> name,
                                    int start_position,
                                    bool is_expression) {
+  ZoneScope zone_scope(DONT_DELETE_ON_EXIT);
   StatsRateScope timer(&Counters::parse_lazy);
   Counters::total_parse_size.Increment(source->length());
   SafeStringInputBuffer buffer(source.location());
@@ -802,7 +822,7 @@
   // not safe to do before scope has been deleted.
   if (result == NULL) {
     Top::StackOverflow();
-    Zone::DeleteAll();
+    zone_scope.DeleteOnExit();
   }
   return result;
 }
@@ -1109,7 +1129,7 @@
   const int literals = fun->NumberOfLiterals();
   Handle<Code> code = Handle<Code>(fun->shared()->code());
   Handle<JSFunction> boilerplate =
-      Factory::NewFunctionBoilerplate(name, literals, code);
+      Factory::NewFunctionBoilerplate(name, literals, false, code);
 
   // Copy the function data to the boilerplate. Used by
   // builtins.cc:HandleApiCall to perform argument type checks and to
@@ -1699,13 +1719,10 @@
   Handle<FixedArray> constant_properties = Factory::empty_fixed_array();
   ZoneList<Expression*>* arguments = new ZoneList<Expression*>(1);
   arguments->Add(new Literal(constant_properties));
-  Expression* literal = new CallRuntime(
-      Factory::CreateObjectLiteralBoilerplate_symbol(),
-      Runtime::FunctionForId(Runtime::kCreateObjectLiteralBoilerplate),
-      arguments);
 
-  return new ObjectLiteral(constant_properties, literal,
-                           properties.elements(), literal_index);
+  return new ObjectLiteral(constant_properties,
+                           properties.elements(),
+                           literal_index);
 }
 
 
@@ -2602,7 +2619,11 @@
     }
   }
   Expect(Token::RBRACK, CHECK_OK);
-  if (values.elements() == NULL) return NULL;
+
+  // Update the scope information before the pre-parsing bailout.
+  temp_scope_->set_contains_array_literal();
+
+  if (is_pre_parsing_) return NULL;
 
   // Allocate a fixed array with all the literals.
   Handle<FixedArray> literals =
@@ -2618,16 +2639,7 @@
     }
   }
 
-  // Construct the expression for calling Runtime::CreateArray
-  // with the literal array as argument.
-  ZoneList<Expression*>* arguments = new ZoneList<Expression*>(1);
-  arguments->Add(NEW(Literal(literals)));
-  Expression* result =
-      NEW(CallRuntime(Factory::CreateArrayLiteral_symbol(),
-                      Runtime::FunctionForId(Runtime::kCreateArrayLiteral),
-                      arguments));
-
-  return NEW(ArrayLiteral(literals, result, values.elements()));
+  return NEW(ArrayLiteral(literals, values.elements()));
 }
 
 
@@ -2717,9 +2729,8 @@
   int literal_index = temp_scope_->NextMaterializedLiteralIndex();
   if (is_pre_parsing_) return NULL;
 
-  Handle<FixedArray> constant_properties = (number_of_constant_properties == 0)
-      ? Factory::empty_fixed_array()
-      : Factory::NewFixedArray(number_of_constant_properties*2, TENURED);
+  Handle<FixedArray> constant_properties =
+      Factory::NewFixedArray(number_of_constant_properties * 2, TENURED);
   int position = 0;
   for (int i = 0; i < properties.length(); i++) {
     ObjectLiteral::Property* property = properties.at(i);
@@ -2736,13 +2747,9 @@
   // with the literal array as argument.
   ZoneList<Expression*>* arguments = new ZoneList<Expression*>(1);
   arguments->Add(new Literal(constant_properties));
-  Expression* result =
-    new CallRuntime(
-        Factory::CreateObjectLiteralBoilerplate_symbol(),
-        Runtime::FunctionForId(Runtime::kCreateObjectLiteralBoilerplate),
-        arguments);
-  return new ObjectLiteral(constant_properties, result,
-                           properties.elements(), literal_index);
+  return new ObjectLiteral(constant_properties,
+                           properties.elements(),
+                           literal_index);
 }
 
 
@@ -2864,6 +2871,7 @@
 
     int materialized_literal_count;
     int expected_property_count;
+    bool contains_array_literal;
     if (is_lazily_compiled && pre_data() != NULL) {
       FunctionEntry entry = pre_data()->GetFunctionEnd(start_pos);
       int end_pos = entry.end_pos();
@@ -2871,10 +2879,12 @@
       scanner_.SeekForward(end_pos);
       materialized_literal_count = entry.literal_count();
       expected_property_count = entry.property_count();
+      contains_array_literal = entry.contains_array_literal();
     } else {
       ParseSourceElements(&body, Token::RBRACE, CHECK_OK);
       materialized_literal_count = temp_scope.materialized_literal_count();
       expected_property_count = temp_scope.expected_property_count();
+      contains_array_literal = temp_scope.contains_array_literal();
     }
 
     Expect(Token::RBRACE, CHECK_OK);
@@ -2885,12 +2895,13 @@
       entry.set_end_pos(end_pos);
       entry.set_literal_count(materialized_literal_count);
       entry.set_property_count(expected_property_count);
+      entry.set_contains_array_literal(contains_array_literal);
     }
 
     FunctionLiteral *function_literal =
         NEW(FunctionLiteral(name, top_scope_,
                             body.elements(), materialized_literal_count,
-                            expected_property_count,
+                            contains_array_literal, expected_property_count,
                             num_parameters, start_pos, end_pos,
                             function_name->length() > 0));
     if (!is_pre_parsing_) {
@@ -3159,7 +3170,7 @@
 
 
 ScriptDataImpl* PreParse(unibrow::CharacterStream* stream,
-    v8::Extension* extension) {
+                         v8::Extension* extension) {
   Handle<Script> no_script;
   bool allow_natives_syntax =
       always_allow_natives_syntax ||
diff --git a/src/parser.h b/src/parser.h
index a96d0ba..6c1753d 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -68,9 +68,16 @@
   int property_count() { return backing_[kPropertyCountOffset]; }
   void set_property_count(int value) { backing_[kPropertyCountOffset] = value; }
 
+  bool contains_array_literal() {
+    return backing_[kContainsArrayLiteralOffset] != 0;
+  }
+  void set_contains_array_literal(bool value) {
+    backing_[kContainsArrayLiteralOffset] = value ? 1 : 0;
+  }
+
   bool is_valid() { return backing_.length() > 0; }
 
-  static const int kSize = 4;
+  static const int kSize = 5;
 
  private:
   Vector<unsigned> backing_;
@@ -78,6 +85,7 @@
   static const int kEndPosOffset = 1;
   static const int kLiteralCountOffset = 2;
   static const int kPropertyCountOffset = 3;
+  static const int kContainsArrayLiteralOffset = 4;
 };
 
 
diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index b25891a..050375e 100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -270,7 +270,7 @@
 
 #ifdef ENABLE_LOGGING_AND_PROFILING
 static unsigned  StringToLongLong(char* buffer) {
-  return static_cast<unsigned>(strtoll(buffer, NULL, 16));
+  return static_cast<unsigned>(strtoll(buffer, NULL, 16));  // NOLINT
 }
 
 #endif
@@ -552,31 +552,37 @@
 
 #ifdef ENABLE_LOGGING_AND_PROFILING
 
-static ProfileSampler* active_sampler_ = NULL;
+static Sampler* active_sampler_ = NULL;
 
 static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
   USE(info);
   if (signal != SIGPROF) return;
+  if (active_sampler_ == NULL) return;
 
-  // Extracting the sample from the context is extremely machine dependent.
   TickSample sample;
-  ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
-  mcontext_t& mcontext = ucontext->uc_mcontext;
+
+  // If profiling, we extract the current pc and sp.
+  if (active_sampler_->IsProfiling()) {
+    // Extracting the sample from the context is extremely machine dependent.
+    ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
+    mcontext_t& mcontext = ucontext->uc_mcontext;
 #if defined (__arm__) || defined(__thumb__)
-  sample.pc = mcontext.gregs[R15];
-  sample.sp = mcontext.gregs[R13];
+    sample.pc = mcontext.gregs[R15];
+    sample.sp = mcontext.gregs[R13];
 #else
-  sample.pc = mcontext.gregs[REG_EIP];
-  sample.sp = mcontext.gregs[REG_ESP];
+    sample.pc = mcontext.gregs[REG_EIP];
+    sample.sp = mcontext.gregs[REG_ESP];
 #endif
+  }
+
+  // We always sample the VM state.
   sample.state = Logger::state();
 
-  if (active_sampler_ == NULL) return;
   active_sampler_->Tick(&sample);
 }
 
 
-class ProfileSampler::PlatformData  : public Malloced {
+class Sampler::PlatformData : public Malloced {
  public:
   PlatformData() {
     signal_handler_installed_ = false;
@@ -588,19 +594,18 @@
 };
 
 
-ProfileSampler::ProfileSampler(int interval) {
+Sampler::Sampler(int interval, bool profiling)
+    : interval_(interval), profiling_(profiling), active_(false) {
   data_ = new PlatformData();
-  interval_ = interval;
-  active_ = false;
 }
 
 
-ProfileSampler::~ProfileSampler() {
+Sampler::~Sampler() {
   delete data_;
 }
 
 
-void ProfileSampler::Start() {
+void Sampler::Start() {
   // There can only be one active sampler at the time on POSIX
   // platforms.
   if (active_sampler_ != NULL) return;
@@ -627,7 +632,7 @@
 }
 
 
-void ProfileSampler::Stop() {
+void Sampler::Stop() {
   // Restore old signal handler
   if (data_->signal_handler_installed_) {
     setitimer(ITIMER_PROF, &data_->old_timer_value_, NULL);
diff --git a/src/platform-macos.cc b/src/platform-macos.cc
index ac7faed..58e16a8 100644
--- a/src/platform-macos.cc
+++ b/src/platform-macos.cc
@@ -515,31 +515,37 @@
 
 #ifdef ENABLE_LOGGING_AND_PROFILING
 
-static ProfileSampler* active_sampler_ = NULL;
+static Sampler* active_sampler_ = NULL;
 
 static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
   USE(info);
   if (signal != SIGPROF) return;
+  if (active_sampler_ == NULL) return;
 
-  // Extracting the sample from the context is extremely machine dependent.
   TickSample sample;
-  ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
-  mcontext_t& mcontext = ucontext->uc_mcontext;
+
+  // If profiling, we extract the current pc and sp.
+  if (active_sampler_->IsProfiling()) {
+    // Extracting the sample from the context is extremely machine dependent.
+    ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
+    mcontext_t& mcontext = ucontext->uc_mcontext;
 #if __DARWIN_UNIX03
-  sample.pc = mcontext->__ss.__eip;
-  sample.sp = mcontext->__ss.__esp;
+    sample.pc = mcontext->__ss.__eip;
+    sample.sp = mcontext->__ss.__esp;
 #else  // !__DARWIN_UNIX03
-  sample.pc = mcontext->ss.eip;
-  sample.sp = mcontext->ss.esp;
+    sample.pc = mcontext->ss.eip;
+    sample.sp = mcontext->ss.esp;
 #endif  // __DARWIN_UNIX03
+  }
+
+  // We always sample the VM state.
   sample.state = Logger::state();
 
-  if (active_sampler_ == NULL) return;
   active_sampler_->Tick(&sample);
 }
 
 
-class ProfileSampler::PlatformData  : public Malloced {
+class Sampler::PlatformData : public Malloced {
  public:
   PlatformData() {
     signal_handler_installed_ = false;
@@ -551,19 +557,18 @@
 };
 
 
-ProfileSampler::ProfileSampler(int interval) {
+Sampler::Sampler(int interval, bool profiling)
+    : interval_(interval), profiling_(profiling), active_(false) {
   data_ = new PlatformData();
-  interval_ = interval;
-  active_ = false;
 }
 
 
-ProfileSampler::~ProfileSampler() {
+Sampler::~Sampler() {
   delete data_;
 }
 
 
-void ProfileSampler::Start() {
+void Sampler::Start() {
   // There can only be one active sampler at the time on POSIX
   // platforms.
   if (active_sampler_ != NULL) return;
@@ -590,7 +595,7 @@
 }
 
 
-void ProfileSampler::Stop() {
+void Sampler::Stop() {
   // Restore old signal handler
   if (data_->signal_handler_installed_) {
     setitimer(ITIMER_PROF, &data_->old_timer_value_, NULL);
diff --git a/src/platform-win32.cc b/src/platform-win32.cc
index 87d7a3e..c697028 100644
--- a/src/platform-win32.cc
+++ b/src/platform-win32.cc
@@ -1424,15 +1424,15 @@
 // On win32 we use a sampler thread with high priority to sample the program
 // counter for the profiled thread.
 
-class ProfileSampler::PlatformData : public Malloced {
+class Sampler::PlatformData : public Malloced {
  public:
-  explicit PlatformData(ProfileSampler* sampler) {
+  explicit PlatformData(Sampler* sampler) {
     sampler_ = sampler;
     sampler_thread_ = INVALID_HANDLE_VALUE;
     profiled_thread_ = INVALID_HANDLE_VALUE;
   }
 
-  ProfileSampler* sampler_;
+  Sampler* sampler_;
   HANDLE sampler_thread_;
   HANDLE profiled_thread_;
 
@@ -1443,18 +1443,24 @@
     memset(&context, 0, sizeof(context));
     // Loop until the sampler is disengaged.
     while (sampler_->IsActive()) {
-      // Pause the profiled thread and get its context.
-      SuspendThread(profiled_thread_);
-      context.ContextFlags = CONTEXT_FULL;
-      GetThreadContext(profiled_thread_, &context);
-      ResumeThread(profiled_thread_);
-
-      // Invoke tick handler with program counter and stack pointer.
       TickSample sample;
-      sample.pc = context.Eip;
-      sample.sp = context.Esp;
+
+      // If profiling, we record the pc and sp of the profiled thread.
+      if (sampler_->IsProfiling()) {
+        // Pause the profiled thread and get its context.
+        SuspendThread(profiled_thread_);
+        context.ContextFlags = CONTEXT_FULL;
+        GetThreadContext(profiled_thread_, &context);
+        ResumeThread(profiled_thread_);
+        // Invoke tick handler with program counter and stack pointer.
+        sample.pc = context.Eip;
+        sample.sp = context.Esp;
+      }
+
+      // We always sample the VM state.
       sample.state = Logger::state();
       sampler_->Tick(&sample);
+
       // Wait until next sampling.
       Sleep(sampler_->interval_);
     }
@@ -1463,51 +1469,54 @@
 
 
 // Entry point for sampler thread.
-static unsigned int __stdcall ProfileSamplerEntry(void* arg) {
-  ProfileSampler::PlatformData* data =
-      reinterpret_cast<ProfileSampler::PlatformData*>(arg);
+static unsigned int __stdcall SamplerEntry(void* arg) {
+  Sampler::PlatformData* data =
+      reinterpret_cast<Sampler::PlatformData*>(arg);
   data->Runner();
   return 0;
 }
 
 
 // Initialize a profile sampler.
-ProfileSampler::ProfileSampler(int interval) {
+Sampler::Sampler(int interval, bool profiling)
+    : interval_(interval), profiling_(profiling), active_(false) {
   data_ = new PlatformData(this);
-  interval_ = interval;
-  active_ = false;
 }
 
 
-ProfileSampler::~ProfileSampler() {
+Sampler::~Sampler() {
   delete data_;
 }
 
 
 // Start profiling.
-void ProfileSampler::Start() {
-  // Get a handle to the calling thread. This is the thread that we are
-  // going to profile. We need to duplicate the handle because we are
-  // going to use it in the samler thread. using GetThreadHandle() will
-  // not work in this case.
-  BOOL ok = DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
-                            GetCurrentProcess(), &data_->profiled_thread_,
-                            THREAD_GET_CONTEXT | THREAD_SUSPEND_RESUME |
-                            THREAD_QUERY_INFORMATION, FALSE, 0);
-  if (!ok) return;
+void Sampler::Start() {
+  // If we are profiling, we need to be able to access the calling
+  // thread.
+  if (IsProfiling()) {
+    // Get a handle to the calling thread. This is the thread that we are
+    // going to profile. We need to duplicate the handle because we are
+    // going to use it in the sampler thread. using GetThreadHandle() will
+    // not work in this case.
+    BOOL ok = DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
+                              GetCurrentProcess(), &data_->profiled_thread_,
+                              THREAD_GET_CONTEXT | THREAD_SUSPEND_RESUME |
+                              THREAD_QUERY_INFORMATION, FALSE, 0);
+    if (!ok) return;
+  }
 
   // Start sampler thread.
   unsigned int tid;
   active_ = true;
   data_->sampler_thread_ = reinterpret_cast<HANDLE>(
-      _beginthreadex(NULL, 0, ProfileSamplerEntry, data_, 0, &tid));
+      _beginthreadex(NULL, 0, SamplerEntry, data_, 0, &tid));
   // Set thread to high priority to increase sampling accuracy.
   SetThreadPriority(data_->sampler_thread_, THREAD_PRIORITY_TIME_CRITICAL);
 }
 
 
 // Stop profiling.
-void ProfileSampler::Stop() {
+void Sampler::Stop() {
   // Seting active to false triggers termination of the sampler
   // thread.
   active_ = false;
diff --git a/src/platform.h b/src/platform.h
index c5aea63..50fc411 100644
--- a/src/platform.h
+++ b/src/platform.h
@@ -320,7 +320,7 @@
  private:
   class PlatformData;
   PlatformData* data_;
-  DISALLOW_EVIL_CONSTRUCTORS(Thread);
+  DISALLOW_COPY_AND_ASSIGN(Thread);
 };
 
 
@@ -362,7 +362,7 @@
 
  private:
   Mutex* mutex_;
-  DISALLOW_EVIL_CONSTRUCTORS(ScopedLock);
+  DISALLOW_COPY_AND_ASSIGN(ScopedLock);
 };
 
 
@@ -390,42 +390,48 @@
 
 #ifdef ENABLE_LOGGING_AND_PROFILING
 // ----------------------------------------------------------------------------
-// ProfileSampler
+// Sampler
 //
-// A profile sampler periodically samples the program counter and stack pointer
-// for the thread that created it.
+// A sampler periodically samples the state of the VM and optionally
+// (if used for profiling) the program counter and stack pointer for
+// the thread that created it.
 
-// TickSample captures the information collected
-// for each profiling sample.
-struct TickSample {
+// TickSample captures the information collected for each sample.
+class TickSample {
+ public:
+  TickSample() : pc(0), sp(0), state(OTHER) {}
   unsigned int pc;  // Instruction pointer.
   unsigned int sp;  // Stack pointer.
-  StateTag state;    // The state of the VM.
+  StateTag state;   // The state of the VM.
 };
 
-class ProfileSampler {
+class Sampler {
  public:
   // Initialize sampler.
-  explicit ProfileSampler(int interval);
-  virtual ~ProfileSampler();
+  explicit Sampler(int interval, bool profiling);
+  virtual ~Sampler();
 
-  // This method is called for each sampling period with the current program
-  // counter.
+  // This method is called for each sampling period with the current
+  // program counter.
   virtual void Tick(TickSample* sample) = 0;
 
   // Start and stop sampler.
   void Start();
   void Stop();
 
+  // Is the sampler used for profiling.
+  inline bool IsProfiling() { return profiling_; }
+
   class PlatformData;
  protected:
   inline bool IsActive() { return active_; }
 
  private:
   int interval_;
+  bool profiling_;
   bool active_;
   PlatformData* data_;  // Platform specific data.
-  DISALLOW_IMPLICIT_CONSTRUCTORS(ProfileSampler);
+  DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler);
 };
 
 #endif  // ENABLE_LOGGING_AND_PROFILING
diff --git a/src/prettyprinter.cc b/src/prettyprinter.cc
index b07d9a7..2160cb6 100644
--- a/src/prettyprinter.cc
+++ b/src/prettyprinter.cc
@@ -263,8 +263,6 @@
 
 void PrettyPrinter::VisitObjectLiteral(ObjectLiteral* node) {
   Print("{ ");
-  Visit(node->result());
-  Print(" <- ");
   for (int i = 0; i < node->properties()->length(); i++) {
     if (i != 0) Print(",");
     ObjectLiteral::Property* property = node->properties()->at(i);
@@ -279,8 +277,6 @@
 
 void PrettyPrinter::VisitArrayLiteral(ArrayLiteral* node) {
   Print("[ ");
-  Visit(node->result());
-  Print(" <- ");
   for (int i = 0; i < node->values()->length(); i++) {
     if (i != 0) Print(",");
     Visit(node->values()->at(i));
@@ -898,7 +894,6 @@
 
 void AstPrinter::VisitObjectLiteral(ObjectLiteral* node) {
   IndentedScope indent("OBJ LITERAL");
-  Visit(node->result());
   for (int i = 0; i < node->properties()->length(); i++) {
     const char* prop_kind = NULL;
     switch (node->properties()->at(i)->kind()) {
@@ -930,7 +925,6 @@
 
 void AstPrinter::VisitArrayLiteral(ArrayLiteral* node) {
   IndentedScope indent("ARRAY LITERAL");
-  Visit(node->result());
   if (node->values()->length() > 0) {
     IndentedScope indent("VALUES");
     for (int i = 0; i < node->values()->length(); i++) {
diff --git a/src/property.cc b/src/property.cc
index 7cbe2c5..7546195 100644
--- a/src/property.cc
+++ b/src/property.cc
@@ -87,6 +87,9 @@
     case CONSTANT_TRANSITION:
       PrintF(" -type = constant property transition\n");
       break;
+    case NULL_DESCRIPTOR:
+      PrintF(" =type = null descriptor\n");
+      break;
   }
 }
 
diff --git a/src/property.h b/src/property.h
index 3cb2752..deaedd1 100644
--- a/src/property.h
+++ b/src/property.h
@@ -231,11 +231,12 @@
   bool IsDontEnum() { return details_.IsDontEnum(); }
 
   bool IsValid() { return  lookup_type_ != NOT_FOUND; }
+  bool IsNotFound() { return lookup_type_ == NOT_FOUND; }
 
   // Tells whether the result is a property.
-  // Excluding transitions.
+  // Excluding transitions and the null descriptor.
   bool IsProperty() {
-    return IsValid() && !IsTransitionType();
+    return IsValid() && type() < FIRST_PHANTOM_PROPERTY_TYPE;
   }
 
   bool IsCacheable() { return cacheable_; }
@@ -348,8 +349,11 @@
   bool IsTransition() {
     PropertyType t = type();
     ASSERT(t != INTERCEPTOR);
-    if (t == MAP_TRANSITION || t == CONSTANT_TRANSITION) return true;
-    return false;
+    return t == MAP_TRANSITION || t == CONSTANT_TRANSITION;
+  }
+
+  bool IsNullDescriptor() {
+    return type() == NULL_DESCRIPTOR;
   }
 
   JSFunction* GetConstantFunction() { return JSFunction::cast(GetValue()); }
@@ -367,10 +371,6 @@
 
   bool Equals(String* name) { return name->Equals(GetKey()); }
 
-  void ReplaceConstantFunction(JSFunction* value) {
-    descriptors_->ReplaceConstantFunction(pos_, value);
-  }
-
   void Get(Descriptor* desc) {
     descriptors_->Get(pos_, desc);
   }
diff --git a/src/runtime.cc b/src/runtime.cc
index c57a437..310611c 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -93,11 +93,6 @@
 
 static Object* Runtime_CloneObjectLiteralBoilerplate(Arguments args) {
   CONVERT_CHECKED(JSObject, boilerplate, args[0]);
-
-  // Verify that the constructor of the boilerplate is equal to the
-  // object function in the current global context.
-  ASSERT(boilerplate->map()->constructor() ==
-         Top::context()->global_context()->object_function());
   return boilerplate->Copy();
 }
 
@@ -110,9 +105,16 @@
   int literals_index = Smi::cast(args[1])->value();
   Handle<FixedArray> constant_properties = args.at<FixedArray>(2);
 
-  // Create the boilerplate object for the function literal
-  Handle<JSObject> boilerplate =
-      Factory::NewJSObject(Top::object_function(), TENURED);
+  // Get the object function from the literals array.  This is the
+  // object function from the context in which the function was
+  // created.  We do not use the object function from the current
+  // global context because this might be the object function from
+  // another context which we should not have access to.
+  const int kObjectFunIndex = JSFunction::kLiteralObjectFunctionIndex;
+  Handle<JSFunction> constructor =
+      Handle<JSFunction>(JSFunction::cast(literals->get(kObjectFunIndex)));
+
+  Handle<JSObject> boilerplate = Factory::NewJSObject(constructor, TENURED);
 
   {  // Add the constant propeties to the boilerplate.
     int length = constant_properties->length();
@@ -150,25 +152,40 @@
 
 
 static Object* Runtime_CreateArrayLiteral(Arguments args) {
-  // Takes a FixedArray containing literals and produces
-  // JSArray with the elements matching the literals.
-  ASSERT(args.length() == 1);
-  CONVERT_CHECKED(FixedArray, literals, args[0]);
+  // Takes a FixedArray of elements containing the literal elements of
+  // the array literal and produces JSArray with those elements.
+  // Additionally takes the literals array of the surrounding function
+  // which contains the Array function to use for creating the array
+  // literal.
+  ASSERT(args.length() == 2);
+  CONVERT_CHECKED(FixedArray, elements, args[0]);
 
-  // Retrieve the array constructor from the global context.
+#ifdef USE_OLD_CALLING_CONVENTIONS
+  ASSERT(args[1]->IsTheHole());
+  // TODO(1332579): Pass in the literals array from the function once
+  // the new calling convention is in place on ARM.  Currently, we
+  // retrieve the array constructor from the global context.  This is
+  // a security problem since the global object might have been
+  // reinitialized and the array constructor from the global context
+  // might be from a context that we are not allowed to access.
   JSFunction* constructor =
       JSFunction::cast(Top::context()->global_context()->array_function());
+#else
+  CONVERT_CHECKED(FixedArray, literals, args[1]);
+  const int kArrayFunIndex = JSFunction::kLiteralArrayFunctionIndex;
+  JSFunction* constructor = JSFunction::cast(literals->get(kArrayFunIndex));
+#endif
 
   // Create the JSArray.
   Object* object = Heap::AllocateJSObject(constructor);
   if (object->IsFailure()) return object;
 
-  // Copy the literals.
-  Object* elements = literals->Copy();
-  if (elements->IsFailure()) return elements;
+  // Copy the elements.
+  Object* content = elements->Copy();
+  if (content->IsFailure()) return content;
 
   // Set the elements.
-  JSArray::cast(object)->SetContent(FixedArray::cast(elements));
+  JSArray::cast(object)->SetContent(FixedArray::cast(content));
   return object;
 }
 
@@ -230,8 +247,7 @@
 static Object* Runtime_IsTemplate(Arguments args) {
   ASSERT(args.length() == 1);
   Object* arg = args[0];
-  bool result = arg->IsObjectTemplateInfo()
-      || arg->IsFunctionTemplateInfo();
+  bool result = arg->IsObjectTemplateInfo() || arg->IsFunctionTemplateInfo();
   return Heap::ToBoolean(result);
 }
 
@@ -691,10 +707,20 @@
   Handle<String> pattern = args.at<String>(2);
   Handle<String> flags = args.at<String>(3);
 
+  // Get the RegExp function from the literals array.  This is the
+  // RegExp function from the context in which the function was
+  // created.  We do not use the RegExp function from the current
+  // global context because this might be the RegExp function from
+  // another context which we should not have access to.
+  const int kRegexpFunIndex = JSFunction::kLiteralRegExpFunctionIndex;
+  Handle<JSFunction> constructor =
+      Handle<JSFunction>(JSFunction::cast(literals->get(kRegexpFunIndex)));
+
   // Compute the regular expression literal.
   bool has_pending_exception;
   Handle<Object> regexp =
-      RegExpImpl::CreateRegExpLiteral(pattern, flags, &has_pending_exception);
+      RegExpImpl::CreateRegExpLiteral(constructor, pattern, flags,
+                                      &has_pending_exception);
   if (has_pending_exception) {
     ASSERT(Top::has_pending_exception());
     return Failure::Exception();
@@ -767,11 +793,12 @@
 
 
 static Object* Runtime_FunctionSetPrototype(Arguments args) {
-  HandleScope scope;
+  NoHandleAllocation ha;
   ASSERT(args.length() == 2);
 
   CONVERT_CHECKED(JSFunction, fun, args[0]);
-  Accessors::FunctionSetPrototype(fun, args[1], NULL);
+  Object* obj = Accessors::FunctionSetPrototype(fun, args[1], NULL);
+  if (obj->IsFailure()) return obj;
   return args[0];  // return TOS
 }
 
@@ -807,12 +834,21 @@
 
     // Make sure we get a fresh copy of the literal vector to avoid
     // cross context contamination.
-    int number_of_literals = fun->literals()->length();
+    int number_of_literals = fun->NumberOfLiterals();
+    Handle<FixedArray> literals =
+        Factory::NewFixedArray(number_of_literals, TENURED);
     if (number_of_literals > 0) {
-      Handle<FixedArray> literals =
-          Factory::NewFixedArray(number_of_literals, TENURED);
-      target->set_literals(*literals);
+      // Insert the object, regexp and array functions in the literals
+      // array prefix.  These are the functions that will be used when
+      // creating object, regexp and array literals.
+      literals->set(JSFunction::kLiteralObjectFunctionIndex,
+                    context->global_context()->object_function());
+      literals->set(JSFunction::kLiteralRegExpFunctionIndex,
+                    context->global_context()->regexp_function());
+      literals->set(JSFunction::kLiteralArrayFunctionIndex,
+                    context->global_context()->array_function());
     }
+    target->set_literals(*literals);
   }
 
   target->set_context(*context);
@@ -822,14 +858,12 @@
 
 static Object* CharCodeAt(String* subject, Object* index) {
   uint32_t i = 0;
-  if (!Array::IndexFromObject(index, &i))
-    return Heap::nan_value();
+  if (!Array::IndexFromObject(index, &i)) return Heap::nan_value();
   // Flatten the string.  If someone wants to get a char at an index
   // in a cons string, it is likely that more indices will be
   // accessed.
   subject->TryFlatten();
-  if (i >= static_cast<uint32_t>(subject->length()))
-    return Heap::nan_value();
+  if (i >= static_cast<uint32_t>(subject->length())) return Heap::nan_value();
   return Smi::FromInt(subject->Get(i));
 }
 
@@ -1141,31 +1175,32 @@
 
 // Returns a single character string where first character equals
 // string->Get(index).
-static Object* GetCharAt(String* string, uint32_t index) {
+static Handle<Object> GetCharAt(Handle<String> string, uint32_t index) {
   if (index < static_cast<uint32_t>(string->length())) {
     string->TryFlatten();
-    return Heap::LookupSingleCharacterStringFromCode(string->Get(index));
+    return LookupSingleCharacterStringFromCode(string->Get(index));
   }
-  return *Execution::CharAt(Handle<String>(string), index);
+  return Execution::CharAt(string, index);
 }
 
 
 Object* Runtime::GetElementOrCharAt(Handle<Object> object, uint32_t index) {
   // Handle [] indexing on Strings
   if (object->IsString()) {
-    Object* result = GetCharAt(String::cast(*object), index);
-    if (!result->IsUndefined()) return result;
+    Handle<Object> result = GetCharAt(Handle<String>::cast(object), index);
+    if (!result->IsUndefined()) return *result;
   }
 
   // Handle [] indexing on String objects
   if (object->IsStringObjectWithCharacterAt(index)) {
-    JSValue* js_value = JSValue::cast(*object);
-    Object* result = GetCharAt(String::cast(js_value->value()), index);
-    if (!result->IsUndefined()) return result;
+    Handle<JSValue> js_value = Handle<JSValue>::cast(object);
+    Handle<Object> result =
+        GetCharAt(Handle<String>(String::cast(js_value->value())), index);
+    if (!result->IsUndefined()) return *result;
   }
 
   if (object->IsString() || object->IsNumber() || object->IsBoolean()) {
-    Object* prototype = object->GetPrototype();
+    Handle<Object> prototype = GetPrototype(object);
     return prototype->GetElement(index);
   }
 
@@ -1173,11 +1208,11 @@
 }
 
 
-Object* Runtime::GetObjectProperty(Handle<Object> object, Object* key) {
+Object* Runtime::GetObjectProperty(Handle<Object> object, Handle<Object> key) {
+  HandleScope scope;
+
   if (object->IsUndefined() || object->IsNull()) {
-    HandleScope scope;
-    Handle<Object> key_handle(key);
-    Handle<Object> args[2] = { key_handle, object };
+    Handle<Object> args[2] = { key, object };
     Handle<Object> error =
         Factory::NewTypeError("non_object_property_load",
                               HandleVector(args, 2));
@@ -1186,32 +1221,29 @@
 
   // Check if the given key is an array index.
   uint32_t index;
-  if (Array::IndexFromObject(key, &index)) {
-    HandleScope scope;
+  if (Array::IndexFromObject(*key, &index)) {
     return GetElementOrCharAt(object, index);
   }
 
   // Convert the key to a string - possibly by calling back into JavaScript.
-  String* name;
+  Handle<String> name;
   if (key->IsString()) {
-    name = String::cast(key);
+    name = Handle<String>::cast(key);
   } else {
-    HandleScope scope;
     bool has_pending_exception = false;
     Handle<Object> converted =
-        Execution::ToString(Handle<Object>(key), &has_pending_exception);
+        Execution::ToString(key, &has_pending_exception);
     if (has_pending_exception) return Failure::Exception();
-    name = String::cast(*converted);
+    name = Handle<String>::cast(converted);
   }
 
   // Check if the name is trivially convertable to an index and get
   // the element if so.
   if (name->AsArrayIndex(&index)) {
-    HandleScope scope;
     return GetElementOrCharAt(object, index);
   } else {
     PropertyAttributes attr;
-    return object->GetProperty(name, &attr);
+    return object->GetProperty(*name, &attr);
   }
 }
 
@@ -1221,7 +1253,7 @@
   ASSERT(args.length() == 2);
 
   Handle<Object> object = args.at<Object>(0);
-  Object* key = args[1];
+  Handle<Object> key = args.at<Object>(1);
 
   return Runtime::GetObjectProperty(object, key);
 }
@@ -1231,10 +1263,10 @@
                                    Handle<Object> key,
                                    Handle<Object> value,
                                    PropertyAttributes attr) {
+  HandleScope scope;
+
   if (object->IsUndefined() || object->IsNull()) {
-    HandleScope scope;
-    Handle<Object> obj(object);
-    Handle<Object> args[2] = { key, obj };
+    Handle<Object> args[2] = { key, object };
     Handle<Object> error =
         Factory::NewTypeError("non_object_property_store",
                               HandleVector(args, 2));
@@ -1244,6 +1276,8 @@
   // If the object isn't a JavaScript object, we ignore the store.
   if (!object->IsJSObject()) return *value;
 
+  Handle<JSObject> js_object = Handle<JSObject>::cast(object);
+
   // Check if the given key is an array index.
   uint32_t index;
   if (Array::IndexFromObject(*key, &index)) {
@@ -1256,35 +1290,30 @@
     // the underlying string if the index is in range.  Since the underlying
     // string does nothing with the assignment then we can ignore such
     // assignments.
-    if (object->IsStringObjectWithCharacterAt(index))
+    if (js_object->IsStringObjectWithCharacterAt(index)) {
       return *value;
+    }
 
-    Object* result = JSObject::cast(*object)->SetElement(index, *value);
-    if (result->IsFailure()) return result;
+    Handle<Object> result = SetElement(js_object, index, value);
+    if (result.is_null()) return Failure::Exception();
     return *value;
   }
 
   if (key->IsString()) {
-    Object* result;
-    if (String::cast(*key)->AsArrayIndex(&index)) {
+    Handle<Object> result;
+    if (Handle<String>::cast(key)->AsArrayIndex(&index)) {
       ASSERT(attr == NONE);
-      result = JSObject::cast(*object)->SetElement(index, *value);
+      result = SetElement(js_object, index, value);
     } else {
-      String::cast(*key)->TryFlatten();
-      result =
-          JSObject::cast(*object)->SetProperty(String::cast(*key), *value,
-                                               attr);
+      Handle<String> key_string = Handle<String>::cast(key);
+      key_string->TryFlatten();
+      result = SetProperty(js_object, key_string, value, attr);
     }
-    if (result->IsFailure()) return result;
+    if (result.is_null()) return Failure::Exception();
     return *value;
   }
 
-  // Handlify object and value before calling into JavaScript again.
-  Handle<JSObject> object_handle = Handle<JSObject>::cast(object);
-  Handle<Object> value_handle = value;
-
   // Call-back into JavaScript to convert the key to a string.
-  HandleScope scope;
   bool has_pending_exception = false;
   Handle<Object> converted = Execution::ToString(key, &has_pending_exception);
   if (has_pending_exception) return Failure::Exception();
@@ -1292,9 +1321,9 @@
 
   if (name->AsArrayIndex(&index)) {
     ASSERT(attr == NONE);
-    return object_handle->SetElement(index, *value_handle);
+    return js_object->SetElement(index, *value);
   } else {
-    return object_handle->SetProperty(*name, *value_handle, attr);
+    return js_object->SetProperty(*name, *value, attr);
   }
 }
 
@@ -1526,8 +1555,7 @@
   HeapObject* heap_obj = HeapObject::cast(obj);
 
   // typeof an undetectable object is 'undefined'
-  if (heap_obj->map()->is_undetectable())
-      return Heap::undefined_symbol();
+  if (heap_obj->map()->is_undetectable()) return Heap::undefined_symbol();
 
   InstanceType instance_type = heap_obj->map()->instance_type();
   if (instance_type < FIRST_NONSTRING_TYPE) {
@@ -1852,7 +1880,7 @@
 
 template <class Converter>
 static Object* ConvertCase(Arguments args,
-    unibrow::Mapping<Converter, 128> *mapping) {
+                           unibrow::Mapping<Converter, 128>* mapping) {
   NoHandleAllocation ha;
 
   CONVERT_CHECKED(String, s, args[0]);
@@ -1880,12 +1908,10 @@
   Object* o = s->IsAscii()
       ? Heap::AllocateRawAsciiString(length)
       : Heap::AllocateRawTwoByteString(length);
-  if (o->IsFailure())
-    return o;
+  if (o->IsFailure()) return o;
   String* result = String::cast(o);
   bool has_changed_character = false;
 
-
   // Convert all characters to upper case, assuming that they will fit
   // in the buffer
   Access<StringInputBuffer> buffer(&string_input_buffer);
@@ -2011,10 +2037,7 @@
   ASSERT(args.length() == 1);
 
   Object* obj = args[0];
-
-  if (obj->IsSmi())
-    return obj;
-
+  if (obj->IsSmi()) return obj;
   CONVERT_DOUBLE_CHECKED(number, obj);
   return Heap::NumberFromDouble(DoubleToInteger(number));
 }
@@ -2148,8 +2171,9 @@
     return Top::Throw(Heap::illegal_argument_symbol());
   }
   FixedArray* fixed_array = FixedArray::cast(array->elements());
-  if (fixed_array->length() < array_length)
+  if (fixed_array->length() < array_length) {
     array_length = fixed_array->length();
+  }
 
   if (array_length == 0) {
     return Heap::empty_string();
@@ -2178,8 +2202,9 @@
         return Failure::OutOfMemoryException();
       }
       position += element_length;
-      if (ascii && !element->IsAscii())
+      if (ascii && !element->IsAscii()) {
         ascii = false;
+      }
     } else {
       return Top::Throw(Heap::illegal_argument_symbol());
     }
@@ -2372,17 +2397,15 @@
   // A few fast case tests before we flatten.
   if (x == y) return Smi::FromInt(EQUAL);
   if (y->length() == 0) {
-    if (x->length() == 0)
-      return Smi::FromInt(EQUAL);
+    if (x->length() == 0) return Smi::FromInt(EQUAL);
     return Smi::FromInt(GREATER);
   } else if (x->length() == 0) {
     return Smi::FromInt(LESS);
   }
-  {
-    int d = x->Get(0) - y->Get(0);
-    if (d < 0) return Smi::FromInt(LESS);
-    else if (d > 0) return Smi::FromInt(GREATER);
-  }
+
+  int d = x->Get(0) - y->Get(0);
+  if (d < 0) return Smi::FromInt(LESS);
+  else if (d > 0) return Smi::FromInt(GREATER);
 
   x->TryFlatten();
   y->TryFlatten();
@@ -2785,8 +2808,6 @@
 }
 
 
-
-
 // A mechanism to return pairs of Object*'s. This is somewhat
 // compiler-dependent as it assumes that a 64-bit value (a long long)
 // is returned via two registers (edx:eax on ia32). Both the ia32 and
@@ -2852,7 +2873,7 @@
   if (throw_error) {
     // The property doesn't exist - throw exception.
     Handle<Object> reference_error =
-      Factory::NewReferenceError("not_defined", HandleVector(&name, 1));
+        Factory::NewReferenceError("not_defined", HandleVector(&name, 1));
     return MakePair(Top::Throw(*reference_error), NULL);
   } else {
     // The property doesn't exist - return undefined
@@ -2877,7 +2898,7 @@
 
   Handle<Object> value(args[0]);
   CONVERT_ARG_CHECKED(Context, context, 1);
-  Handle<String> name(String::cast(args[2]));
+  CONVERT_ARG_CHECKED(String, name, 2);
 
   int index;
   PropertyAttributes attributes;
@@ -3235,30 +3256,6 @@
 }
 
 
-static Object* Runtime_NumberMaxValue(Arguments args) {
-  NoHandleAllocation ha;
-  ASSERT(args.length() == 0);
-
-  return Heap::number_max_value();
-}
-
-
-static Object* Runtime_NumberMinValue(Arguments args) {
-  NoHandleAllocation ha;
-  ASSERT(args.length() == 0);
-
-  return Heap::number_min_value();
-}
-
-
-static Object* Runtime_NumberNaN(Arguments args) {
-  NoHandleAllocation ha;
-  ASSERT(args.length() == 0);
-
-  return Heap::nan_value();
-}
-
-
 static Object* EvalContext() {
   // The topmost JS frame belongs to the eval function which called
   // the CompileString runtime function. We need to unwind one level
@@ -3437,8 +3434,7 @@
   CONVERT_CHECKED(JSArray, raw_array, args[0]);
   Handle<JSArray> array(raw_array);
   CONVERT_NUMBER_CHECKED(uint32_t, length, Uint32, args[1]);
-  HeapObject* elements = array->elements();
-  if (elements->IsDictionary()) {
+  if (array->elements()->IsDictionary()) {
     // Create an array and get all the keys into it, then remove all the
     // keys that are not integers in the range 0 to length-1.
     Handle<FixedArray> keys = GetKeysInFixedArrayFor(array);
@@ -3570,14 +3566,15 @@
     case CONSTANT_FUNCTION:
       return result->GetConstantFunction();
     case CALLBACKS:
-      return Heap::undefined_value();
-    case MAP_TRANSITION:
-      return Heap::undefined_value();
     case INTERCEPTOR:
+    case MAP_TRANSITION:
+    case CONSTANT_TRANSITION:
+    case NULL_DESCRIPTOR:
       return Heap::undefined_value();
     default:
       UNREACHABLE();
   }
+  UNREACHABLE();
   return Heap::undefined_value();
 }
 
@@ -3752,8 +3749,7 @@
   CONVERT_ARG_CHECKED(String, name, 1);
 
   PropertyAttributes attributes;
-  Object* result = obj->GetPropertyWithInterceptor(*obj, *name, &attributes);
-  return result;
+  return obj->GetPropertyWithInterceptor(*obj, *name, &attributes);
 }
 
 
@@ -3767,8 +3763,7 @@
   RUNTIME_ASSERT(obj->HasIndexedInterceptor());
   CONVERT_NUMBER_CHECKED(uint32_t, index, Uint32, args[1]);
 
-  Object* result = obj->GetElementWithInterceptor(*obj, index);
-  return result;
+  return obj->GetElementWithInterceptor(*obj, index);
 }
 
 
@@ -3832,8 +3827,8 @@
   ASSERT(args.length() == 2);
 
   // Check arguments.
-  Object* result = Runtime_CheckExecutionState(args);
-  if (result->IsFailure()) return result;
+  Object* check = Runtime_CheckExecutionState(args);
+  if (check->IsFailure()) return check;
   CONVERT_NUMBER_CHECKED(int, index, Int32, args[1]);
 
   // Find the relevant frame with the requested index.
@@ -4222,8 +4217,8 @@
   HandleScope scope;
   ASSERT(args.length() == 3);
   // Check arguments.
-  Object* check_result = Runtime_CheckExecutionState(args);
-  if (check_result->IsFailure()) return check_result;
+  Object* check = Runtime_CheckExecutionState(args);
+  if (check->IsFailure()) return check;
   if (!args[1]->IsNumber() || !args[2]->IsNumber()) {
     return Top::Throw(Heap::illegal_argument_symbol());
   }
diff --git a/src/runtime.h b/src/runtime.h
index 564a36f..d56e0b3 100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -175,9 +175,6 @@
   \
   /* Numbers */ \
   F(NumberIsFinite, 1) \
-  F(NumberMaxValue, 0) \
-  F(NumberMinValue, 0) \
-  F(NumberNaN, 0) \
   \
   /* Globals */ \
   F(CompileString, 2) \
@@ -237,7 +234,7 @@
   \
   /* Literals */ \
   F(MaterializeRegExpLiteral, 4)\
-  F(CreateArrayLiteral, 1) \
+  F(CreateArrayLiteral, 2) \
   F(CreateObjectLiteralBoilerplate, 3) \
   F(CloneObjectLiteralBoilerplate, 1) \
   \
@@ -343,7 +340,7 @@
                                    Handle<Object> value,
                                    PropertyAttributes attr);
 
-  static Object* GetObjectProperty(Handle<Object> object, Object* key);
+  static Object* GetObjectProperty(Handle<Object> object, Handle<Object> key);
 
   // Helper functions used stubs.
   static void PerformGC(Object* result);
diff --git a/src/runtime.js b/src/runtime.js
index 37939e7..aa624a7 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -47,7 +47,7 @@
 const $Number = global.Number;
 const $Function = global.Function;
 const $Boolean = global.Boolean;
-const $NaN = %NumberNaN();
+const $NaN = 0/0;
 
 
 // ECMA-262, section 11.9.1, page 55.
@@ -172,11 +172,6 @@
 };
 
 
-function MULNEG(x) {
-  return %NumberUnaryMinus(%NumberMul(%ToNumber(this), %ToNumber(x)));
-};
-
-
 // ECMA-262, section 11.5.2, page 49.
 function DIV(x) {
   return %NumberDiv(%ToNumber(this), %ToNumber(x));
@@ -358,7 +353,7 @@
       %ClassOf(args) != 'Arguments') {
     throw %MakeTypeError('apply_wrong_args', []);
   }
-  
+
   // Return the length which is the number of arguments to copy to the
   // stack. It is guaranteed to be a small integer at this point.
   return length;
@@ -408,7 +403,7 @@
   if (IS_NUMBER(x)) return x;
   if (IS_STRING(x)) return %StringToNumber(x);
   if (IS_BOOLEAN(x)) return x ? 1 : 0;
-  if (IS_UNDEFINED(x)) return %NumberNaN();
+  if (IS_UNDEFINED(x)) return $NaN;
   return (IS_NULL(x)) ? 0 : ToNumber(%DefaultNumber(x));
 };
 
diff --git a/src/serialize.h b/src/serialize.h
index a87484f..be0be83 100644
--- a/src/serialize.h
+++ b/src/serialize.h
@@ -204,7 +204,7 @@
 
   HashMap saved_addresses_;
 
-  DISALLOW_EVIL_CONSTRUCTORS(Serializer);
+  DISALLOW_COPY_AND_ASSIGN(Serializer);
 };
 
 // Helper class to read the bytes of the serialized heap.
@@ -325,7 +325,7 @@
   bool expect_debug_information_;
 #endif
 
-  DISALLOW_EVIL_CONSTRUCTORS(Deserializer);
+  DISALLOW_COPY_AND_ASSIGN(Deserializer);
 };
 
 } }  // namespace v8::internal
diff --git a/src/simulator-arm.cc b/src/simulator-arm.cc
index 9f20fc9..71e3a43 100644
--- a/src/simulator-arm.cc
+++ b/src/simulator-arm.cc
@@ -132,7 +132,7 @@
     }
     return true;
   } else {
-    return sscanf(desc, "%i", value) == 1;
+    return sscanf(desc, "%i", value) == 1;  // NOLINT
   }
   return false;
 }
@@ -216,7 +216,7 @@
     } else {
       // Use sscanf to parse the individual parts of the command line. At the
       // moment no command expects more than two parameters.
-      int args = sscanf(line,
+      int args = sscanf(line,  // NOLINT
                         "%" XSTR(COMMAND_SIZE) "s "
                         "%" XSTR(ARG_SIZE) "s "
                         "%" XSTR(ARG_SIZE) "s",
diff --git a/src/spaces.cc b/src/spaces.cc
index caa403e..279e10a 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -1614,8 +1614,7 @@
         ASSERT(!object->IsMap());
 
         // The object itself should look OK.
-        // This is blocked by bug #1006953.
-        // object->Verify();
+        object->Verify();
 
         // All the interior pointers should be contained in the heap and have
         // their remembered set bits set if they point to new space.  Code
@@ -2091,8 +2090,7 @@
         ASSERT(object->IsMap() || object->IsByteArray());
 
         // The object itself should look OK.
-        // This is blocked by bug #1006953.
-        // object->Verify();
+        object->Verify();
 
         // All the interior pointers should be contained in the heap and
         // have their remembered set bits set if they point to new space.
@@ -2429,8 +2427,7 @@
            || object->IsFixedArray() || object->IsByteArray());
 
     // The object itself should look OK.
-    // This is blocked by bug #1006953.
-    // object->Verify();
+    object->Verify();
 
     // Byte arrays and strings don't have interior pointers.
     if (object->IsCode()) {
diff --git a/src/spaces.h b/src/spaces.h
index f2dbd0b..cfa43e9 100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -1294,7 +1294,7 @@
   bool Contains(FreeListNode* node);
 #endif
 
-  DISALLOW_EVIL_CONSTRUCTORS(OldSpaceFreeList);
+  DISALLOW_COPY_AND_ASSIGN(OldSpaceFreeList);
 };
 
 
@@ -1330,7 +1330,7 @@
   // objects.
   AllocationSpace owner_;
 
-  DISALLOW_EVIL_CONSTRUCTORS(MapSpaceFreeList);
+  DISALLOW_COPY_AND_ASSIGN(MapSpaceFreeList);
 };
 
 
diff --git a/src/string-stream.h b/src/string-stream.h
index fe11dee..b00c7cc 100644
--- a/src/string-stream.h
+++ b/src/string-stream.h
@@ -72,11 +72,11 @@
 
 class FmtElm {
  public:
-  FmtElm(int value) : type_(INT) { data_.u_int_ = value; }
-  FmtElm(const char* value) : type_(C_STR) { data_.u_c_str_ = value; }
-  FmtElm(Object* value) : type_(OBJ) { data_.u_obj_ = value; }
-  FmtElm(Handle<Object> value) : type_(HANDLE) { data_.u_handle_ = value.location(); }
-  FmtElm(void* value) : type_(INT) { data_.u_int_ = reinterpret_cast<int>(value); }
+  FmtElm(int value) : type_(INT) { data_.u_int_ = value; }  // NOLINT
+  FmtElm(const char* value) : type_(C_STR) { data_.u_c_str_ = value; }  // NOLINT
+  FmtElm(Object* value) : type_(OBJ) { data_.u_obj_ = value; }  // NOLINT
+  FmtElm(Handle<Object> value) : type_(HANDLE) { data_.u_handle_ = value.location(); }  // NOLINT
+  FmtElm(void* value) : type_(INT) { data_.u_int_ = reinterpret_cast<int>(value); }  // NOLINT
  private:
   friend class StringStream;
   enum Type { INT, C_STR, OBJ, HANDLE };
diff --git a/src/string.js b/src/string.js
index 5902595..7e5cf6e 100644
--- a/src/string.js
+++ b/src/string.js
@@ -29,6 +29,7 @@
 // This file relies on the fact that the following declaration has been made
 // in runtime.js:
 // const $String = global.String;
+// const $NaN = 0/0;
 
 
 // Set the String function and constructor.
@@ -349,7 +350,7 @@
   var pat = ToString(searchString);
   var index = (%_ArgumentsLength() > 1)
       ? ToNumber(%_Arguments(1) /* position */)
-      : %NumberNaN();
+      : $NaN;
   var firstIndex;
   if ($isNaN(index)) {
     firstIndex = sub.length - pat.length;
diff --git a/src/third_party/jscre/pcre.h b/src/third_party/jscre/pcre.h
index 088bd14..2a27cd8 100644
--- a/src/third_party/jscre/pcre.h
+++ b/src/third_party/jscre/pcre.h
@@ -44,6 +44,11 @@
 
 #include "../../../public/v8.h"
 
+// JSCRE is very chatty in debug mode, so in order to keep it slient
+// while still importing v8.h correctly (it contains #ifdef DEBUGs)
+// we allow DEBUG to be set and undef it manually.
+#undef DEBUG
+
 typedef uint16_t UChar;
 
 struct JSRegExp;
diff --git a/src/top.cc b/src/top.cc
index 4e12ad2..94e4cc8 100644
--- a/src/top.cc
+++ b/src/top.cc
@@ -210,7 +210,7 @@
   static char* data_;
   static unsigned length_;
 
-  DISALLOW_EVIL_CONSTRUCTORS(PreallocatedMemoryThread);
+  DISALLOW_COPY_AND_ASSIGN(PreallocatedMemoryThread);
 };
 
 PreallocatedMemoryThread* PreallocatedMemoryThread::the_thread_ = NULL;
diff --git a/src/unicode.cc b/src/unicode.cc
index 0a5c082..ffe43ad 100644
--- a/src/unicode.cc
+++ b/src/unicode.cc
@@ -38,8 +38,8 @@
  * Implementations of functions for working with unicode.
  */
 
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
+typedef signed short int16_t;  // NOLINT
+typedef unsigned short uint16_t;  // NOLINT
 
 // All access to the character table should go through this function.
 template <int D>
@@ -323,13 +323,13 @@
 // Uppercase:            point.category == 'Lu'
 
 static const uint16_t kUppercaseTable0Size = 509;
-static const uint16_t kUppercaseTable0[509] = { 32833, 90, 32960, 214, 32984, 222, 256, 258, 260, 262, 264, 266, 268, 270, 272, 274, 276, 278, 280, 282, 284, 286, 288, 290, 292, 294, 296, 298, 300, 302, 304, 306, 308, 310, 313, 315, 317, 319, 321, 323, 325, 327, 330, 332, 334, 336, 338, 340, 342, 344, 346, 348, 350, 352, 354, 356, 358, 360, 362, 364, 366, 368, 370, 372, 374, 33144, 377, 379, 381, 33153, 386, 388, 33158, 391, 33161, 395, 33166, 401, 33171, 404, 33174, 408, 33180, 413, 33183, 416, 418, 420, 33190, 423, 425, 428, 33198, 431, 33201, 435, 437, 33207, 440, 444, 452, 455, 458, 461, 463, 465, 467, 469, 471, 473, 475, 478, 480, 482, 484, 486, 488, 490, 492, 494, 497, 500, 33270, 504, 506, 508, 510, 512, 514, 516, 518, 520, 522, 524, 526, 528, 530, 532, 534, 536, 538, 540, 542, 544, 546, 548, 550, 552, 554, 556, 558, 560, 562, 33338, 571, 33341, 574, 577, 33347, 582, 584, 586, 588, 590, 902, 33672, 906, 908, 33678, 911, 33681, 929, 33699, 939, 33746, 980, 984, 986, 988, 990, 992, 994, 996, 998, 1000, 1002, 1004, 1006, 1012, 1015, 33785, 1018, 33789, 1071, 1120, 1122, 1124, 1126, 1128, 1130, 1132, 1134, 1136, 1138, 1140, 1142, 1144, 1146, 1148, 1150, 1152, 1162, 1164, 1166, 1168, 1170, 1172, 1174, 1176, 1178, 1180, 1182, 1184, 1186, 1188, 1190, 1192, 1194, 1196, 1198, 1200, 1202, 1204, 1206, 1208, 1210, 1212, 1214, 33984, 1217, 1219, 1221, 1223, 1225, 1227, 1229, 1232, 1234, 1236, 1238, 1240, 1242, 1244, 1246, 1248, 1250, 1252, 1254, 1256, 1258, 1260, 1262, 1264, 1266, 1268, 1270, 1272, 1274, 1276, 1278, 1280, 1282, 1284, 1286, 1288, 1290, 1292, 1294, 1296, 1298, 34097, 1366, 37024, 4293, 7680, 7682, 7684, 7686, 7688, 7690, 7692, 7694, 7696, 7698, 7700, 7702, 7704, 7706, 7708, 7710, 7712, 7714, 7716, 7718, 7720, 7722, 7724, 7726, 7728, 7730, 7732, 7734, 7736, 7738, 7740, 7742, 7744, 7746, 7748, 7750, 7752, 7754, 7756, 7758, 7760, 7762, 7764, 7766, 7768, 7770, 7772, 7774, 7776, 7778, 7780, 7782, 7784, 7786, 7788, 7790, 7792, 7794, 7796, 7798, 7800, 7802, 7804, 7806, 7808, 7810, 7812, 7814, 7816, 7818, 7820, 7822, 7824, 7826, 7828, 7840, 7842, 7844, 7846, 7848, 7850, 7852, 7854, 7856, 7858, 7860, 7862, 7864, 7866, 7868, 7870, 7872, 7874, 7876, 7878, 7880, 7882, 7884, 7886, 7888, 7890, 7892, 7894, 7896, 7898, 7900, 7902, 7904, 7906, 7908, 7910, 7912, 7914, 7916, 7918, 7920, 7922, 7924, 7926, 7928, 40712, 7951, 40728, 7965, 40744, 7983, 40760, 7999, 40776, 8013, 8025, 8027, 8029, 8031, 40808, 8047, 40888, 8123, 40904, 8139, 40920, 8155, 40936, 8172, 40952, 8187, 8450, 8455, 41227, 8461, 41232, 8466, 8469, 41241, 8477, 8484, 8486, 8488, 41258, 8493, 41264, 8499, 41278, 8511, 8517, 8579, 44032, 11310, 11360, 44130, 11364, 11367, 11369, 11371, 11381, 11392, 11394, 11396, 11398, 11400, 11402, 11404, 11406, 11408, 11410, 11412, 11414, 11416, 11418, 11420, 11422, 11424, 11426, 11428, 11430, 11432, 11434, 11436, 11438, 11440, 11442, 11444, 11446, 11448, 11450, 11452, 11454, 11456, 11458, 11460, 11462, 11464, 11466, 11468, 11470, 11472, 11474, 11476, 11478, 11480, 11482, 11484, 11486, 11488, 11490 };
+static const uint16_t kUppercaseTable0[509] = { 32833, 90, 32960, 214, 32984, 222, 256, 258, 260, 262, 264, 266, 268, 270, 272, 274, 276, 278, 280, 282, 284, 286, 288, 290, 292, 294, 296, 298, 300, 302, 304, 306, 308, 310, 313, 315, 317, 319, 321, 323, 325, 327, 330, 332, 334, 336, 338, 340, 342, 344, 346, 348, 350, 352, 354, 356, 358, 360, 362, 364, 366, 368, 370, 372, 374, 33144, 377, 379, 381, 33153, 386, 388, 33158, 391, 33161, 395, 33166, 401, 33171, 404, 33174, 408, 33180, 413, 33183, 416, 418, 420, 33190, 423, 425, 428, 33198, 431, 33201, 435, 437, 33207, 440, 444, 452, 455, 458, 461, 463, 465, 467, 469, 471, 473, 475, 478, 480, 482, 484, 486, 488, 490, 492, 494, 497, 500, 33270, 504, 506, 508, 510, 512, 514, 516, 518, 520, 522, 524, 526, 528, 530, 532, 534, 536, 538, 540, 542, 544, 546, 548, 550, 552, 554, 556, 558, 560, 562, 33338, 571, 33341, 574, 577, 33347, 582, 584, 586, 588, 590, 902, 33672, 906, 908, 33678, 911, 33681, 929, 33699, 939, 33746, 980, 984, 986, 988, 990, 992, 994, 996, 998, 1000, 1002, 1004, 1006, 1012, 1015, 33785, 1018, 33789, 1071, 1120, 1122, 1124, 1126, 1128, 1130, 1132, 1134, 1136, 1138, 1140, 1142, 1144, 1146, 1148, 1150, 1152, 1162, 1164, 1166, 1168, 1170, 1172, 1174, 1176, 1178, 1180, 1182, 1184, 1186, 1188, 1190, 1192, 1194, 1196, 1198, 1200, 1202, 1204, 1206, 1208, 1210, 1212, 1214, 33984, 1217, 1219, 1221, 1223, 1225, 1227, 1229, 1232, 1234, 1236, 1238, 1240, 1242, 1244, 1246, 1248, 1250, 1252, 1254, 1256, 1258, 1260, 1262, 1264, 1266, 1268, 1270, 1272, 1274, 1276, 1278, 1280, 1282, 1284, 1286, 1288, 1290, 1292, 1294, 1296, 1298, 34097, 1366, 37024, 4293, 7680, 7682, 7684, 7686, 7688, 7690, 7692, 7694, 7696, 7698, 7700, 7702, 7704, 7706, 7708, 7710, 7712, 7714, 7716, 7718, 7720, 7722, 7724, 7726, 7728, 7730, 7732, 7734, 7736, 7738, 7740, 7742, 7744, 7746, 7748, 7750, 7752, 7754, 7756, 7758, 7760, 7762, 7764, 7766, 7768, 7770, 7772, 7774, 7776, 7778, 7780, 7782, 7784, 7786, 7788, 7790, 7792, 7794, 7796, 7798, 7800, 7802, 7804, 7806, 7808, 7810, 7812, 7814, 7816, 7818, 7820, 7822, 7824, 7826, 7828, 7840, 7842, 7844, 7846, 7848, 7850, 7852, 7854, 7856, 7858, 7860, 7862, 7864, 7866, 7868, 7870, 7872, 7874, 7876, 7878, 7880, 7882, 7884, 7886, 7888, 7890, 7892, 7894, 7896, 7898, 7900, 7902, 7904, 7906, 7908, 7910, 7912, 7914, 7916, 7918, 7920, 7922, 7924, 7926, 7928, 40712, 7951, 40728, 7965, 40744, 7983, 40760, 7999, 40776, 8013, 8025, 8027, 8029, 8031, 40808, 8047, 40888, 8123, 40904, 8139, 40920, 8155, 40936, 8172, 40952, 8187, 8450, 8455, 41227, 8461, 41232, 8466, 8469, 41241, 8477, 8484, 8486, 8488, 41258, 8493, 41264, 8499, 41278, 8511, 8517, 8579, 44032, 11310, 11360, 44130, 11364, 11367, 11369, 11371, 11381, 11392, 11394, 11396, 11398, 11400, 11402, 11404, 11406, 11408, 11410, 11412, 11414, 11416, 11418, 11420, 11422, 11424, 11426, 11428, 11430, 11432, 11434, 11436, 11438, 11440, 11442, 11444, 11446, 11448, 11450, 11452, 11454, 11456, 11458, 11460, 11462, 11464, 11466, 11468, 11470, 11472, 11474, 11476, 11478, 11480, 11482, 11484, 11486, 11488, 11490 }; // NOLINT
 static const uint16_t kUppercaseTable1Size = 2;
-static const uint16_t kUppercaseTable1[2] = { 65313, 32570 };
+static const uint16_t kUppercaseTable1[2] = { 65313, 32570 }; // NOLINT
 static const uint16_t kUppercaseTable2Size = 2;
-static const uint16_t kUppercaseTable2[2] = { 33792, 1063 };
+static const uint16_t kUppercaseTable2[2] = { 33792, 1063 }; // NOLINT
 static const uint16_t kUppercaseTable3Size = 58;
-static const uint16_t kUppercaseTable3[58] = { 54272, 21529, 54324, 21581, 54376, 21633, 21660, 54430, 21663, 21666, 54437, 21670, 54441, 21676, 54446, 21685, 54480, 21737, 54532, 21765, 54535, 21770, 54541, 21780, 54550, 21788, 54584, 21817, 54587, 21822, 54592, 21828, 21830, 54602, 21840, 54636, 21893, 54688, 21945, 54740, 21997, 54792, 22049, 54844, 22101, 54896, 22153, 54952, 22208, 55010, 22266, 55068, 22324, 55126, 22382, 55184, 22440, 22474 };
+static const uint16_t kUppercaseTable3[58] = { 54272, 21529, 54324, 21581, 54376, 21633, 21660, 54430, 21663, 21666, 54437, 21670, 54441, 21676, 54446, 21685, 54480, 21737, 54532, 21765, 54535, 21770, 54541, 21780, 54550, 21788, 54584, 21817, 54587, 21822, 54592, 21828, 21830, 54602, 21840, 54636, 21893, 54688, 21945, 54740, 21997, 54792, 22049, 54844, 22101, 54896, 22153, 54952, 22208, 55010, 22266, 55068, 22324, 55126, 22382, 55184, 22440, 22474 }; // NOLINT
 bool Uppercase::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -352,13 +352,13 @@
 // Lowercase:            point.category == 'Ll'
 
 static const uint16_t kLowercaseTable0Size = 528;
-static const uint16_t kLowercaseTable0[528] = { 32865, 122, 170, 181, 186, 32991, 246, 33016, 255, 257, 259, 261, 263, 265, 267, 269, 271, 273, 275, 277, 279, 281, 283, 285, 287, 289, 291, 293, 295, 297, 299, 301, 303, 305, 307, 309, 33079, 312, 314, 316, 318, 320, 322, 324, 326, 33096, 329, 331, 333, 335, 337, 339, 341, 343, 345, 347, 349, 351, 353, 355, 357, 359, 361, 363, 365, 367, 369, 371, 373, 375, 378, 380, 33150, 384, 387, 389, 392, 33164, 397, 402, 405, 33177, 411, 414, 417, 419, 421, 424, 33194, 427, 429, 432, 436, 438, 33209, 442, 33213, 447, 454, 457, 460, 462, 464, 466, 468, 470, 472, 474, 33244, 477, 479, 481, 483, 485, 487, 489, 491, 493, 33263, 496, 499, 501, 505, 507, 509, 511, 513, 515, 517, 519, 521, 523, 525, 527, 529, 531, 533, 535, 537, 539, 541, 543, 545, 547, 549, 551, 553, 555, 557, 559, 561, 33331, 569, 572, 33343, 576, 578, 583, 585, 587, 589, 33359, 659, 33429, 687, 33659, 893, 912, 33708, 974, 33744, 977, 33749, 983, 985, 987, 989, 991, 993, 995, 997, 999, 1001, 1003, 1005, 33775, 1011, 1013, 1016, 33787, 1020, 33840, 1119, 1121, 1123, 1125, 1127, 1129, 1131, 1133, 1135, 1137, 1139, 1141, 1143, 1145, 1147, 1149, 1151, 1153, 1163, 1165, 1167, 1169, 1171, 1173, 1175, 1177, 1179, 1181, 1183, 1185, 1187, 1189, 1191, 1193, 1195, 1197, 1199, 1201, 1203, 1205, 1207, 1209, 1211, 1213, 1215, 1218, 1220, 1222, 1224, 1226, 1228, 33998, 1231, 1233, 1235, 1237, 1239, 1241, 1243, 1245, 1247, 1249, 1251, 1253, 1255, 1257, 1259, 1261, 1263, 1265, 1267, 1269, 1271, 1273, 1275, 1277, 1279, 1281, 1283, 1285, 1287, 1289, 1291, 1293, 1295, 1297, 1299, 34145, 1415, 40192, 7467, 40290, 7543, 40313, 7578, 7681, 7683, 7685, 7687, 7689, 7691, 7693, 7695, 7697, 7699, 7701, 7703, 7705, 7707, 7709, 7711, 7713, 7715, 7717, 7719, 7721, 7723, 7725, 7727, 7729, 7731, 7733, 7735, 7737, 7739, 7741, 7743, 7745, 7747, 7749, 7751, 7753, 7755, 7757, 7759, 7761, 7763, 7765, 7767, 7769, 7771, 7773, 7775, 7777, 7779, 7781, 7783, 7785, 7787, 7789, 7791, 7793, 7795, 7797, 7799, 7801, 7803, 7805, 7807, 7809, 7811, 7813, 7815, 7817, 7819, 7821, 7823, 7825, 7827, 40597, 7835, 7841, 7843, 7845, 7847, 7849, 7851, 7853, 7855, 7857, 7859, 7861, 7863, 7865, 7867, 7869, 7871, 7873, 7875, 7877, 7879, 7881, 7883, 7885, 7887, 7889, 7891, 7893, 7895, 7897, 7899, 7901, 7903, 7905, 7907, 7909, 7911, 7913, 7915, 7917, 7919, 7921, 7923, 7925, 7927, 7929, 40704, 7943, 40720, 7957, 40736, 7975, 40752, 7991, 40768, 8005, 40784, 8023, 40800, 8039, 40816, 8061, 40832, 8071, 40848, 8087, 40864, 8103, 40880, 8116, 40886, 8119, 8126, 40898, 8132, 40902, 8135, 40912, 8147, 40918, 8151, 40928, 8167, 40946, 8180, 40950, 8183, 8305, 8319, 8458, 41230, 8463, 8467, 8495, 8500, 8505, 41276, 8509, 41286, 8521, 8526, 8580, 44080, 11358, 11361, 44133, 11366, 11368, 11370, 11372, 11380, 44150, 11383, 11393, 11395, 11397, 11399, 11401, 11403, 11405, 11407, 11409, 11411, 11413, 11415, 11417, 11419, 11421, 11423, 11425, 11427, 11429, 11431, 11433, 11435, 11437, 11439, 11441, 11443, 11445, 11447, 11449, 11451, 11453, 11455, 11457, 11459, 11461, 11463, 11465, 11467, 11469, 11471, 11473, 11475, 11477, 11479, 11481, 11483, 11485, 11487, 11489, 44259, 11492, 44288, 11557 };
+static const uint16_t kLowercaseTable0[528] = { 32865, 122, 170, 181, 186, 32991, 246, 33016, 255, 257, 259, 261, 263, 265, 267, 269, 271, 273, 275, 277, 279, 281, 283, 285, 287, 289, 291, 293, 295, 297, 299, 301, 303, 305, 307, 309, 33079, 312, 314, 316, 318, 320, 322, 324, 326, 33096, 329, 331, 333, 335, 337, 339, 341, 343, 345, 347, 349, 351, 353, 355, 357, 359, 361, 363, 365, 367, 369, 371, 373, 375, 378, 380, 33150, 384, 387, 389, 392, 33164, 397, 402, 405, 33177, 411, 414, 417, 419, 421, 424, 33194, 427, 429, 432, 436, 438, 33209, 442, 33213, 447, 454, 457, 460, 462, 464, 466, 468, 470, 472, 474, 33244, 477, 479, 481, 483, 485, 487, 489, 491, 493, 33263, 496, 499, 501, 505, 507, 509, 511, 513, 515, 517, 519, 521, 523, 525, 527, 529, 531, 533, 535, 537, 539, 541, 543, 545, 547, 549, 551, 553, 555, 557, 559, 561, 33331, 569, 572, 33343, 576, 578, 583, 585, 587, 589, 33359, 659, 33429, 687, 33659, 893, 912, 33708, 974, 33744, 977, 33749, 983, 985, 987, 989, 991, 993, 995, 997, 999, 1001, 1003, 1005, 33775, 1011, 1013, 1016, 33787, 1020, 33840, 1119, 1121, 1123, 1125, 1127, 1129, 1131, 1133, 1135, 1137, 1139, 1141, 1143, 1145, 1147, 1149, 1151, 1153, 1163, 1165, 1167, 1169, 1171, 1173, 1175, 1177, 1179, 1181, 1183, 1185, 1187, 1189, 1191, 1193, 1195, 1197, 1199, 1201, 1203, 1205, 1207, 1209, 1211, 1213, 1215, 1218, 1220, 1222, 1224, 1226, 1228, 33998, 1231, 1233, 1235, 1237, 1239, 1241, 1243, 1245, 1247, 1249, 1251, 1253, 1255, 1257, 1259, 1261, 1263, 1265, 1267, 1269, 1271, 1273, 1275, 1277, 1279, 1281, 1283, 1285, 1287, 1289, 1291, 1293, 1295, 1297, 1299, 34145, 1415, 40192, 7467, 40290, 7543, 40313, 7578, 7681, 7683, 7685, 7687, 7689, 7691, 7693, 7695, 7697, 7699, 7701, 7703, 7705, 7707, 7709, 7711, 7713, 7715, 7717, 7719, 7721, 7723, 7725, 7727, 7729, 7731, 7733, 7735, 7737, 7739, 7741, 7743, 7745, 7747, 7749, 7751, 7753, 7755, 7757, 7759, 7761, 7763, 7765, 7767, 7769, 7771, 7773, 7775, 7777, 7779, 7781, 7783, 7785, 7787, 7789, 7791, 7793, 7795, 7797, 7799, 7801, 7803, 7805, 7807, 7809, 7811, 7813, 7815, 7817, 7819, 7821, 7823, 7825, 7827, 40597, 7835, 7841, 7843, 7845, 7847, 7849, 7851, 7853, 7855, 7857, 7859, 7861, 7863, 7865, 7867, 7869, 7871, 7873, 7875, 7877, 7879, 7881, 7883, 7885, 7887, 7889, 7891, 7893, 7895, 7897, 7899, 7901, 7903, 7905, 7907, 7909, 7911, 7913, 7915, 7917, 7919, 7921, 7923, 7925, 7927, 7929, 40704, 7943, 40720, 7957, 40736, 7975, 40752, 7991, 40768, 8005, 40784, 8023, 40800, 8039, 40816, 8061, 40832, 8071, 40848, 8087, 40864, 8103, 40880, 8116, 40886, 8119, 8126, 40898, 8132, 40902, 8135, 40912, 8147, 40918, 8151, 40928, 8167, 40946, 8180, 40950, 8183, 8305, 8319, 8458, 41230, 8463, 8467, 8495, 8500, 8505, 41276, 8509, 41286, 8521, 8526, 8580, 44080, 11358, 11361, 44133, 11366, 11368, 11370, 11372, 11380, 44150, 11383, 11393, 11395, 11397, 11399, 11401, 11403, 11405, 11407, 11409, 11411, 11413, 11415, 11417, 11419, 11421, 11423, 11425, 11427, 11429, 11431, 11433, 11435, 11437, 11439, 11441, 11443, 11445, 11447, 11449, 11451, 11453, 11455, 11457, 11459, 11461, 11463, 11465, 11467, 11469, 11471, 11473, 11475, 11477, 11479, 11481, 11483, 11485, 11487, 11489, 44259, 11492, 44288, 11557 }; // NOLINT
 static const uint16_t kLowercaseTable1Size = 6;
-static const uint16_t kLowercaseTable1[6] = { 64256, 31494, 64275, 31511, 65345, 32602 };
+static const uint16_t kLowercaseTable1[6] = { 64256, 31494, 64275, 31511, 65345, 32602 }; // NOLINT
 static const uint16_t kLowercaseTable2Size = 2;
-static const uint16_t kLowercaseTable2[2] = { 33832, 1103 };
+static const uint16_t kLowercaseTable2[2] = { 33832, 1103 }; // NOLINT
 static const uint16_t kLowercaseTable3Size = 54;
-static const uint16_t kLowercaseTable3[54] = { 54298, 21555, 54350, 21588, 54358, 21607, 54402, 21659, 54454, 21689, 21691, 54461, 21699, 54469, 21711, 54506, 21763, 54558, 21815, 54610, 21867, 54662, 21919, 54714, 21971, 54766, 22023, 54818, 22075, 54870, 22127, 54922, 22181, 54978, 22234, 55004, 22241, 55036, 22292, 55062, 22299, 55094, 22350, 55120, 22357, 55152, 22408, 55178, 22415, 55210, 22466, 55236, 22473, 22475 };
+static const uint16_t kLowercaseTable3[54] = { 54298, 21555, 54350, 21588, 54358, 21607, 54402, 21659, 54454, 21689, 21691, 54461, 21699, 54469, 21711, 54506, 21763, 54558, 21815, 54610, 21867, 54662, 21919, 54714, 21971, 54766, 22023, 54818, 22075, 54870, 22127, 54922, 22181, 54978, 22234, 55004, 22241, 55036, 22292, 55062, 22299, 55094, 22350, 55120, 22357, 55152, 22408, 55178, 22415, 55210, 22466, 55236, 22473, 22475 }; // NOLINT
 bool Lowercase::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -381,17 +381,17 @@
 // Letter:               point.category in ['Lu', 'Ll', 'Lt', 'Lm', 'Lo' ]
 
 static const uint16_t kLetterTable0Size = 475;
-static const uint16_t kLetterTable0[475] = { 32833, 90, 32865, 122, 170, 181, 186, 32960, 214, 32984, 246, 33016, 705, 33478, 721, 33504, 740, 750, 33658, 893, 902, 33672, 906, 908, 33678, 929, 33699, 974, 33744, 1013, 33783, 1153, 33930, 1299, 34097, 1366, 1369, 34145, 1415, 34256, 1514, 34288, 1522, 34337, 1594, 34368, 1610, 34414, 1647, 34417, 1747, 1749, 34533, 1766, 34542, 1775, 34554, 1788, 1791, 1808, 34578, 1839, 34637, 1901, 34688, 1957, 1969, 34762, 2026, 34804, 2037, 2042, 35076, 2361, 2365, 2384, 35160, 2401, 35195, 2431, 35205, 2444, 35215, 2448, 35219, 2472, 35242, 2480, 2482, 35254, 2489, 2493, 2510, 35292, 2525, 35295, 2529, 35312, 2545, 35333, 2570, 35343, 2576, 35347, 2600, 35370, 2608, 35378, 2611, 35381, 2614, 35384, 2617, 35417, 2652, 2654, 35442, 2676, 35461, 2701, 35471, 2705, 35475, 2728, 35498, 2736, 35506, 2739, 35509, 2745, 2749, 2768, 35552, 2785, 35589, 2828, 35599, 2832, 35603, 2856, 35626, 2864, 35634, 2867, 35637, 2873, 2877, 35676, 2909, 35679, 2913, 2929, 2947, 35717, 2954, 35726, 2960, 35730, 2965, 35737, 2970, 2972, 35742, 2975, 35747, 2980, 35752, 2986, 35758, 3001, 35845, 3084, 35854, 3088, 35858, 3112, 35882, 3123, 35893, 3129, 35936, 3169, 35973, 3212, 35982, 3216, 35986, 3240, 36010, 3251, 36021, 3257, 3261, 3294, 36064, 3297, 36101, 3340, 36110, 3344, 36114, 3368, 36138, 3385, 36192, 3425, 36229, 3478, 36250, 3505, 36275, 3515, 3517, 36288, 3526, 36353, 3632, 36402, 3635, 36416, 3654, 36481, 3714, 3716, 36487, 3720, 3722, 3725, 36500, 3735, 36505, 3743, 36513, 3747, 3749, 3751, 36522, 3755, 36525, 3760, 36530, 3763, 3773, 36544, 3780, 3782, 36572, 3805, 3840, 36672, 3911, 36681, 3946, 36744, 3979, 36864, 4129, 36899, 4135, 36905, 4138, 36944, 4181, 37024, 4293, 37072, 4346, 4348, 37120, 4441, 37215, 4514, 37288, 4601, 37376, 4680, 37450, 4685, 37456, 4694, 4696, 37466, 4701, 37472, 4744, 37514, 4749, 37520, 4784, 37554, 4789, 37560, 4798, 4800, 37570, 4805, 37576, 4822, 37592, 4880, 37650, 4885, 37656, 4954, 37760, 5007, 37792, 5108, 37889, 5740, 38511, 5750, 38529, 5786, 38560, 5866, 38656, 5900, 38670, 5905, 38688, 5937, 38720, 5969, 38752, 5996, 38766, 6000, 38784, 6067, 6103, 6108, 38944, 6263, 39040, 6312, 39168, 6428, 39248, 6509, 39280, 6516, 39296, 6569, 39361, 6599, 39424, 6678, 39685, 6963, 39749, 6987, 40192, 7615, 40448, 7835, 40608, 7929, 40704, 7957, 40728, 7965, 40736, 8005, 40776, 8013, 40784, 8023, 8025, 8027, 8029, 40799, 8061, 40832, 8116, 40886, 8124, 8126, 40898, 8132, 40902, 8140, 40912, 8147, 40918, 8155, 40928, 8172, 40946, 8180, 40950, 8188, 8305, 8319, 41104, 8340, 8450, 8455, 41226, 8467, 8469, 41241, 8477, 8484, 8486, 8488, 41258, 8493, 41263, 8505, 41276, 8511, 41285, 8521, 8526, 41347, 8580, 44032, 11310, 44080, 11358, 44128, 11372, 44148, 11383, 44160, 11492, 44288, 11557, 44336, 11621, 11631, 44416, 11670, 44448, 11686, 44456, 11694, 44464, 11702, 44472, 11710, 44480, 11718, 44488, 11726, 44496, 11734, 44504, 11742, 45061, 12294, 45105, 12341, 45115, 12348, 45121, 12438, 45213, 12447, 45217, 12538, 45308, 12543, 45317, 12588, 45361, 12686, 45472, 12727, 45552, 12799, 13312, 19893, 19968 };
+static const uint16_t kLetterTable0[475] = { 32833, 90, 32865, 122, 170, 181, 186, 32960, 214, 32984, 246, 33016, 705, 33478, 721, 33504, 740, 750, 33658, 893, 902, 33672, 906, 908, 33678, 929, 33699, 974, 33744, 1013, 33783, 1153, 33930, 1299, 34097, 1366, 1369, 34145, 1415, 34256, 1514, 34288, 1522, 34337, 1594, 34368, 1610, 34414, 1647, 34417, 1747, 1749, 34533, 1766, 34542, 1775, 34554, 1788, 1791, 1808, 34578, 1839, 34637, 1901, 34688, 1957, 1969, 34762, 2026, 34804, 2037, 2042, 35076, 2361, 2365, 2384, 35160, 2401, 35195, 2431, 35205, 2444, 35215, 2448, 35219, 2472, 35242, 2480, 2482, 35254, 2489, 2493, 2510, 35292, 2525, 35295, 2529, 35312, 2545, 35333, 2570, 35343, 2576, 35347, 2600, 35370, 2608, 35378, 2611, 35381, 2614, 35384, 2617, 35417, 2652, 2654, 35442, 2676, 35461, 2701, 35471, 2705, 35475, 2728, 35498, 2736, 35506, 2739, 35509, 2745, 2749, 2768, 35552, 2785, 35589, 2828, 35599, 2832, 35603, 2856, 35626, 2864, 35634, 2867, 35637, 2873, 2877, 35676, 2909, 35679, 2913, 2929, 2947, 35717, 2954, 35726, 2960, 35730, 2965, 35737, 2970, 2972, 35742, 2975, 35747, 2980, 35752, 2986, 35758, 3001, 35845, 3084, 35854, 3088, 35858, 3112, 35882, 3123, 35893, 3129, 35936, 3169, 35973, 3212, 35982, 3216, 35986, 3240, 36010, 3251, 36021, 3257, 3261, 3294, 36064, 3297, 36101, 3340, 36110, 3344, 36114, 3368, 36138, 3385, 36192, 3425, 36229, 3478, 36250, 3505, 36275, 3515, 3517, 36288, 3526, 36353, 3632, 36402, 3635, 36416, 3654, 36481, 3714, 3716, 36487, 3720, 3722, 3725, 36500, 3735, 36505, 3743, 36513, 3747, 3749, 3751, 36522, 3755, 36525, 3760, 36530, 3763, 3773, 36544, 3780, 3782, 36572, 3805, 3840, 36672, 3911, 36681, 3946, 36744, 3979, 36864, 4129, 36899, 4135, 36905, 4138, 36944, 4181, 37024, 4293, 37072, 4346, 4348, 37120, 4441, 37215, 4514, 37288, 4601, 37376, 4680, 37450, 4685, 37456, 4694, 4696, 37466, 4701, 37472, 4744, 37514, 4749, 37520, 4784, 37554, 4789, 37560, 4798, 4800, 37570, 4805, 37576, 4822, 37592, 4880, 37650, 4885, 37656, 4954, 37760, 5007, 37792, 5108, 37889, 5740, 38511, 5750, 38529, 5786, 38560, 5866, 38656, 5900, 38670, 5905, 38688, 5937, 38720, 5969, 38752, 5996, 38766, 6000, 38784, 6067, 6103, 6108, 38944, 6263, 39040, 6312, 39168, 6428, 39248, 6509, 39280, 6516, 39296, 6569, 39361, 6599, 39424, 6678, 39685, 6963, 39749, 6987, 40192, 7615, 40448, 7835, 40608, 7929, 40704, 7957, 40728, 7965, 40736, 8005, 40776, 8013, 40784, 8023, 8025, 8027, 8029, 40799, 8061, 40832, 8116, 40886, 8124, 8126, 40898, 8132, 40902, 8140, 40912, 8147, 40918, 8155, 40928, 8172, 40946, 8180, 40950, 8188, 8305, 8319, 41104, 8340, 8450, 8455, 41226, 8467, 8469, 41241, 8477, 8484, 8486, 8488, 41258, 8493, 41263, 8505, 41276, 8511, 41285, 8521, 8526, 41347, 8580, 44032, 11310, 44080, 11358, 44128, 11372, 44148, 11383, 44160, 11492, 44288, 11557, 44336, 11621, 11631, 44416, 11670, 44448, 11686, 44456, 11694, 44464, 11702, 44472, 11710, 44480, 11718, 44488, 11726, 44496, 11734, 44504, 11742, 45061, 12294, 45105, 12341, 45115, 12348, 45121, 12438, 45213, 12447, 45217, 12538, 45308, 12543, 45317, 12588, 45361, 12686, 45472, 12727, 45552, 12799, 13312, 19893, 19968 }; // NOLINT
 static const uint16_t kLetterTable1Size = 67;
-static const uint16_t kLetterTable1[67] = { 8123, 40960, 9356, 42775, 10010, 43008, 10241, 43011, 10245, 43015, 10250, 43020, 10274, 43072, 10355, 11264, 22435, 63744, 31277, 64048, 31338, 64112, 31449, 64256, 31494, 64275, 31511, 31517, 64287, 31528, 64298, 31542, 64312, 31548, 31550, 64320, 31553, 64323, 31556, 64326, 31665, 64467, 32061, 64848, 32143, 64914, 32199, 65008, 32251, 65136, 32372, 65142, 32508, 65313, 32570, 65345, 32602, 65382, 32702, 65474, 32711, 65482, 32719, 65490, 32727, 65498, 32732 };
+static const uint16_t kLetterTable1[67] = { 8123, 40960, 9356, 42775, 10010, 43008, 10241, 43011, 10245, 43015, 10250, 43020, 10274, 43072, 10355, 11264, 22435, 63744, 31277, 64048, 31338, 64112, 31449, 64256, 31494, 64275, 31511, 31517, 64287, 31528, 64298, 31542, 64312, 31548, 31550, 64320, 31553, 64323, 31556, 64326, 31665, 64467, 32061, 64848, 32143, 64914, 32199, 65008, 32251, 65136, 32372, 65142, 32508, 65313, 32570, 65345, 32602, 65382, 32702, 65474, 32711, 65482, 32719, 65490, 32727, 65498, 32732 }; // NOLINT
 static const uint16_t kLetterTable2Size = 48;
-static const uint16_t kLetterTable2[48] = { 32768, 11, 32781, 38, 32808, 58, 32828, 61, 32831, 77, 32848, 93, 32896, 250, 33536, 798, 33584, 832, 33602, 841, 33664, 925, 33696, 963, 33736, 975, 33792, 1181, 34816, 2053, 2056, 34826, 2101, 34871, 2104, 2108, 2111, 35072, 2325, 2560, 35344, 2579, 35349, 2583, 35353, 2611, 40960, 9070 };
+static const uint16_t kLetterTable2[48] = { 32768, 11, 32781, 38, 32808, 58, 32828, 61, 32831, 77, 32848, 93, 32896, 250, 33536, 798, 33584, 832, 33602, 841, 33664, 925, 33696, 963, 33736, 975, 33792, 1181, 34816, 2053, 2056, 34826, 2101, 34871, 2104, 2108, 2111, 35072, 2325, 2560, 35344, 2579, 35349, 2583, 35353, 2611, 40960, 9070 }; // NOLINT
 static const uint16_t kLetterTable3Size = 57;
-static const uint16_t kLetterTable3[57] = { 54272, 21588, 54358, 21660, 54430, 21663, 21666, 54437, 21670, 54441, 21676, 54446, 21689, 21691, 54461, 21699, 54469, 21765, 54535, 21770, 54541, 21780, 54550, 21788, 54558, 21817, 54587, 21822, 54592, 21828, 21830, 54602, 21840, 54610, 22181, 54952, 22208, 54978, 22234, 55004, 22266, 55036, 22292, 55062, 22324, 55094, 22350, 55120, 22382, 55152, 22408, 55178, 22440, 55210, 22466, 55236, 22475 };
+static const uint16_t kLetterTable3[57] = { 54272, 21588, 54358, 21660, 54430, 21663, 21666, 54437, 21670, 54441, 21676, 54446, 21689, 21691, 54461, 21699, 54469, 21765, 54535, 21770, 54541, 21780, 54550, 21788, 54558, 21817, 54587, 21822, 54592, 21828, 21830, 54602, 21840, 54610, 22181, 54952, 22208, 54978, 22234, 55004, 22266, 55036, 22292, 55062, 22324, 55094, 22350, 55120, 22382, 55152, 22408, 55178, 22440, 55210, 22466, 55236, 22475 }; // NOLINT
 static const uint16_t kLetterTable4Size = 1;
-static const uint16_t kLetterTable4[1] = { 0 };
+static const uint16_t kLetterTable4[1] = { 0 }; // NOLINT
 static const uint16_t kLetterTable5Size = 3;
-static const uint16_t kLetterTable5[3] = { 9942, 63488, 31261 };
+static const uint16_t kLetterTable5[3] = { 9942, 63488, 31261 }; // NOLINT
 bool Letter::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -420,7 +420,7 @@
 // Space:                point.category == 'Zs'
 
 static const uint16_t kSpaceTable0Size = 9;
-static const uint16_t kSpaceTable0[9] = { 32, 160, 5760, 6158, 40960, 8202, 8239, 8287, 12288 };
+static const uint16_t kSpaceTable0[9] = { 32, 160, 5760, 6158, 40960, 8202, 8239, 8287, 12288 }; // NOLINT
 bool Space::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -434,7 +434,7 @@
 // Titlecase:            point.category == 'Lt'
 
 static const uint16_t kTitlecaseTable0Size = 13;
-static const uint16_t kTitlecaseTable0[13] = { 453, 456, 459, 498, 40840, 8079, 40856, 8095, 40872, 8111, 8124, 8140, 8188 };
+static const uint16_t kTitlecaseTable0[13] = { 453, 456, 459, 498, 40840, 8079, 40856, 8095, 40872, 8111, 8124, 8140, 8188 }; // NOLINT
 bool Titlecase::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -448,13 +448,13 @@
 // Number:               point.category in ['Nd', 'Nl', 'No' ]
 
 static const uint16_t kNumberTable0Size = 86;
-static const uint16_t kNumberTable0[86] = { 32816, 57, 32946, 179, 185, 32956, 190, 34400, 1641, 34544, 1785, 34752, 1993, 35174, 2415, 35302, 2543, 35316, 2553, 35430, 2671, 35558, 2799, 35686, 2927, 35814, 3058, 35942, 3183, 36070, 3311, 36198, 3439, 36432, 3673, 36560, 3801, 36640, 3891, 36928, 4169, 37737, 4988, 38638, 5872, 38880, 6121, 38896, 6137, 38928, 6169, 39238, 6479, 39376, 6617, 39760, 7001, 8304, 41076, 8313, 41088, 8329, 41299, 8578, 42080, 9371, 42218, 9471, 42870, 10131, 11517, 12295, 45089, 12329, 45112, 12346, 45458, 12693, 45600, 12841, 45649, 12895, 45696, 12937, 45745, 12991 };
+static const uint16_t kNumberTable0[86] = { 32816, 57, 32946, 179, 185, 32956, 190, 34400, 1641, 34544, 1785, 34752, 1993, 35174, 2415, 35302, 2543, 35316, 2553, 35430, 2671, 35558, 2799, 35686, 2927, 35814, 3058, 35942, 3183, 36070, 3311, 36198, 3439, 36432, 3673, 36560, 3801, 36640, 3891, 36928, 4169, 37737, 4988, 38638, 5872, 38880, 6121, 38896, 6137, 38928, 6169, 39238, 6479, 39376, 6617, 39760, 7001, 8304, 41076, 8313, 41088, 8329, 41299, 8578, 42080, 9371, 42218, 9471, 42870, 10131, 11517, 12295, 45089, 12329, 45112, 12346, 45458, 12693, 45600, 12841, 45649, 12895, 45696, 12937, 45745, 12991 }; // NOLINT
 static const uint16_t kNumberTable1Size = 2;
-static const uint16_t kNumberTable1[2] = { 65296, 32537 };
+static const uint16_t kNumberTable1[2] = { 65296, 32537 }; // NOLINT
 static const uint16_t kNumberTable2Size = 19;
-static const uint16_t kNumberTable2[19] = { 33031, 307, 33088, 376, 394, 33568, 803, 833, 842, 33745, 981, 33952, 1193, 35094, 2329, 35392, 2631, 41984, 9314 };
+static const uint16_t kNumberTable2[19] = { 33031, 307, 33088, 376, 394, 33568, 803, 833, 842, 33745, 981, 33952, 1193, 35094, 2329, 35392, 2631, 41984, 9314 }; // NOLINT
 static const uint16_t kNumberTable3Size = 4;
-static const uint16_t kNumberTable3[4] = { 54112, 21361, 55246, 22527 };
+static const uint16_t kNumberTable3[4] = { 54112, 21361, 55246, 22527 }; // NOLINT
 bool Number::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -477,13 +477,13 @@
 // DecimalDigit:         point.category == 'Nd'
 
 static const uint16_t kDecimalDigitTable0Size = 44;
-static const uint16_t kDecimalDigitTable0[44] = { 32816, 57, 34400, 1641, 34544, 1785, 34752, 1993, 35174, 2415, 35302, 2543, 35430, 2671, 35558, 2799, 35686, 2927, 35814, 3055, 35942, 3183, 36070, 3311, 36198, 3439, 36432, 3673, 36560, 3801, 36640, 3881, 36928, 4169, 38880, 6121, 38928, 6169, 39238, 6479, 39376, 6617, 39760, 7001 };
+static const uint16_t kDecimalDigitTable0[44] = { 32816, 57, 34400, 1641, 34544, 1785, 34752, 1993, 35174, 2415, 35302, 2543, 35430, 2671, 35558, 2799, 35686, 2927, 35814, 3055, 35942, 3183, 36070, 3311, 36198, 3439, 36432, 3673, 36560, 3801, 36640, 3881, 36928, 4169, 38880, 6121, 38928, 6169, 39238, 6479, 39376, 6617, 39760, 7001 }; // NOLINT
 static const uint16_t kDecimalDigitTable1Size = 2;
-static const uint16_t kDecimalDigitTable1[2] = { 65296, 32537 };
+static const uint16_t kDecimalDigitTable1[2] = { 65296, 32537 }; // NOLINT
 static const uint16_t kDecimalDigitTable2Size = 2;
-static const uint16_t kDecimalDigitTable2[2] = { 33952, 1193 };
+static const uint16_t kDecimalDigitTable2[2] = { 33952, 1193 }; // NOLINT
 static const uint16_t kDecimalDigitTable3Size = 2;
-static const uint16_t kDecimalDigitTable3[2] = { 55246, 22527 };
+static const uint16_t kDecimalDigitTable3[2] = { 55246, 22527 }; // NOLINT
 bool DecimalDigit::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -506,13 +506,13 @@
 // Ideographic:          'Id' in point.properties
 
 static const uint16_t kIdeographicTable0Size = 9;
-static const uint16_t kIdeographicTable0[9] = { 45062, 12295, 45089, 12329, 45112, 12346, 13312, 19893, 19968 };
+static const uint16_t kIdeographicTable0[9] = { 45062, 12295, 45089, 12329, 45112, 12346, 13312, 19893, 19968 }; // NOLINT
 static const uint16_t kIdeographicTable1Size = 5;
-static const uint16_t kIdeographicTable1[5] = { 8123, 63744, 31277, 64112, 31449 };
+static const uint16_t kIdeographicTable1[5] = { 8123, 63744, 31277, 64112, 31449 }; // NOLINT
 static const uint16_t kIdeographicTable4Size = 1;
-static const uint16_t kIdeographicTable4[1] = { 0 };
+static const uint16_t kIdeographicTable4[1] = { 0 }; // NOLINT
 static const uint16_t kIdeographicTable5Size = 3;
-static const uint16_t kIdeographicTable5[3] = { 9942, 63488, 31261 };
+static const uint16_t kIdeographicTable5[3] = { 9942, 63488, 31261 }; // NOLINT
 bool Ideographic::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -535,7 +535,7 @@
 // WhiteSpace:           'Ws' in point.properties
 
 static const uint16_t kWhiteSpaceTable0Size = 14;
-static const uint16_t kWhiteSpaceTable0[14] = { 32777, 13, 32, 133, 160, 5760, 6158, 40960, 8202, 41000, 8233, 8239, 8287, 12288 };
+static const uint16_t kWhiteSpaceTable0[14] = { 32777, 13, 32, 133, 160, 5760, 6158, 40960, 8202, 41000, 8233, 8239, 8287, 12288 }; // NOLINT
 bool WhiteSpace::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -549,9 +549,9 @@
 // HexDigit:             'Hd' in point.properties
 
 static const uint16_t kHexDigitTable0Size = 6;
-static const uint16_t kHexDigitTable0[6] = { 32816, 57, 32833, 70, 32865, 102 };
+static const uint16_t kHexDigitTable0[6] = { 32816, 57, 32833, 70, 32865, 102 }; // NOLINT
 static const uint16_t kHexDigitTable1Size = 6;
-static const uint16_t kHexDigitTable1[6] = { 65296, 32537, 65313, 32550, 65345, 32582 };
+static const uint16_t kHexDigitTable1[6] = { 65296, 32537, 65313, 32550, 65345, 32582 }; // NOLINT
 bool HexDigit::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -568,7 +568,7 @@
 // AsciiHexDigit:        'Ah' in point.properties
 
 static const uint16_t kAsciiHexDigitTable0Size = 6;
-static const uint16_t kAsciiHexDigitTable0[6] = { 32816, 57, 32833, 70, 32865, 102 };
+static const uint16_t kAsciiHexDigitTable0[6] = { 32816, 57, 32833, 70, 32865, 102 }; // NOLINT
 bool AsciiHexDigit::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -582,7 +582,7 @@
 // BidiControl:          'Bc' in point.properties
 
 static const uint16_t kBidiControlTable0Size = 4;
-static const uint16_t kBidiControlTable0[4] = { 40974, 8207, 41002, 8238 };
+static const uint16_t kBidiControlTable0[4] = { 40974, 8207, 41002, 8238 }; // NOLINT
 bool BidiControl::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -596,7 +596,7 @@
 // JoinControl:          'Jc' in point.properties
 
 static const uint16_t kJoinControlTable0Size = 2;
-static const uint16_t kJoinControlTable0[2] = { 40972, 8205 };
+static const uint16_t kJoinControlTable0[2] = { 40972, 8205 }; // NOLINT
 bool JoinControl::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -610,9 +610,9 @@
 // Dash:                 'Dh' in point.properties
 
 static const uint16_t kDashTable0Size = 14;
-static const uint16_t kDashTable0[14] = { 45, 1418, 1470, 6150, 40976, 8213, 8275, 8315, 8331, 8722, 11799, 12316, 12336, 12448 };
+static const uint16_t kDashTable0[14] = { 45, 1418, 1470, 6150, 40976, 8213, 8275, 8315, 8331, 8722, 11799, 12316, 12336, 12448 }; // NOLINT
 static const uint16_t kDashTable1Size = 5;
-static const uint16_t kDashTable1[5] = { 65073, 32306, 32344, 32355, 32525 };
+static const uint16_t kDashTable1[5] = { 65073, 32306, 32344, 32355, 32525 }; // NOLINT
 bool Dash::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -629,9 +629,9 @@
 // Hyphen:               'Hp' in point.properties
 
 static const uint16_t kHyphenTable0Size = 8;
-static const uint16_t kHyphenTable0[8] = { 45, 173, 1418, 6150, 40976, 8209, 11799, 12539 };
+static const uint16_t kHyphenTable0[8] = { 45, 173, 1418, 6150, 40976, 8209, 11799, 12539 }; // NOLINT
 static const uint16_t kHyphenTable1Size = 3;
-static const uint16_t kHyphenTable1[3] = { 32355, 32525, 32613 };
+static const uint16_t kHyphenTable1[3] = { 32355, 32525, 32613 }; // NOLINT
 bool Hyphen::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -648,7 +648,7 @@
 // LineTerminator:       'Lt' in point.properties
 
 static const uint16_t kLineTerminatorTable0Size = 4;
-static const uint16_t kLineTerminatorTable0[4] = { 10, 13, 41000, 8233 };
+static const uint16_t kLineTerminatorTable0[4] = { 10, 13, 41000, 8233 }; // NOLINT
 bool LineTerminator::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -662,15 +662,15 @@
 // CombiningMark:        point.category in ['Mn', 'Mc']
 
 static const uint16_t kCombiningMarkTable0Size = 214;
-static const uint16_t kCombiningMarkTable0[214] = { 33536, 879, 33923, 1158, 34193, 1469, 1471, 34241, 1474, 34244, 1477, 1479, 34320, 1557, 34379, 1630, 1648, 34518, 1756, 34527, 1764, 34535, 1768, 34538, 1773, 1809, 34608, 1866, 34726, 1968, 34795, 2035, 35073, 2307, 2364, 35134, 2381, 35153, 2388, 35170, 2403, 35201, 2435, 2492, 35262, 2500, 35271, 2504, 35275, 2509, 2519, 35298, 2531, 35329, 2563, 2620, 35390, 2626, 35399, 2632, 35403, 2637, 35440, 2673, 35457, 2691, 2748, 35518, 2757, 35527, 2761, 35531, 2765, 35554, 2787, 35585, 2819, 2876, 35646, 2883, 35655, 2888, 35659, 2893, 35670, 2903, 2946, 35774, 3010, 35782, 3016, 35786, 3021, 3031, 35841, 3075, 35902, 3140, 35910, 3144, 35914, 3149, 35925, 3158, 35970, 3203, 3260, 36030, 3268, 36038, 3272, 36042, 3277, 36053, 3286, 36066, 3299, 36098, 3331, 36158, 3395, 36166, 3400, 36170, 3405, 3415, 36226, 3459, 3530, 36303, 3540, 3542, 36312, 3551, 36338, 3571, 3633, 36404, 3642, 36423, 3662, 3761, 36532, 3769, 36539, 3772, 36552, 3789, 36632, 3865, 3893, 3895, 3897, 36670, 3903, 36721, 3972, 36742, 3975, 36752, 3991, 36761, 4028, 4038, 36908, 4146, 36918, 4153, 36950, 4185, 4959, 38674, 5908, 38706, 5940, 38738, 5971, 38770, 6003, 38838, 6099, 6109, 38923, 6157, 6313, 39200, 6443, 39216, 6459, 39344, 6592, 39368, 6601, 39447, 6683, 39680, 6916, 39732, 6980, 39787, 7027, 40384, 7626, 40446, 7679, 41168, 8412, 8417, 41189, 8431, 45098, 12335, 45209, 12442 };
+static const uint16_t kCombiningMarkTable0[214] = { 33536, 879, 33923, 1158, 34193, 1469, 1471, 34241, 1474, 34244, 1477, 1479, 34320, 1557, 34379, 1630, 1648, 34518, 1756, 34527, 1764, 34535, 1768, 34538, 1773, 1809, 34608, 1866, 34726, 1968, 34795, 2035, 35073, 2307, 2364, 35134, 2381, 35153, 2388, 35170, 2403, 35201, 2435, 2492, 35262, 2500, 35271, 2504, 35275, 2509, 2519, 35298, 2531, 35329, 2563, 2620, 35390, 2626, 35399, 2632, 35403, 2637, 35440, 2673, 35457, 2691, 2748, 35518, 2757, 35527, 2761, 35531, 2765, 35554, 2787, 35585, 2819, 2876, 35646, 2883, 35655, 2888, 35659, 2893, 35670, 2903, 2946, 35774, 3010, 35782, 3016, 35786, 3021, 3031, 35841, 3075, 35902, 3140, 35910, 3144, 35914, 3149, 35925, 3158, 35970, 3203, 3260, 36030, 3268, 36038, 3272, 36042, 3277, 36053, 3286, 36066, 3299, 36098, 3331, 36158, 3395, 36166, 3400, 36170, 3405, 3415, 36226, 3459, 3530, 36303, 3540, 3542, 36312, 3551, 36338, 3571, 3633, 36404, 3642, 36423, 3662, 3761, 36532, 3769, 36539, 3772, 36552, 3789, 36632, 3865, 3893, 3895, 3897, 36670, 3903, 36721, 3972, 36742, 3975, 36752, 3991, 36761, 4028, 4038, 36908, 4146, 36918, 4153, 36950, 4185, 4959, 38674, 5908, 38706, 5940, 38738, 5971, 38770, 6003, 38838, 6099, 6109, 38923, 6157, 6313, 39200, 6443, 39216, 6459, 39344, 6592, 39368, 6601, 39447, 6683, 39680, 6916, 39732, 6980, 39787, 7027, 40384, 7626, 40446, 7679, 41168, 8412, 8417, 41189, 8431, 45098, 12335, 45209, 12442 }; // NOLINT
 static const uint16_t kCombiningMarkTable1Size = 10;
-static const uint16_t kCombiningMarkTable1[10] = { 10242, 10246, 10251, 43043, 10279, 31518, 65024, 32271, 65056, 32291 };
+static const uint16_t kCombiningMarkTable1[10] = { 10242, 10246, 10251, 43043, 10279, 31518, 65024, 32271, 65056, 32291 }; // NOLINT
 static const uint16_t kCombiningMarkTable2Size = 9;
-static const uint16_t kCombiningMarkTable2[9] = { 35329, 2563, 35333, 2566, 35340, 2575, 35384, 2618, 2623 };
+static const uint16_t kCombiningMarkTable2[9] = { 35329, 2563, 35333, 2566, 35340, 2575, 35384, 2618, 2623 }; // NOLINT
 static const uint16_t kCombiningMarkTable3Size = 12;
-static const uint16_t kCombiningMarkTable3[12] = { 53605, 20841, 53613, 20850, 53627, 20866, 53637, 20875, 53674, 20909, 53826, 21060 };
+static const uint16_t kCombiningMarkTable3[12] = { 53605, 20841, 53613, 20850, 53627, 20866, 53637, 20875, 53674, 20909, 53826, 21060 }; // NOLINT
 static const uint16_t kCombiningMarkTable28Size = 2;
-static const uint16_t kCombiningMarkTable28[2] = { 33024, 495 };
+static const uint16_t kCombiningMarkTable28[2] = { 33024, 495 }; // NOLINT
 bool CombiningMark::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -696,9 +696,9 @@
 // ConnectorPunctuation: point.category == 'Pc'
 
 static const uint16_t kConnectorPunctuationTable0Size = 4;
-static const uint16_t kConnectorPunctuationTable0[4] = { 95, 41023, 8256, 8276 };
+static const uint16_t kConnectorPunctuationTable0[4] = { 95, 41023, 8256, 8276 }; // NOLINT
 static const uint16_t kConnectorPunctuationTable1Size = 5;
-static const uint16_t kConnectorPunctuationTable1[5] = { 65075, 32308, 65101, 32335, 32575 };
+static const uint16_t kConnectorPunctuationTable1[5] = { 65075, 32308, 65101, 32335, 32575 }; // NOLINT
 bool ConnectorPunctuation::Is(uchar c) {
   int chunk_index = c >> 15;
   switch (chunk_index) {
@@ -712,15 +712,15 @@
   }
 }
 
-static const MultiCharacterSpecialCase kToLowercaseMultiStrings0[] = { {2, {105, 775}}, {0, {0}} };
+static const MultiCharacterSpecialCase kToLowercaseMultiStrings0[] = { {2, {105, 775}}, {0, {0}} }; // NOLINT
 static const uint16_t kToLowercaseTable0Size = 531;
-static const uint16_t kToLowercaseTable0[1062] = { 32833, 128, 90, 128, 32960, 128, 214, 128, 32984, 128, 222, 128, 256, 4, 258, 4, 260, 4, 262, 4, 264, 4, 266, 4, 268, 4, 270, 4, 272, 4, 274, 4, 276, 4, 278, 4, 280, 4, 282, 4, 284, 4, 286, 4, 288, 4, 290, 4, 292, 4, 294, 4, 296, 4, 298, 4, 300, 4, 302, 4, 304, 1, 306, 4, 308, 4, 310, 4, 313, 4, 315, 4, 317, 4, 319, 4, 321, 4, 323, 4, 325, 4, 327, 4, 330, 4, 332, 4, 334, 4, 336, 4, 338, 4, 340, 4, 342, 4, 344, 4, 346, 4, 348, 4, 350, 4, 352, 4, 354, 4, 356, 4, 358, 4, 360, 4, 362, 4, 364, 4, 366, 4, 368, 4, 370, 4, 372, 4, 374, 4, 376, static_cast<uint16_t>(-484), 377, 4, 379, 4, 381, 4, 385, 840, 386, 4, 388, 4, 390, 824, 391, 4, 33161, 820, 394, 820, 395, 4, 398, 316, 399, 808, 400, 812, 401, 4, 403, 820, 404, 828, 406, 844, 407, 836, 408, 4, 412, 844, 413, 852, 415, 856, 416, 4, 418, 4, 420, 4, 422, 872, 423, 4, 425, 872, 428, 4, 430, 872, 431, 4, 33201, 868, 434, 868, 435, 4, 437, 4, 439, 876, 440, 4, 444, 4, 452, 8, 453, 4, 455, 8, 456, 4, 458, 8, 459, 4, 461, 4, 463, 4, 465, 4, 467, 4, 469, 4, 471, 4, 473, 4, 475, 4, 478, 4, 480, 4, 482, 4, 484, 4, 486, 4, 488, 4, 490, 4, 492, 4, 494, 4, 497, 8, 498, 4, 500, 4, 502, static_cast<uint16_t>(-388), 503, static_cast<uint16_t>(-224), 504, 4, 506, 4, 508, 4, 510, 4, 512, 4, 514, 4, 516, 4, 518, 4, 520, 4, 522, 4, 524, 4, 526, 4, 528, 4, 530, 4, 532, 4, 534, 4, 536, 4, 538, 4, 540, 4, 542, 4, 544, static_cast<uint16_t>(-520), 546, 4, 548, 4, 550, 4, 552, 4, 554, 4, 556, 4, 558, 4, 560, 4, 562, 4, 570, 43180, 571, 4, 573, static_cast<uint16_t>(-652), 574, 43168, 577, 4, 579, static_cast<uint16_t>(-780), 580, 276, 581, 284, 582, 4, 584, 4, 586, 4, 588, 4, 590, 4, 902, 152, 33672, 148, 906, 148, 908, 256, 33678, 252, 911, 252, 33681, 128, 929, 128, 33699, 6, 939, 128, 984, 4, 986, 4, 988, 4, 990, 4, 992, 4, 994, 4, 996, 4, 998, 4, 1000, 4, 1002, 4, 1004, 4, 1006, 4, 1012, static_cast<uint16_t>(-240), 1015, 4, 1017, static_cast<uint16_t>(-28), 1018, 4, 33789, static_cast<uint16_t>(-520), 1023, static_cast<uint16_t>(-520), 33792, 320, 1039, 320, 33808, 128, 1071, 128, 1120, 4, 1122, 4, 1124, 4, 1126, 4, 1128, 4, 1130, 4, 1132, 4, 1134, 4, 1136, 4, 1138, 4, 1140, 4, 1142, 4, 1144, 4, 1146, 4, 1148, 4, 1150, 4, 1152, 4, 1162, 4, 1164, 4, 1166, 4, 1168, 4, 1170, 4, 1172, 4, 1174, 4, 1176, 4, 1178, 4, 1180, 4, 1182, 4, 1184, 4, 1186, 4, 1188, 4, 1190, 4, 1192, 4, 1194, 4, 1196, 4, 1198, 4, 1200, 4, 1202, 4, 1204, 4, 1206, 4, 1208, 4, 1210, 4, 1212, 4, 1214, 4, 1216, 60, 1217, 4, 1219, 4, 1221, 4, 1223, 4, 1225, 4, 1227, 4, 1229, 4, 1232, 4, 1234, 4, 1236, 4, 1238, 4, 1240, 4, 1242, 4, 1244, 4, 1246, 4, 1248, 4, 1250, 4, 1252, 4, 1254, 4, 1256, 4, 1258, 4, 1260, 4, 1262, 4, 1264, 4, 1266, 4, 1268, 4, 1270, 4, 1272, 4, 1274, 4, 1276, 4, 1278, 4, 1280, 4, 1282, 4, 1284, 4, 1286, 4, 1288, 4, 1290, 4, 1292, 4, 1294, 4, 1296, 4, 1298, 4, 34097, 192, 1366, 192, 37024, 29056, 4293, 29056, 7680, 4, 7682, 4, 7684, 4, 7686, 4, 7688, 4, 7690, 4, 7692, 4, 7694, 4, 7696, 4, 7698, 4, 7700, 4, 7702, 4, 7704, 4, 7706, 4, 7708, 4, 7710, 4, 7712, 4, 7714, 4, 7716, 4, 7718, 4, 7720, 4, 7722, 4, 7724, 4, 7726, 4, 7728, 4, 7730, 4, 7732, 4, 7734, 4, 7736, 4, 7738, 4, 7740, 4, 7742, 4, 7744, 4, 7746, 4, 7748, 4, 7750, 4, 7752, 4, 7754, 4, 7756, 4, 7758, 4, 7760, 4, 7762, 4, 7764, 4, 7766, 4, 7768, 4, 7770, 4, 7772, 4, 7774, 4, 7776, 4, 7778, 4, 7780, 4, 7782, 4, 7784, 4, 7786, 4, 7788, 4, 7790, 4, 7792, 4, 7794, 4, 7796, 4, 7798, 4, 7800, 4, 7802, 4, 7804, 4, 7806, 4, 7808, 4, 7810, 4, 7812, 4, 7814, 4, 7816, 4, 7818, 4, 7820, 4, 7822, 4, 7824, 4, 7826, 4, 7828, 4, 7840, 4, 7842, 4, 7844, 4, 7846, 4, 7848, 4, 7850, 4, 7852, 4, 7854, 4, 7856, 4, 7858, 4, 7860, 4, 7862, 4, 7864, 4, 7866, 4, 7868, 4, 7870, 4, 7872, 4, 7874, 4, 7876, 4, 7878, 4, 7880, 4, 7882, 4, 7884, 4, 7886, 4, 7888, 4, 7890, 4, 7892, 4, 7894, 4, 7896, 4, 7898, 4, 7900, 4, 7902, 4, 7904, 4, 7906, 4, 7908, 4, 7910, 4, 7912, 4, 7914, 4, 7916, 4, 7918, 4, 7920, 4, 7922, 4, 7924, 4, 7926, 4, 7928, 4, 40712, static_cast<uint16_t>(-32), 7951, static_cast<uint16_t>(-32), 40728, static_cast<uint16_t>(-32), 7965, static_cast<uint16_t>(-32), 40744, static_cast<uint16_t>(-32), 7983, static_cast<uint16_t>(-32), 40760, static_cast<uint16_t>(-32), 7999, static_cast<uint16_t>(-32), 40776, static_cast<uint16_t>(-32), 8013, static_cast<uint16_t>(-32), 8025, static_cast<uint16_t>(-32), 8027, static_cast<uint16_t>(-32), 8029, static_cast<uint16_t>(-32), 8031, static_cast<uint16_t>(-32), 40808, static_cast<uint16_t>(-32), 8047, static_cast<uint16_t>(-32), 40840, static_cast<uint16_t>(-32), 8079, static_cast<uint16_t>(-32), 40856, static_cast<uint16_t>(-32), 8095, static_cast<uint16_t>(-32), 40872, static_cast<uint16_t>(-32), 8111, static_cast<uint16_t>(-32), 40888, static_cast<uint16_t>(-32), 8121, static_cast<uint16_t>(-32), 40890, static_cast<uint16_t>(-296), 8123, static_cast<uint16_t>(-296), 8124, static_cast<uint16_t>(-36), 40904, static_cast<uint16_t>(-344), 8139, static_cast<uint16_t>(-344), 8140, static_cast<uint16_t>(-36), 40920, static_cast<uint16_t>(-32), 8153, static_cast<uint16_t>(-32), 40922, static_cast<uint16_t>(-400), 8155, static_cast<uint16_t>(-400), 40936, static_cast<uint16_t>(-32), 8169, static_cast<uint16_t>(-32), 40938, static_cast<uint16_t>(-448), 8171, static_cast<uint16_t>(-448), 8172, static_cast<uint16_t>(-28), 40952, static_cast<uint16_t>(-512), 8185, static_cast<uint16_t>(-512), 40954, static_cast<uint16_t>(-504), 8187, static_cast<uint16_t>(-504), 8188, static_cast<uint16_t>(-36), 8486, static_cast<uint16_t>(-30068), 8490, static_cast<uint16_t>(-33532), 8491, static_cast<uint16_t>(-33048), 8498, 112, 41312, 64, 8559, 64, 8579, 4, 42166, 104, 9423, 104, 44032, 192, 11310, 192, 11360, 4, 11362, static_cast<uint16_t>(-42972), 11363, static_cast<uint16_t>(-15256), 11364, static_cast<uint16_t>(-42908), 11367, 4, 11369, 4, 11371, 4, 11381, 4, 11392, 4, 11394, 4, 11396, 4, 11398, 4, 11400, 4, 11402, 4, 11404, 4, 11406, 4, 11408, 4, 11410, 4, 11412, 4, 11414, 4, 11416, 4, 11418, 4, 11420, 4, 11422, 4, 11424, 4, 11426, 4, 11428, 4, 11430, 4, 11432, 4, 11434, 4, 11436, 4, 11438, 4, 11440, 4, 11442, 4, 11444, 4, 11446, 4, 11448, 4, 11450, 4, 11452, 4, 11454, 4, 11456, 4, 11458, 4, 11460, 4, 11462, 4, 11464, 4, 11466, 4, 11468, 4, 11470, 4, 11472, 4, 11474, 4, 11476, 4, 11478, 4, 11480, 4, 11482, 4, 11484, 4, 11486, 4, 11488, 4, 11490, 4 };
-static const MultiCharacterSpecialCase kToLowercaseMultiStrings1[] = { {0, {0}} };
+static const uint16_t kToLowercaseTable0[1062] = { 32833, 128, 90, 128, 32960, 128, 214, 128, 32984, 128, 222, 128, 256, 4, 258, 4, 260, 4, 262, 4, 264, 4, 266, 4, 268, 4, 270, 4, 272, 4, 274, 4, 276, 4, 278, 4, 280, 4, 282, 4, 284, 4, 286, 4, 288, 4, 290, 4, 292, 4, 294, 4, 296, 4, 298, 4, 300, 4, 302, 4, 304, 1, 306, 4, 308, 4, 310, 4, 313, 4, 315, 4, 317, 4, 319, 4, 321, 4, 323, 4, 325, 4, 327, 4, 330, 4, 332, 4, 334, 4, 336, 4, 338, 4, 340, 4, 342, 4, 344, 4, 346, 4, 348, 4, 350, 4, 352, 4, 354, 4, 356, 4, 358, 4, 360, 4, 362, 4, 364, 4, 366, 4, 368, 4, 370, 4, 372, 4, 374, 4, 376, static_cast<uint16_t>(-484), 377, 4, 379, 4, 381, 4, 385, 840, 386, 4, 388, 4, 390, 824, 391, 4, 33161, 820, 394, 820, 395, 4, 398, 316, 399, 808, 400, 812, 401, 4, 403, 820, 404, 828, 406, 844, 407, 836, 408, 4, 412, 844, 413, 852, 415, 856, 416, 4, 418, 4, 420, 4, 422, 872, 423, 4, 425, 872, 428, 4, 430, 872, 431, 4, 33201, 868, 434, 868, 435, 4, 437, 4, 439, 876, 440, 4, 444, 4, 452, 8, 453, 4, 455, 8, 456, 4, 458, 8, 459, 4, 461, 4, 463, 4, 465, 4, 467, 4, 469, 4, 471, 4, 473, 4, 475, 4, 478, 4, 480, 4, 482, 4, 484, 4, 486, 4, 488, 4, 490, 4, 492, 4, 494, 4, 497, 8, 498, 4, 500, 4, 502, static_cast<uint16_t>(-388), 503, static_cast<uint16_t>(-224), 504, 4, 506, 4, 508, 4, 510, 4, 512, 4, 514, 4, 516, 4, 518, 4, 520, 4, 522, 4, 524, 4, 526, 4, 528, 4, 530, 4, 532, 4, 534, 4, 536, 4, 538, 4, 540, 4, 542, 4, 544, static_cast<uint16_t>(-520), 546, 4, 548, 4, 550, 4, 552, 4, 554, 4, 556, 4, 558, 4, 560, 4, 562, 4, 570, 43180, 571, 4, 573, static_cast<uint16_t>(-652), 574, 43168, 577, 4, 579, static_cast<uint16_t>(-780), 580, 276, 581, 284, 582, 4, 584, 4, 586, 4, 588, 4, 590, 4, 902, 152, 33672, 148, 906, 148, 908, 256, 33678, 252, 911, 252, 33681, 128, 929, 128, 33699, 6, 939, 128, 984, 4, 986, 4, 988, 4, 990, 4, 992, 4, 994, 4, 996, 4, 998, 4, 1000, 4, 1002, 4, 1004, 4, 1006, 4, 1012, static_cast<uint16_t>(-240), 1015, 4, 1017, static_cast<uint16_t>(-28), 1018, 4, 33789, static_cast<uint16_t>(-520), 1023, static_cast<uint16_t>(-520), 33792, 320, 1039, 320, 33808, 128, 1071, 128, 1120, 4, 1122, 4, 1124, 4, 1126, 4, 1128, 4, 1130, 4, 1132, 4, 1134, 4, 1136, 4, 1138, 4, 1140, 4, 1142, 4, 1144, 4, 1146, 4, 1148, 4, 1150, 4, 1152, 4, 1162, 4, 1164, 4, 1166, 4, 1168, 4, 1170, 4, 1172, 4, 1174, 4, 1176, 4, 1178, 4, 1180, 4, 1182, 4, 1184, 4, 1186, 4, 1188, 4, 1190, 4, 1192, 4, 1194, 4, 1196, 4, 1198, 4, 1200, 4, 1202, 4, 1204, 4, 1206, 4, 1208, 4, 1210, 4, 1212, 4, 1214, 4, 1216, 60, 1217, 4, 1219, 4, 1221, 4, 1223, 4, 1225, 4, 1227, 4, 1229, 4, 1232, 4, 1234, 4, 1236, 4, 1238, 4, 1240, 4, 1242, 4, 1244, 4, 1246, 4, 1248, 4, 1250, 4, 1252, 4, 1254, 4, 1256, 4, 1258, 4, 1260, 4, 1262, 4, 1264, 4, 1266, 4, 1268, 4, 1270, 4, 1272, 4, 1274, 4, 1276, 4, 1278, 4, 1280, 4, 1282, 4, 1284, 4, 1286, 4, 1288, 4, 1290, 4, 1292, 4, 1294, 4, 1296, 4, 1298, 4, 34097, 192, 1366, 192, 37024, 29056, 4293, 29056, 7680, 4, 7682, 4, 7684, 4, 7686, 4, 7688, 4, 7690, 4, 7692, 4, 7694, 4, 7696, 4, 7698, 4, 7700, 4, 7702, 4, 7704, 4, 7706, 4, 7708, 4, 7710, 4, 7712, 4, 7714, 4, 7716, 4, 7718, 4, 7720, 4, 7722, 4, 7724, 4, 7726, 4, 7728, 4, 7730, 4, 7732, 4, 7734, 4, 7736, 4, 7738, 4, 7740, 4, 7742, 4, 7744, 4, 7746, 4, 7748, 4, 7750, 4, 7752, 4, 7754, 4, 7756, 4, 7758, 4, 7760, 4, 7762, 4, 7764, 4, 7766, 4, 7768, 4, 7770, 4, 7772, 4, 7774, 4, 7776, 4, 7778, 4, 7780, 4, 7782, 4, 7784, 4, 7786, 4, 7788, 4, 7790, 4, 7792, 4, 7794, 4, 7796, 4, 7798, 4, 7800, 4, 7802, 4, 7804, 4, 7806, 4, 7808, 4, 7810, 4, 7812, 4, 7814, 4, 7816, 4, 7818, 4, 7820, 4, 7822, 4, 7824, 4, 7826, 4, 7828, 4, 7840, 4, 7842, 4, 7844, 4, 7846, 4, 7848, 4, 7850, 4, 7852, 4, 7854, 4, 7856, 4, 7858, 4, 7860, 4, 7862, 4, 7864, 4, 7866, 4, 7868, 4, 7870, 4, 7872, 4, 7874, 4, 7876, 4, 7878, 4, 7880, 4, 7882, 4, 7884, 4, 7886, 4, 7888, 4, 7890, 4, 7892, 4, 7894, 4, 7896, 4, 7898, 4, 7900, 4, 7902, 4, 7904, 4, 7906, 4, 7908, 4, 7910, 4, 7912, 4, 7914, 4, 7916, 4, 7918, 4, 7920, 4, 7922, 4, 7924, 4, 7926, 4, 7928, 4, 40712, static_cast<uint16_t>(-32), 7951, static_cast<uint16_t>(-32), 40728, static_cast<uint16_t>(-32), 7965, static_cast<uint16_t>(-32), 40744, static_cast<uint16_t>(-32), 7983, static_cast<uint16_t>(-32), 40760, static_cast<uint16_t>(-32), 7999, static_cast<uint16_t>(-32), 40776, static_cast<uint16_t>(-32), 8013, static_cast<uint16_t>(-32), 8025, static_cast<uint16_t>(-32), 8027, static_cast<uint16_t>(-32), 8029, static_cast<uint16_t>(-32), 8031, static_cast<uint16_t>(-32), 40808, static_cast<uint16_t>(-32), 8047, static_cast<uint16_t>(-32), 40840, static_cast<uint16_t>(-32), 8079, static_cast<uint16_t>(-32), 40856, static_cast<uint16_t>(-32), 8095, static_cast<uint16_t>(-32), 40872, static_cast<uint16_t>(-32), 8111, static_cast<uint16_t>(-32), 40888, static_cast<uint16_t>(-32), 8121, static_cast<uint16_t>(-32), 40890, static_cast<uint16_t>(-296), 8123, static_cast<uint16_t>(-296), 8124, static_cast<uint16_t>(-36), 40904, static_cast<uint16_t>(-344), 8139, static_cast<uint16_t>(-344), 8140, static_cast<uint16_t>(-36), 40920, static_cast<uint16_t>(-32), 8153, static_cast<uint16_t>(-32), 40922, static_cast<uint16_t>(-400), 8155, static_cast<uint16_t>(-400), 40936, static_cast<uint16_t>(-32), 8169, static_cast<uint16_t>(-32), 40938, static_cast<uint16_t>(-448), 8171, static_cast<uint16_t>(-448), 8172, static_cast<uint16_t>(-28), 40952, static_cast<uint16_t>(-512), 8185, static_cast<uint16_t>(-512), 40954, static_cast<uint16_t>(-504), 8187, static_cast<uint16_t>(-504), 8188, static_cast<uint16_t>(-36), 8486, static_cast<uint16_t>(-30068), 8490, static_cast<uint16_t>(-33532), 8491, static_cast<uint16_t>(-33048), 8498, 112, 41312, 64, 8559, 64, 8579, 4, 42166, 104, 9423, 104, 44032, 192, 11310, 192, 11360, 4, 11362, static_cast<uint16_t>(-42972), 11363, static_cast<uint16_t>(-15256), 11364, static_cast<uint16_t>(-42908), 11367, 4, 11369, 4, 11371, 4, 11381, 4, 11392, 4, 11394, 4, 11396, 4, 11398, 4, 11400, 4, 11402, 4, 11404, 4, 11406, 4, 11408, 4, 11410, 4, 11412, 4, 11414, 4, 11416, 4, 11418, 4, 11420, 4, 11422, 4, 11424, 4, 11426, 4, 11428, 4, 11430, 4, 11432, 4, 11434, 4, 11436, 4, 11438, 4, 11440, 4, 11442, 4, 11444, 4, 11446, 4, 11448, 4, 11450, 4, 11452, 4, 11454, 4, 11456, 4, 11458, 4, 11460, 4, 11462, 4, 11464, 4, 11466, 4, 11468, 4, 11470, 4, 11472, 4, 11474, 4, 11476, 4, 11478, 4, 11480, 4, 11482, 4, 11484, 4, 11486, 4, 11488, 4, 11490, 4 }; // NOLINT
+static const MultiCharacterSpecialCase kToLowercaseMultiStrings1[] = { {0, {0}} }; // NOLINT
 static const uint16_t kToLowercaseTable1Size = 2;
-static const uint16_t kToLowercaseTable1[4] = { 65313, 128, 32570, 128 };
-static const MultiCharacterSpecialCase kToLowercaseMultiStrings2[] = { {0, {0}} };
+static const uint16_t kToLowercaseTable1[4] = { 65313, 128, 32570, 128 }; // NOLINT
+static const MultiCharacterSpecialCase kToLowercaseMultiStrings2[] = { {0, {0}} }; // NOLINT
 static const uint16_t kToLowercaseTable2Size = 2;
-static const uint16_t kToLowercaseTable2[4] = { 33792, 160, 1063, 160 };
+static const uint16_t kToLowercaseTable2[4] = { 33792, 160, 1063, 160 }; // NOLINT
 int ToLowercase::Convert(uchar c,
                       uchar n,
                       uchar* result,
@@ -752,15 +752,15 @@
   }
 }
 
-static const MultiCharacterSpecialCase kToUppercaseMultiStrings0[] = { {2, {83, 83}}, {2, {700, 78}}, {2, {74, 780}}, {3, {921, 776, 769}}, {3, {933, 776, 769}}, {2, {1333, 1362}}, {2, {72, 817}}, {2, {84, 776}}, {2, {87, 778}}, {2, {89, 778}}, {2, {65, 702}}, {2, {933, 787}}, {3, {933, 787, 768}}, {3, {933, 787, 769}}, {3, {933, 787, 834}}, {2, {7944, 921}}, {2, {7945, 921}}, {2, {7946, 921}}, {2, {7947, 921}}, {2, {7948, 921}}, {2, {7949, 921}}, {2, {7950, 921}}, {2, {7951, 921}}, {2, {7944, 921}}, {2, {7945, 921}}, {2, {7946, 921}}, {2, {7947, 921}}, {2, {7948, 921}}, {2, {7949, 921}}, {2, {7950, 921}}, {2, {7951, 921}}, {2, {7976, 921}}, {2, {7977, 921}}, {2, {7978, 921}}, {2, {7979, 921}}, {2, {7980, 921}}, {2, {7981, 921}}, {2, {7982, 921}}, {2, {7983, 921}}, {2, {7976, 921}}, {2, {7977, 921}}, {2, {7978, 921}}, {2, {7979, 921}}, {2, {7980, 921}}, {2, {7981, 921}}, {2, {7982, 921}}, {2, {7983, 921}}, {2, {8040, 921}}, {2, {8041, 921}}, {2, {8042, 921}}, {2, {8043, 921}}, {2, {8044, 921}}, {2, {8045, 921}}, {2, {8046, 921}}, {2, {8047, 921}}, {2, {8040, 921}}, {2, {8041, 921}}, {2, {8042, 921}}, {2, {8043, 921}}, {2, {8044, 921}}, {2, {8045, 921}}, {2, {8046, 921}}, {2, {8047, 921}}, {2, {8122, 921}}, {2, {913, 921}}, {2, {902, 921}}, {2, {913, 834}}, {3, {913, 834, 921}}, {2, {913, 921}}, {2, {8138, 921}}, {2, {919, 921}}, {2, {905, 921}}, {2, {919, 834}}, {3, {919, 834, 921}}, {2, {919, 921}}, {3, {921, 776, 768}}, {3, {921, 776, 769}}, {2, {921, 834}}, {3, {921, 776, 834}}, {3, {933, 776, 768}}, {3, {933, 776, 769}}, {2, {929, 787}}, {2, {933, 834}}, {3, {933, 776, 834}}, {2, {8186, 921}}, {2, {937, 921}}, {2, {911, 921}}, {2, {937, 834}}, {3, {937, 834, 921}}, {2, {937, 921}}, {0, {0}} };
+static const MultiCharacterSpecialCase kToUppercaseMultiStrings0[] = { {2, {83, 83}}, {2, {700, 78}}, {2, {74, 780}}, {3, {921, 776, 769}}, {3, {933, 776, 769}}, {2, {1333, 1362}}, {2, {72, 817}}, {2, {84, 776}}, {2, {87, 778}}, {2, {89, 778}}, {2, {65, 702}}, {2, {933, 787}}, {3, {933, 787, 768}}, {3, {933, 787, 769}}, {3, {933, 787, 834}}, {2, {7944, 921}}, {2, {7945, 921}}, {2, {7946, 921}}, {2, {7947, 921}}, {2, {7948, 921}}, {2, {7949, 921}}, {2, {7950, 921}}, {2, {7951, 921}}, {2, {7944, 921}}, {2, {7945, 921}}, {2, {7946, 921}}, {2, {7947, 921}}, {2, {7948, 921}}, {2, {7949, 921}}, {2, {7950, 921}}, {2, {7951, 921}}, {2, {7976, 921}}, {2, {7977, 921}}, {2, {7978, 921}}, {2, {7979, 921}}, {2, {7980, 921}}, {2, {7981, 921}}, {2, {7982, 921}}, {2, {7983, 921}}, {2, {7976, 921}}, {2, {7977, 921}}, {2, {7978, 921}}, {2, {7979, 921}}, {2, {7980, 921}}, {2, {7981, 921}}, {2, {7982, 921}}, {2, {7983, 921}}, {2, {8040, 921}}, {2, {8041, 921}}, {2, {8042, 921}}, {2, {8043, 921}}, {2, {8044, 921}}, {2, {8045, 921}}, {2, {8046, 921}}, {2, {8047, 921}}, {2, {8040, 921}}, {2, {8041, 921}}, {2, {8042, 921}}, {2, {8043, 921}}, {2, {8044, 921}}, {2, {8045, 921}}, {2, {8046, 921}}, {2, {8047, 921}}, {2, {8122, 921}}, {2, {913, 921}}, {2, {902, 921}}, {2, {913, 834}}, {3, {913, 834, 921}}, {2, {913, 921}}, {2, {8138, 921}}, {2, {919, 921}}, {2, {905, 921}}, {2, {919, 834}}, {3, {919, 834, 921}}, {2, {919, 921}}, {3, {921, 776, 768}}, {3, {921, 776, 769}}, {2, {921, 834}}, {3, {921, 776, 834}}, {3, {933, 776, 768}}, {3, {933, 776, 769}}, {2, {929, 787}}, {2, {933, 834}}, {3, {933, 776, 834}}, {2, {8186, 921}}, {2, {937, 921}}, {2, {911, 921}}, {2, {937, 834}}, {3, {937, 834, 921}}, {2, {937, 921}}, {0, {0}} }; // NOLINT
 static const uint16_t kToUppercaseTable0Size = 621;
-static const uint16_t kToUppercaseTable0[1242] = { 32865, static_cast<uint16_t>(-128), 122, static_cast<uint16_t>(-128), 181, 2972, 223, 1, 32992, static_cast<uint16_t>(-128), 246, static_cast<uint16_t>(-128), 33016, static_cast<uint16_t>(-128), 254, static_cast<uint16_t>(-128), 255, 484, 257, static_cast<uint16_t>(-4), 259, static_cast<uint16_t>(-4), 261, static_cast<uint16_t>(-4), 263, static_cast<uint16_t>(-4), 265, static_cast<uint16_t>(-4), 267, static_cast<uint16_t>(-4), 269, static_cast<uint16_t>(-4), 271, static_cast<uint16_t>(-4), 273, static_cast<uint16_t>(-4), 275, static_cast<uint16_t>(-4), 277, static_cast<uint16_t>(-4), 279, static_cast<uint16_t>(-4), 281, static_cast<uint16_t>(-4), 283, static_cast<uint16_t>(-4), 285, static_cast<uint16_t>(-4), 287, static_cast<uint16_t>(-4), 289, static_cast<uint16_t>(-4), 291, static_cast<uint16_t>(-4), 293, static_cast<uint16_t>(-4), 295, static_cast<uint16_t>(-4), 297, static_cast<uint16_t>(-4), 299, static_cast<uint16_t>(-4), 301, static_cast<uint16_t>(-4), 303, static_cast<uint16_t>(-4), 305, static_cast<uint16_t>(-928), 307, static_cast<uint16_t>(-4), 309, static_cast<uint16_t>(-4), 311, static_cast<uint16_t>(-4), 314, static_cast<uint16_t>(-4), 316, static_cast<uint16_t>(-4), 318, static_cast<uint16_t>(-4), 320, static_cast<uint16_t>(-4), 322, static_cast<uint16_t>(-4), 324, static_cast<uint16_t>(-4), 326, static_cast<uint16_t>(-4), 328, static_cast<uint16_t>(-4), 329, 5, 331, static_cast<uint16_t>(-4), 333, static_cast<uint16_t>(-4), 335, static_cast<uint16_t>(-4), 337, static_cast<uint16_t>(-4), 339, static_cast<uint16_t>(-4), 341, static_cast<uint16_t>(-4), 343, static_cast<uint16_t>(-4), 345, static_cast<uint16_t>(-4), 347, static_cast<uint16_t>(-4), 349, static_cast<uint16_t>(-4), 351, static_cast<uint16_t>(-4), 353, static_cast<uint16_t>(-4), 355, static_cast<uint16_t>(-4), 357, static_cast<uint16_t>(-4), 359, static_cast<uint16_t>(-4), 361, static_cast<uint16_t>(-4), 363, static_cast<uint16_t>(-4), 365, static_cast<uint16_t>(-4), 367, static_cast<uint16_t>(-4), 369, static_cast<uint16_t>(-4), 371, static_cast<uint16_t>(-4), 373, static_cast<uint16_t>(-4), 375, static_cast<uint16_t>(-4), 378, static_cast<uint16_t>(-4), 380, static_cast<uint16_t>(-4), 382, static_cast<uint16_t>(-4), 383, static_cast<uint16_t>(-1200), 384, 780, 387, static_cast<uint16_t>(-4), 389, static_cast<uint16_t>(-4), 392, static_cast<uint16_t>(-4), 396, static_cast<uint16_t>(-4), 402, static_cast<uint16_t>(-4), 405, 388, 409, static_cast<uint16_t>(-4), 410, 652, 414, 520, 417, static_cast<uint16_t>(-4), 419, static_cast<uint16_t>(-4), 421, static_cast<uint16_t>(-4), 424, static_cast<uint16_t>(-4), 429, static_cast<uint16_t>(-4), 432, static_cast<uint16_t>(-4), 436, static_cast<uint16_t>(-4), 438, static_cast<uint16_t>(-4), 441, static_cast<uint16_t>(-4), 445, static_cast<uint16_t>(-4), 447, 224, 453, static_cast<uint16_t>(-4), 454, static_cast<uint16_t>(-8), 456, static_cast<uint16_t>(-4), 457, static_cast<uint16_t>(-8), 459, static_cast<uint16_t>(-4), 460, static_cast<uint16_t>(-8), 462, static_cast<uint16_t>(-4), 464, static_cast<uint16_t>(-4), 466, static_cast<uint16_t>(-4), 468, static_cast<uint16_t>(-4), 470, static_cast<uint16_t>(-4), 472, static_cast<uint16_t>(-4), 474, static_cast<uint16_t>(-4), 476, static_cast<uint16_t>(-4), 477, static_cast<uint16_t>(-316), 479, static_cast<uint16_t>(-4), 481, static_cast<uint16_t>(-4), 483, static_cast<uint16_t>(-4), 485, static_cast<uint16_t>(-4), 487, static_cast<uint16_t>(-4), 489, static_cast<uint16_t>(-4), 491, static_cast<uint16_t>(-4), 493, static_cast<uint16_t>(-4), 495, static_cast<uint16_t>(-4), 496, 9, 498, static_cast<uint16_t>(-4), 499, static_cast<uint16_t>(-8), 501, static_cast<uint16_t>(-4), 505, static_cast<uint16_t>(-4), 507, static_cast<uint16_t>(-4), 509, static_cast<uint16_t>(-4), 511, static_cast<uint16_t>(-4), 513, static_cast<uint16_t>(-4), 515, static_cast<uint16_t>(-4), 517, static_cast<uint16_t>(-4), 519, static_cast<uint16_t>(-4), 521, static_cast<uint16_t>(-4), 523, static_cast<uint16_t>(-4), 525, static_cast<uint16_t>(-4), 527, static_cast<uint16_t>(-4), 529, static_cast<uint16_t>(-4), 531, static_cast<uint16_t>(-4), 533, static_cast<uint16_t>(-4), 535, static_cast<uint16_t>(-4), 537, static_cast<uint16_t>(-4), 539, static_cast<uint16_t>(-4), 541, static_cast<uint16_t>(-4), 543, static_cast<uint16_t>(-4), 547, static_cast<uint16_t>(-4), 549, static_cast<uint16_t>(-4), 551, static_cast<uint16_t>(-4), 553, static_cast<uint16_t>(-4), 555, static_cast<uint16_t>(-4), 557, static_cast<uint16_t>(-4), 559, static_cast<uint16_t>(-4), 561, static_cast<uint16_t>(-4), 563, static_cast<uint16_t>(-4), 572, static_cast<uint16_t>(-4), 578, static_cast<uint16_t>(-4), 583, static_cast<uint16_t>(-4), 585, static_cast<uint16_t>(-4), 587, static_cast<uint16_t>(-4), 589, static_cast<uint16_t>(-4), 591, static_cast<uint16_t>(-4), 595, static_cast<uint16_t>(-840), 596, static_cast<uint16_t>(-824), 33366, static_cast<uint16_t>(-820), 599, static_cast<uint16_t>(-820), 601, static_cast<uint16_t>(-808), 603, static_cast<uint16_t>(-812), 608, static_cast<uint16_t>(-820), 611, static_cast<uint16_t>(-828), 616, static_cast<uint16_t>(-836), 617, static_cast<uint16_t>(-844), 619, 42972, 623, static_cast<uint16_t>(-844), 626, static_cast<uint16_t>(-852), 629, static_cast<uint16_t>(-856), 637, 42908, 640, static_cast<uint16_t>(-872), 643, static_cast<uint16_t>(-872), 648, static_cast<uint16_t>(-872), 649, static_cast<uint16_t>(-276), 33418, static_cast<uint16_t>(-868), 651, static_cast<uint16_t>(-868), 652, static_cast<uint16_t>(-284), 658, static_cast<uint16_t>(-876), 837, 336, 33659, 520, 893, 520, 912, 13, 940, static_cast<uint16_t>(-152), 33709, static_cast<uint16_t>(-148), 943, static_cast<uint16_t>(-148), 944, 17, 33713, static_cast<uint16_t>(-128), 961, static_cast<uint16_t>(-128), 962, static_cast<uint16_t>(-124), 33731, static_cast<uint16_t>(-128), 971, static_cast<uint16_t>(-128), 972, static_cast<uint16_t>(-256), 33741, static_cast<uint16_t>(-252), 974, static_cast<uint16_t>(-252), 976, static_cast<uint16_t>(-248), 977, static_cast<uint16_t>(-228), 981, static_cast<uint16_t>(-188), 982, static_cast<uint16_t>(-216), 985, static_cast<uint16_t>(-4), 987, static_cast<uint16_t>(-4), 989, static_cast<uint16_t>(-4), 991, static_cast<uint16_t>(-4), 993, static_cast<uint16_t>(-4), 995, static_cast<uint16_t>(-4), 997, static_cast<uint16_t>(-4), 999, static_cast<uint16_t>(-4), 1001, static_cast<uint16_t>(-4), 1003, static_cast<uint16_t>(-4), 1005, static_cast<uint16_t>(-4), 1007, static_cast<uint16_t>(-4), 1008, static_cast<uint16_t>(-344), 1009, static_cast<uint16_t>(-320), 1010, 28, 1013, static_cast<uint16_t>(-384), 1016, static_cast<uint16_t>(-4), 1019, static_cast<uint16_t>(-4), 33840, static_cast<uint16_t>(-128), 1103, static_cast<uint16_t>(-128), 33872, static_cast<uint16_t>(-320), 1119, static_cast<uint16_t>(-320), 1121, static_cast<uint16_t>(-4), 1123, static_cast<uint16_t>(-4), 1125, static_cast<uint16_t>(-4), 1127, static_cast<uint16_t>(-4), 1129, static_cast<uint16_t>(-4), 1131, static_cast<uint16_t>(-4), 1133, static_cast<uint16_t>(-4), 1135, static_cast<uint16_t>(-4), 1137, static_cast<uint16_t>(-4), 1139, static_cast<uint16_t>(-4), 1141, static_cast<uint16_t>(-4), 1143, static_cast<uint16_t>(-4), 1145, static_cast<uint16_t>(-4), 1147, static_cast<uint16_t>(-4), 1149, static_cast<uint16_t>(-4), 1151, static_cast<uint16_t>(-4), 1153, static_cast<uint16_t>(-4), 1163, static_cast<uint16_t>(-4), 1165, static_cast<uint16_t>(-4), 1167, static_cast<uint16_t>(-4), 1169, static_cast<uint16_t>(-4), 1171, static_cast<uint16_t>(-4), 1173, static_cast<uint16_t>(-4), 1175, static_cast<uint16_t>(-4), 1177, static_cast<uint16_t>(-4), 1179, static_cast<uint16_t>(-4), 1181, static_cast<uint16_t>(-4), 1183, static_cast<uint16_t>(-4), 1185, static_cast<uint16_t>(-4), 1187, static_cast<uint16_t>(-4), 1189, static_cast<uint16_t>(-4), 1191, static_cast<uint16_t>(-4), 1193, static_cast<uint16_t>(-4), 1195, static_cast<uint16_t>(-4), 1197, static_cast<uint16_t>(-4), 1199, static_cast<uint16_t>(-4), 1201, static_cast<uint16_t>(-4), 1203, static_cast<uint16_t>(-4), 1205, static_cast<uint16_t>(-4), 1207, static_cast<uint16_t>(-4), 1209, static_cast<uint16_t>(-4), 1211, static_cast<uint16_t>(-4), 1213, static_cast<uint16_t>(-4), 1215, static_cast<uint16_t>(-4), 1218, static_cast<uint16_t>(-4), 1220, static_cast<uint16_t>(-4), 1222, static_cast<uint16_t>(-4), 1224, static_cast<uint16_t>(-4), 1226, static_cast<uint16_t>(-4), 1228, static_cast<uint16_t>(-4), 1230, static_cast<uint16_t>(-4), 1231, static_cast<uint16_t>(-60), 1233, static_cast<uint16_t>(-4), 1235, static_cast<uint16_t>(-4), 1237, static_cast<uint16_t>(-4), 1239, static_cast<uint16_t>(-4), 1241, static_cast<uint16_t>(-4), 1243, static_cast<uint16_t>(-4), 1245, static_cast<uint16_t>(-4), 1247, static_cast<uint16_t>(-4), 1249, static_cast<uint16_t>(-4), 1251, static_cast<uint16_t>(-4), 1253, static_cast<uint16_t>(-4), 1255, static_cast<uint16_t>(-4), 1257, static_cast<uint16_t>(-4), 1259, static_cast<uint16_t>(-4), 1261, static_cast<uint16_t>(-4), 1263, static_cast<uint16_t>(-4), 1265, static_cast<uint16_t>(-4), 1267, static_cast<uint16_t>(-4), 1269, static_cast<uint16_t>(-4), 1271, static_cast<uint16_t>(-4), 1273, static_cast<uint16_t>(-4), 1275, static_cast<uint16_t>(-4), 1277, static_cast<uint16_t>(-4), 1279, static_cast<uint16_t>(-4), 1281, static_cast<uint16_t>(-4), 1283, static_cast<uint16_t>(-4), 1285, static_cast<uint16_t>(-4), 1287, static_cast<uint16_t>(-4), 1289, static_cast<uint16_t>(-4), 1291, static_cast<uint16_t>(-4), 1293, static_cast<uint16_t>(-4), 1295, static_cast<uint16_t>(-4), 1297, static_cast<uint16_t>(-4), 1299, static_cast<uint16_t>(-4), 34145, static_cast<uint16_t>(-192), 1414, static_cast<uint16_t>(-192), 1415, 21, 7549, 15256, 7681, static_cast<uint16_t>(-4), 7683, static_cast<uint16_t>(-4), 7685, static_cast<uint16_t>(-4), 7687, static_cast<uint16_t>(-4), 7689, static_cast<uint16_t>(-4), 7691, static_cast<uint16_t>(-4), 7693, static_cast<uint16_t>(-4), 7695, static_cast<uint16_t>(-4), 7697, static_cast<uint16_t>(-4), 7699, static_cast<uint16_t>(-4), 7701, static_cast<uint16_t>(-4), 7703, static_cast<uint16_t>(-4), 7705, static_cast<uint16_t>(-4), 7707, static_cast<uint16_t>(-4), 7709, static_cast<uint16_t>(-4), 7711, static_cast<uint16_t>(-4), 7713, static_cast<uint16_t>(-4), 7715, static_cast<uint16_t>(-4), 7717, static_cast<uint16_t>(-4), 7719, static_cast<uint16_t>(-4), 7721, static_cast<uint16_t>(-4), 7723, static_cast<uint16_t>(-4), 7725, static_cast<uint16_t>(-4), 7727, static_cast<uint16_t>(-4), 7729, static_cast<uint16_t>(-4), 7731, static_cast<uint16_t>(-4), 7733, static_cast<uint16_t>(-4), 7735, static_cast<uint16_t>(-4), 7737, static_cast<uint16_t>(-4), 7739, static_cast<uint16_t>(-4), 7741, static_cast<uint16_t>(-4), 7743, static_cast<uint16_t>(-4), 7745, static_cast<uint16_t>(-4), 7747, static_cast<uint16_t>(-4), 7749, static_cast<uint16_t>(-4), 7751, static_cast<uint16_t>(-4), 7753, static_cast<uint16_t>(-4), 7755, static_cast<uint16_t>(-4), 7757, static_cast<uint16_t>(-4), 7759, static_cast<uint16_t>(-4), 7761, static_cast<uint16_t>(-4), 7763, static_cast<uint16_t>(-4), 7765, static_cast<uint16_t>(-4), 7767, static_cast<uint16_t>(-4), 7769, static_cast<uint16_t>(-4), 7771, static_cast<uint16_t>(-4), 7773, static_cast<uint16_t>(-4), 7775, static_cast<uint16_t>(-4), 7777, static_cast<uint16_t>(-4), 7779, static_cast<uint16_t>(-4), 7781, static_cast<uint16_t>(-4), 7783, static_cast<uint16_t>(-4), 7785, static_cast<uint16_t>(-4), 7787, static_cast<uint16_t>(-4), 7789, static_cast<uint16_t>(-4), 7791, static_cast<uint16_t>(-4), 7793, static_cast<uint16_t>(-4), 7795, static_cast<uint16_t>(-4), 7797, static_cast<uint16_t>(-4), 7799, static_cast<uint16_t>(-4), 7801, static_cast<uint16_t>(-4), 7803, static_cast<uint16_t>(-4), 7805, static_cast<uint16_t>(-4), 7807, static_cast<uint16_t>(-4), 7809, static_cast<uint16_t>(-4), 7811, static_cast<uint16_t>(-4), 7813, static_cast<uint16_t>(-4), 7815, static_cast<uint16_t>(-4), 7817, static_cast<uint16_t>(-4), 7819, static_cast<uint16_t>(-4), 7821, static_cast<uint16_t>(-4), 7823, static_cast<uint16_t>(-4), 7825, static_cast<uint16_t>(-4), 7827, static_cast<uint16_t>(-4), 7829, static_cast<uint16_t>(-4), 7830, 25, 7831, 29, 7832, 33, 7833, 37, 7834, 41, 7835, static_cast<uint16_t>(-236), 7841, static_cast<uint16_t>(-4), 7843, static_cast<uint16_t>(-4), 7845, static_cast<uint16_t>(-4), 7847, static_cast<uint16_t>(-4), 7849, static_cast<uint16_t>(-4), 7851, static_cast<uint16_t>(-4), 7853, static_cast<uint16_t>(-4), 7855, static_cast<uint16_t>(-4), 7857, static_cast<uint16_t>(-4), 7859, static_cast<uint16_t>(-4), 7861, static_cast<uint16_t>(-4), 7863, static_cast<uint16_t>(-4), 7865, static_cast<uint16_t>(-4), 7867, static_cast<uint16_t>(-4), 7869, static_cast<uint16_t>(-4), 7871, static_cast<uint16_t>(-4), 7873, static_cast<uint16_t>(-4), 7875, static_cast<uint16_t>(-4), 7877, static_cast<uint16_t>(-4), 7879, static_cast<uint16_t>(-4), 7881, static_cast<uint16_t>(-4), 7883, static_cast<uint16_t>(-4), 7885, static_cast<uint16_t>(-4), 7887, static_cast<uint16_t>(-4), 7889, static_cast<uint16_t>(-4), 7891, static_cast<uint16_t>(-4), 7893, static_cast<uint16_t>(-4), 7895, static_cast<uint16_t>(-4), 7897, static_cast<uint16_t>(-4), 7899, static_cast<uint16_t>(-4), 7901, static_cast<uint16_t>(-4), 7903, static_cast<uint16_t>(-4), 7905, static_cast<uint16_t>(-4), 7907, static_cast<uint16_t>(-4), 7909, static_cast<uint16_t>(-4), 7911, static_cast<uint16_t>(-4), 7913, static_cast<uint16_t>(-4), 7915, static_cast<uint16_t>(-4), 7917, static_cast<uint16_t>(-4), 7919, static_cast<uint16_t>(-4), 7921, static_cast<uint16_t>(-4), 7923, static_cast<uint16_t>(-4), 7925, static_cast<uint16_t>(-4), 7927, static_cast<uint16_t>(-4), 7929, static_cast<uint16_t>(-4), 40704, 32, 7943, 32, 40720, 32, 7957, 32, 40736, 32, 7975, 32, 40752, 32, 7991, 32, 40768, 32, 8005, 32, 8016, 45, 8017, 32, 8018, 49, 8019, 32, 8020, 53, 8021, 32, 8022, 57, 8023, 32, 40800, 32, 8039, 32, 40816, 296, 8049, 296, 40818, 344, 8053, 344, 40822, 400, 8055, 400, 40824, 512, 8057, 512, 40826, 448, 8059, 448, 40828, 504, 8061, 504, 8064, 61, 8065, 65, 8066, 69, 8067, 73, 8068, 77, 8069, 81, 8070, 85, 8071, 89, 8072, 93, 8073, 97, 8074, 101, 8075, 105, 8076, 109, 8077, 113, 8078, 117, 8079, 121, 8080, 125, 8081, 129, 8082, 133, 8083, 137, 8084, 141, 8085, 145, 8086, 149, 8087, 153, 8088, 157, 8089, 161, 8090, 165, 8091, 169, 8092, 173, 8093, 177, 8094, 181, 8095, 185, 8096, 189, 8097, 193, 8098, 197, 8099, 201, 8100, 205, 8101, 209, 8102, 213, 8103, 217, 8104, 221, 8105, 225, 8106, 229, 8107, 233, 8108, 237, 8109, 241, 8110, 245, 8111, 249, 40880, 32, 8113, 32, 8114, 253, 8115, 257, 8116, 261, 8118, 265, 8119, 269, 8124, 273, 8126, static_cast<uint16_t>(-28820), 8130, 277, 8131, 281, 8132, 285, 8134, 289, 8135, 293, 8140, 297, 40912, 32, 8145, 32, 8146, 301, 8147, 305, 8150, 309, 8151, 313, 40928, 32, 8161, 32, 8162, 317, 8163, 321, 8164, 325, 8165, 28, 8166, 329, 8167, 333, 8178, 337, 8179, 341, 8180, 345, 8182, 349, 8183, 353, 8188, 357, 8526, static_cast<uint16_t>(-112), 41328, static_cast<uint16_t>(-64), 8575, static_cast<uint16_t>(-64), 8580, static_cast<uint16_t>(-4), 42192, static_cast<uint16_t>(-104), 9449, static_cast<uint16_t>(-104), 44080, static_cast<uint16_t>(-192), 11358, static_cast<uint16_t>(-192), 11361, static_cast<uint16_t>(-4), 11365, static_cast<uint16_t>(-43180), 11366, static_cast<uint16_t>(-43168), 11368, static_cast<uint16_t>(-4), 11370, static_cast<uint16_t>(-4), 11372, static_cast<uint16_t>(-4), 11382, static_cast<uint16_t>(-4), 11393, static_cast<uint16_t>(-4), 11395, static_cast<uint16_t>(-4), 11397, static_cast<uint16_t>(-4), 11399, static_cast<uint16_t>(-4), 11401, static_cast<uint16_t>(-4), 11403, static_cast<uint16_t>(-4), 11405, static_cast<uint16_t>(-4), 11407, static_cast<uint16_t>(-4), 11409, static_cast<uint16_t>(-4), 11411, static_cast<uint16_t>(-4), 11413, static_cast<uint16_t>(-4), 11415, static_cast<uint16_t>(-4), 11417, static_cast<uint16_t>(-4), 11419, static_cast<uint16_t>(-4), 11421, static_cast<uint16_t>(-4), 11423, static_cast<uint16_t>(-4), 11425, static_cast<uint16_t>(-4), 11427, static_cast<uint16_t>(-4), 11429, static_cast<uint16_t>(-4), 11431, static_cast<uint16_t>(-4), 11433, static_cast<uint16_t>(-4), 11435, static_cast<uint16_t>(-4), 11437, static_cast<uint16_t>(-4), 11439, static_cast<uint16_t>(-4), 11441, static_cast<uint16_t>(-4), 11443, static_cast<uint16_t>(-4), 11445, static_cast<uint16_t>(-4), 11447, static_cast<uint16_t>(-4), 11449, static_cast<uint16_t>(-4), 11451, static_cast<uint16_t>(-4), 11453, static_cast<uint16_t>(-4), 11455, static_cast<uint16_t>(-4), 11457, static_cast<uint16_t>(-4), 11459, static_cast<uint16_t>(-4), 11461, static_cast<uint16_t>(-4), 11463, static_cast<uint16_t>(-4), 11465, static_cast<uint16_t>(-4), 11467, static_cast<uint16_t>(-4), 11469, static_cast<uint16_t>(-4), 11471, static_cast<uint16_t>(-4), 11473, static_cast<uint16_t>(-4), 11475, static_cast<uint16_t>(-4), 11477, static_cast<uint16_t>(-4), 11479, static_cast<uint16_t>(-4), 11481, static_cast<uint16_t>(-4), 11483, static_cast<uint16_t>(-4), 11485, static_cast<uint16_t>(-4), 11487, static_cast<uint16_t>(-4), 11489, static_cast<uint16_t>(-4), 11491, static_cast<uint16_t>(-4), 44288, static_cast<uint16_t>(-29056), 11557, static_cast<uint16_t>(-29056) };
-static const MultiCharacterSpecialCase kToUppercaseMultiStrings1[] = { {2, {70, 70}}, {2, {70, 73}}, {2, {70, 76}}, {3, {70, 70, 73}}, {3, {70, 70, 76}}, {2, {83, 84}}, {2, {83, 84}}, {2, {1348, 1350}}, {2, {1348, 1333}}, {2, {1348, 1339}}, {2, {1358, 1350}}, {2, {1348, 1341}}, {0, {0}} };
+static const uint16_t kToUppercaseTable0[1242] = { 32865, static_cast<uint16_t>(-128), 122, static_cast<uint16_t>(-128), 181, 2972, 223, 1, 32992, static_cast<uint16_t>(-128), 246, static_cast<uint16_t>(-128), 33016, static_cast<uint16_t>(-128), 254, static_cast<uint16_t>(-128), 255, 484, 257, static_cast<uint16_t>(-4), 259, static_cast<uint16_t>(-4), 261, static_cast<uint16_t>(-4), 263, static_cast<uint16_t>(-4), 265, static_cast<uint16_t>(-4), 267, static_cast<uint16_t>(-4), 269, static_cast<uint16_t>(-4), 271, static_cast<uint16_t>(-4), 273, static_cast<uint16_t>(-4), 275, static_cast<uint16_t>(-4), 277, static_cast<uint16_t>(-4), 279, static_cast<uint16_t>(-4), 281, static_cast<uint16_t>(-4), 283, static_cast<uint16_t>(-4), 285, static_cast<uint16_t>(-4), 287, static_cast<uint16_t>(-4), 289, static_cast<uint16_t>(-4), 291, static_cast<uint16_t>(-4), 293, static_cast<uint16_t>(-4), 295, static_cast<uint16_t>(-4), 297, static_cast<uint16_t>(-4), 299, static_cast<uint16_t>(-4), 301, static_cast<uint16_t>(-4), 303, static_cast<uint16_t>(-4), 305, static_cast<uint16_t>(-928), 307, static_cast<uint16_t>(-4), 309, static_cast<uint16_t>(-4), 311, static_cast<uint16_t>(-4), 314, static_cast<uint16_t>(-4), 316, static_cast<uint16_t>(-4), 318, static_cast<uint16_t>(-4), 320, static_cast<uint16_t>(-4), 322, static_cast<uint16_t>(-4), 324, static_cast<uint16_t>(-4), 326, static_cast<uint16_t>(-4), 328, static_cast<uint16_t>(-4), 329, 5, 331, static_cast<uint16_t>(-4), 333, static_cast<uint16_t>(-4), 335, static_cast<uint16_t>(-4), 337, static_cast<uint16_t>(-4), 339, static_cast<uint16_t>(-4), 341, static_cast<uint16_t>(-4), 343, static_cast<uint16_t>(-4), 345, static_cast<uint16_t>(-4), 347, static_cast<uint16_t>(-4), 349, static_cast<uint16_t>(-4), 351, static_cast<uint16_t>(-4), 353, static_cast<uint16_t>(-4), 355, static_cast<uint16_t>(-4), 357, static_cast<uint16_t>(-4), 359, static_cast<uint16_t>(-4), 361, static_cast<uint16_t>(-4), 363, static_cast<uint16_t>(-4), 365, static_cast<uint16_t>(-4), 367, static_cast<uint16_t>(-4), 369, static_cast<uint16_t>(-4), 371, static_cast<uint16_t>(-4), 373, static_cast<uint16_t>(-4), 375, static_cast<uint16_t>(-4), 378, static_cast<uint16_t>(-4), 380, static_cast<uint16_t>(-4), 382, static_cast<uint16_t>(-4), 383, static_cast<uint16_t>(-1200), 384, 780, 387, static_cast<uint16_t>(-4), 389, static_cast<uint16_t>(-4), 392, static_cast<uint16_t>(-4), 396, static_cast<uint16_t>(-4), 402, static_cast<uint16_t>(-4), 405, 388, 409, static_cast<uint16_t>(-4), 410, 652, 414, 520, 417, static_cast<uint16_t>(-4), 419, static_cast<uint16_t>(-4), 421, static_cast<uint16_t>(-4), 424, static_cast<uint16_t>(-4), 429, static_cast<uint16_t>(-4), 432, static_cast<uint16_t>(-4), 436, static_cast<uint16_t>(-4), 438, static_cast<uint16_t>(-4), 441, static_cast<uint16_t>(-4), 445, static_cast<uint16_t>(-4), 447, 224, 453, static_cast<uint16_t>(-4), 454, static_cast<uint16_t>(-8), 456, static_cast<uint16_t>(-4), 457, static_cast<uint16_t>(-8), 459, static_cast<uint16_t>(-4), 460, static_cast<uint16_t>(-8), 462, static_cast<uint16_t>(-4), 464, static_cast<uint16_t>(-4), 466, static_cast<uint16_t>(-4), 468, static_cast<uint16_t>(-4), 470, static_cast<uint16_t>(-4), 472, static_cast<uint16_t>(-4), 474, static_cast<uint16_t>(-4), 476, static_cast<uint16_t>(-4), 477, static_cast<uint16_t>(-316), 479, static_cast<uint16_t>(-4), 481, static_cast<uint16_t>(-4), 483, static_cast<uint16_t>(-4), 485, static_cast<uint16_t>(-4), 487, static_cast<uint16_t>(-4), 489, static_cast<uint16_t>(-4), 491, static_cast<uint16_t>(-4), 493, static_cast<uint16_t>(-4), 495, static_cast<uint16_t>(-4), 496, 9, 498, static_cast<uint16_t>(-4), 499, static_cast<uint16_t>(-8), 501, static_cast<uint16_t>(-4), 505, static_cast<uint16_t>(-4), 507, static_cast<uint16_t>(-4), 509, static_cast<uint16_t>(-4), 511, static_cast<uint16_t>(-4), 513, static_cast<uint16_t>(-4), 515, static_cast<uint16_t>(-4), 517, static_cast<uint16_t>(-4), 519, static_cast<uint16_t>(-4), 521, static_cast<uint16_t>(-4), 523, static_cast<uint16_t>(-4), 525, static_cast<uint16_t>(-4), 527, static_cast<uint16_t>(-4), 529, static_cast<uint16_t>(-4), 531, static_cast<uint16_t>(-4), 533, static_cast<uint16_t>(-4), 535, static_cast<uint16_t>(-4), 537, static_cast<uint16_t>(-4), 539, static_cast<uint16_t>(-4), 541, static_cast<uint16_t>(-4), 543, static_cast<uint16_t>(-4), 547, static_cast<uint16_t>(-4), 549, static_cast<uint16_t>(-4), 551, static_cast<uint16_t>(-4), 553, static_cast<uint16_t>(-4), 555, static_cast<uint16_t>(-4), 557, static_cast<uint16_t>(-4), 559, static_cast<uint16_t>(-4), 561, static_cast<uint16_t>(-4), 563, static_cast<uint16_t>(-4), 572, static_cast<uint16_t>(-4), 578, static_cast<uint16_t>(-4), 583, static_cast<uint16_t>(-4), 585, static_cast<uint16_t>(-4), 587, static_cast<uint16_t>(-4), 589, static_cast<uint16_t>(-4), 591, static_cast<uint16_t>(-4), 595, static_cast<uint16_t>(-840), 596, static_cast<uint16_t>(-824), 33366, static_cast<uint16_t>(-820), 599, static_cast<uint16_t>(-820), 601, static_cast<uint16_t>(-808), 603, static_cast<uint16_t>(-812), 608, static_cast<uint16_t>(-820), 611, static_cast<uint16_t>(-828), 616, static_cast<uint16_t>(-836), 617, static_cast<uint16_t>(-844), 619, 42972, 623, static_cast<uint16_t>(-844), 626, static_cast<uint16_t>(-852), 629, static_cast<uint16_t>(-856), 637, 42908, 640, static_cast<uint16_t>(-872), 643, static_cast<uint16_t>(-872), 648, static_cast<uint16_t>(-872), 649, static_cast<uint16_t>(-276), 33418, static_cast<uint16_t>(-868), 651, static_cast<uint16_t>(-868), 652, static_cast<uint16_t>(-284), 658, static_cast<uint16_t>(-876), 837, 336, 33659, 520, 893, 520, 912, 13, 940, static_cast<uint16_t>(-152), 33709, static_cast<uint16_t>(-148), 943, static_cast<uint16_t>(-148), 944, 17, 33713, static_cast<uint16_t>(-128), 961, static_cast<uint16_t>(-128), 962, static_cast<uint16_t>(-124), 33731, static_cast<uint16_t>(-128), 971, static_cast<uint16_t>(-128), 972, static_cast<uint16_t>(-256), 33741, static_cast<uint16_t>(-252), 974, static_cast<uint16_t>(-252), 976, static_cast<uint16_t>(-248), 977, static_cast<uint16_t>(-228), 981, static_cast<uint16_t>(-188), 982, static_cast<uint16_t>(-216), 985, static_cast<uint16_t>(-4), 987, static_cast<uint16_t>(-4), 989, static_cast<uint16_t>(-4), 991, static_cast<uint16_t>(-4), 993, static_cast<uint16_t>(-4), 995, static_cast<uint16_t>(-4), 997, static_cast<uint16_t>(-4), 999, static_cast<uint16_t>(-4), 1001, static_cast<uint16_t>(-4), 1003, static_cast<uint16_t>(-4), 1005, static_cast<uint16_t>(-4), 1007, static_cast<uint16_t>(-4), 1008, static_cast<uint16_t>(-344), 1009, static_cast<uint16_t>(-320), 1010, 28, 1013, static_cast<uint16_t>(-384), 1016, static_cast<uint16_t>(-4), 1019, static_cast<uint16_t>(-4), 33840, static_cast<uint16_t>(-128), 1103, static_cast<uint16_t>(-128), 33872, static_cast<uint16_t>(-320), 1119, static_cast<uint16_t>(-320), 1121, static_cast<uint16_t>(-4), 1123, static_cast<uint16_t>(-4), 1125, static_cast<uint16_t>(-4), 1127, static_cast<uint16_t>(-4), 1129, static_cast<uint16_t>(-4), 1131, static_cast<uint16_t>(-4), 1133, static_cast<uint16_t>(-4), 1135, static_cast<uint16_t>(-4), 1137, static_cast<uint16_t>(-4), 1139, static_cast<uint16_t>(-4), 1141, static_cast<uint16_t>(-4), 1143, static_cast<uint16_t>(-4), 1145, static_cast<uint16_t>(-4), 1147, static_cast<uint16_t>(-4), 1149, static_cast<uint16_t>(-4), 1151, static_cast<uint16_t>(-4), 1153, static_cast<uint16_t>(-4), 1163, static_cast<uint16_t>(-4), 1165, static_cast<uint16_t>(-4), 1167, static_cast<uint16_t>(-4), 1169, static_cast<uint16_t>(-4), 1171, static_cast<uint16_t>(-4), 1173, static_cast<uint16_t>(-4), 1175, static_cast<uint16_t>(-4), 1177, static_cast<uint16_t>(-4), 1179, static_cast<uint16_t>(-4), 1181, static_cast<uint16_t>(-4), 1183, static_cast<uint16_t>(-4), 1185, static_cast<uint16_t>(-4), 1187, static_cast<uint16_t>(-4), 1189, static_cast<uint16_t>(-4), 1191, static_cast<uint16_t>(-4), 1193, static_cast<uint16_t>(-4), 1195, static_cast<uint16_t>(-4), 1197, static_cast<uint16_t>(-4), 1199, static_cast<uint16_t>(-4), 1201, static_cast<uint16_t>(-4), 1203, static_cast<uint16_t>(-4), 1205, static_cast<uint16_t>(-4), 1207, static_cast<uint16_t>(-4), 1209, static_cast<uint16_t>(-4), 1211, static_cast<uint16_t>(-4), 1213, static_cast<uint16_t>(-4), 1215, static_cast<uint16_t>(-4), 1218, static_cast<uint16_t>(-4), 1220, static_cast<uint16_t>(-4), 1222, static_cast<uint16_t>(-4), 1224, static_cast<uint16_t>(-4), 1226, static_cast<uint16_t>(-4), 1228, static_cast<uint16_t>(-4), 1230, static_cast<uint16_t>(-4), 1231, static_cast<uint16_t>(-60), 1233, static_cast<uint16_t>(-4), 1235, static_cast<uint16_t>(-4), 1237, static_cast<uint16_t>(-4), 1239, static_cast<uint16_t>(-4), 1241, static_cast<uint16_t>(-4), 1243, static_cast<uint16_t>(-4), 1245, static_cast<uint16_t>(-4), 1247, static_cast<uint16_t>(-4), 1249, static_cast<uint16_t>(-4), 1251, static_cast<uint16_t>(-4), 1253, static_cast<uint16_t>(-4), 1255, static_cast<uint16_t>(-4), 1257, static_cast<uint16_t>(-4), 1259, static_cast<uint16_t>(-4), 1261, static_cast<uint16_t>(-4), 1263, static_cast<uint16_t>(-4), 1265, static_cast<uint16_t>(-4), 1267, static_cast<uint16_t>(-4), 1269, static_cast<uint16_t>(-4), 1271, static_cast<uint16_t>(-4), 1273, static_cast<uint16_t>(-4), 1275, static_cast<uint16_t>(-4), 1277, static_cast<uint16_t>(-4), 1279, static_cast<uint16_t>(-4), 1281, static_cast<uint16_t>(-4), 1283, static_cast<uint16_t>(-4), 1285, static_cast<uint16_t>(-4), 1287, static_cast<uint16_t>(-4), 1289, static_cast<uint16_t>(-4), 1291, static_cast<uint16_t>(-4), 1293, static_cast<uint16_t>(-4), 1295, static_cast<uint16_t>(-4), 1297, static_cast<uint16_t>(-4), 1299, static_cast<uint16_t>(-4), 34145, static_cast<uint16_t>(-192), 1414, static_cast<uint16_t>(-192), 1415, 21, 7549, 15256, 7681, static_cast<uint16_t>(-4), 7683, static_cast<uint16_t>(-4), 7685, static_cast<uint16_t>(-4), 7687, static_cast<uint16_t>(-4), 7689, static_cast<uint16_t>(-4), 7691, static_cast<uint16_t>(-4), 7693, static_cast<uint16_t>(-4), 7695, static_cast<uint16_t>(-4), 7697, static_cast<uint16_t>(-4), 7699, static_cast<uint16_t>(-4), 7701, static_cast<uint16_t>(-4), 7703, static_cast<uint16_t>(-4), 7705, static_cast<uint16_t>(-4), 7707, static_cast<uint16_t>(-4), 7709, static_cast<uint16_t>(-4), 7711, static_cast<uint16_t>(-4), 7713, static_cast<uint16_t>(-4), 7715, static_cast<uint16_t>(-4), 7717, static_cast<uint16_t>(-4), 7719, static_cast<uint16_t>(-4), 7721, static_cast<uint16_t>(-4), 7723, static_cast<uint16_t>(-4), 7725, static_cast<uint16_t>(-4), 7727, static_cast<uint16_t>(-4), 7729, static_cast<uint16_t>(-4), 7731, static_cast<uint16_t>(-4), 7733, static_cast<uint16_t>(-4), 7735, static_cast<uint16_t>(-4), 7737, static_cast<uint16_t>(-4), 7739, static_cast<uint16_t>(-4), 7741, static_cast<uint16_t>(-4), 7743, static_cast<uint16_t>(-4), 7745, static_cast<uint16_t>(-4), 7747, static_cast<uint16_t>(-4), 7749, static_cast<uint16_t>(-4), 7751, static_cast<uint16_t>(-4), 7753, static_cast<uint16_t>(-4), 7755, static_cast<uint16_t>(-4), 7757, static_cast<uint16_t>(-4), 7759, static_cast<uint16_t>(-4), 7761, static_cast<uint16_t>(-4), 7763, static_cast<uint16_t>(-4), 7765, static_cast<uint16_t>(-4), 7767, static_cast<uint16_t>(-4), 7769, static_cast<uint16_t>(-4), 7771, static_cast<uint16_t>(-4), 7773, static_cast<uint16_t>(-4), 7775, static_cast<uint16_t>(-4), 7777, static_cast<uint16_t>(-4), 7779, static_cast<uint16_t>(-4), 7781, static_cast<uint16_t>(-4), 7783, static_cast<uint16_t>(-4), 7785, static_cast<uint16_t>(-4), 7787, static_cast<uint16_t>(-4), 7789, static_cast<uint16_t>(-4), 7791, static_cast<uint16_t>(-4), 7793, static_cast<uint16_t>(-4), 7795, static_cast<uint16_t>(-4), 7797, static_cast<uint16_t>(-4), 7799, static_cast<uint16_t>(-4), 7801, static_cast<uint16_t>(-4), 7803, static_cast<uint16_t>(-4), 7805, static_cast<uint16_t>(-4), 7807, static_cast<uint16_t>(-4), 7809, static_cast<uint16_t>(-4), 7811, static_cast<uint16_t>(-4), 7813, static_cast<uint16_t>(-4), 7815, static_cast<uint16_t>(-4), 7817, static_cast<uint16_t>(-4), 7819, static_cast<uint16_t>(-4), 7821, static_cast<uint16_t>(-4), 7823, static_cast<uint16_t>(-4), 7825, static_cast<uint16_t>(-4), 7827, static_cast<uint16_t>(-4), 7829, static_cast<uint16_t>(-4), 7830, 25, 7831, 29, 7832, 33, 7833, 37, 7834, 41, 7835, static_cast<uint16_t>(-236), 7841, static_cast<uint16_t>(-4), 7843, static_cast<uint16_t>(-4), 7845, static_cast<uint16_t>(-4), 7847, static_cast<uint16_t>(-4), 7849, static_cast<uint16_t>(-4), 7851, static_cast<uint16_t>(-4), 7853, static_cast<uint16_t>(-4), 7855, static_cast<uint16_t>(-4), 7857, static_cast<uint16_t>(-4), 7859, static_cast<uint16_t>(-4), 7861, static_cast<uint16_t>(-4), 7863, static_cast<uint16_t>(-4), 7865, static_cast<uint16_t>(-4), 7867, static_cast<uint16_t>(-4), 7869, static_cast<uint16_t>(-4), 7871, static_cast<uint16_t>(-4), 7873, static_cast<uint16_t>(-4), 7875, static_cast<uint16_t>(-4), 7877, static_cast<uint16_t>(-4), 7879, static_cast<uint16_t>(-4), 7881, static_cast<uint16_t>(-4), 7883, static_cast<uint16_t>(-4), 7885, static_cast<uint16_t>(-4), 7887, static_cast<uint16_t>(-4), 7889, static_cast<uint16_t>(-4), 7891, static_cast<uint16_t>(-4), 7893, static_cast<uint16_t>(-4), 7895, static_cast<uint16_t>(-4), 7897, static_cast<uint16_t>(-4), 7899, static_cast<uint16_t>(-4), 7901, static_cast<uint16_t>(-4), 7903, static_cast<uint16_t>(-4), 7905, static_cast<uint16_t>(-4), 7907, static_cast<uint16_t>(-4), 7909, static_cast<uint16_t>(-4), 7911, static_cast<uint16_t>(-4), 7913, static_cast<uint16_t>(-4), 7915, static_cast<uint16_t>(-4), 7917, static_cast<uint16_t>(-4), 7919, static_cast<uint16_t>(-4), 7921, static_cast<uint16_t>(-4), 7923, static_cast<uint16_t>(-4), 7925, static_cast<uint16_t>(-4), 7927, static_cast<uint16_t>(-4), 7929, static_cast<uint16_t>(-4), 40704, 32, 7943, 32, 40720, 32, 7957, 32, 40736, 32, 7975, 32, 40752, 32, 7991, 32, 40768, 32, 8005, 32, 8016, 45, 8017, 32, 8018, 49, 8019, 32, 8020, 53, 8021, 32, 8022, 57, 8023, 32, 40800, 32, 8039, 32, 40816, 296, 8049, 296, 40818, 344, 8053, 344, 40822, 400, 8055, 400, 40824, 512, 8057, 512, 40826, 448, 8059, 448, 40828, 504, 8061, 504, 8064, 61, 8065, 65, 8066, 69, 8067, 73, 8068, 77, 8069, 81, 8070, 85, 8071, 89, 8072, 93, 8073, 97, 8074, 101, 8075, 105, 8076, 109, 8077, 113, 8078, 117, 8079, 121, 8080, 125, 8081, 129, 8082, 133, 8083, 137, 8084, 141, 8085, 145, 8086, 149, 8087, 153, 8088, 157, 8089, 161, 8090, 165, 8091, 169, 8092, 173, 8093, 177, 8094, 181, 8095, 185, 8096, 189, 8097, 193, 8098, 197, 8099, 201, 8100, 205, 8101, 209, 8102, 213, 8103, 217, 8104, 221, 8105, 225, 8106, 229, 8107, 233, 8108, 237, 8109, 241, 8110, 245, 8111, 249, 40880, 32, 8113, 32, 8114, 253, 8115, 257, 8116, 261, 8118, 265, 8119, 269, 8124, 273, 8126, static_cast<uint16_t>(-28820), 8130, 277, 8131, 281, 8132, 285, 8134, 289, 8135, 293, 8140, 297, 40912, 32, 8145, 32, 8146, 301, 8147, 305, 8150, 309, 8151, 313, 40928, 32, 8161, 32, 8162, 317, 8163, 321, 8164, 325, 8165, 28, 8166, 329, 8167, 333, 8178, 337, 8179, 341, 8180, 345, 8182, 349, 8183, 353, 8188, 357, 8526, static_cast<uint16_t>(-112), 41328, static_cast<uint16_t>(-64), 8575, static_cast<uint16_t>(-64), 8580, static_cast<uint16_t>(-4), 42192, static_cast<uint16_t>(-104), 9449, static_cast<uint16_t>(-104), 44080, static_cast<uint16_t>(-192), 11358, static_cast<uint16_t>(-192), 11361, static_cast<uint16_t>(-4), 11365, static_cast<uint16_t>(-43180), 11366, static_cast<uint16_t>(-43168), 11368, static_cast<uint16_t>(-4), 11370, static_cast<uint16_t>(-4), 11372, static_cast<uint16_t>(-4), 11382, static_cast<uint16_t>(-4), 11393, static_cast<uint16_t>(-4), 11395, static_cast<uint16_t>(-4), 11397, static_cast<uint16_t>(-4), 11399, static_cast<uint16_t>(-4), 11401, static_cast<uint16_t>(-4), 11403, static_cast<uint16_t>(-4), 11405, static_cast<uint16_t>(-4), 11407, static_cast<uint16_t>(-4), 11409, static_cast<uint16_t>(-4), 11411, static_cast<uint16_t>(-4), 11413, static_cast<uint16_t>(-4), 11415, static_cast<uint16_t>(-4), 11417, static_cast<uint16_t>(-4), 11419, static_cast<uint16_t>(-4), 11421, static_cast<uint16_t>(-4), 11423, static_cast<uint16_t>(-4), 11425, static_cast<uint16_t>(-4), 11427, static_cast<uint16_t>(-4), 11429, static_cast<uint16_t>(-4), 11431, static_cast<uint16_t>(-4), 11433, static_cast<uint16_t>(-4), 11435, static_cast<uint16_t>(-4), 11437, static_cast<uint16_t>(-4), 11439, static_cast<uint16_t>(-4), 11441, static_cast<uint16_t>(-4), 11443, static_cast<uint16_t>(-4), 11445, static_cast<uint16_t>(-4), 11447, static_cast<uint16_t>(-4), 11449, static_cast<uint16_t>(-4), 11451, static_cast<uint16_t>(-4), 11453, static_cast<uint16_t>(-4), 11455, static_cast<uint16_t>(-4), 11457, static_cast<uint16_t>(-4), 11459, static_cast<uint16_t>(-4), 11461, static_cast<uint16_t>(-4), 11463, static_cast<uint16_t>(-4), 11465, static_cast<uint16_t>(-4), 11467, static_cast<uint16_t>(-4), 11469, static_cast<uint16_t>(-4), 11471, static_cast<uint16_t>(-4), 11473, static_cast<uint16_t>(-4), 11475, static_cast<uint16_t>(-4), 11477, static_cast<uint16_t>(-4), 11479, static_cast<uint16_t>(-4), 11481, static_cast<uint16_t>(-4), 11483, static_cast<uint16_t>(-4), 11485, static_cast<uint16_t>(-4), 11487, static_cast<uint16_t>(-4), 11489, static_cast<uint16_t>(-4), 11491, static_cast<uint16_t>(-4), 44288, static_cast<uint16_t>(-29056), 11557, static_cast<uint16_t>(-29056) }; // NOLINT
+static const MultiCharacterSpecialCase kToUppercaseMultiStrings1[] = { {2, {70, 70}}, {2, {70, 73}}, {2, {70, 76}}, {3, {70, 70, 73}}, {3, {70, 70, 76}}, {2, {83, 84}}, {2, {83, 84}}, {2, {1348, 1350}}, {2, {1348, 1333}}, {2, {1348, 1339}}, {2, {1358, 1350}}, {2, {1348, 1341}}, {0, {0}} }; // NOLINT
 static const uint16_t kToUppercaseTable1Size = 14;
-static const uint16_t kToUppercaseTable1[28] = { 31488, 1, 31489, 5, 31490, 9, 31491, 13, 31492, 17, 31493, 21, 31494, 25, 31507, 29, 31508, 33, 31509, 37, 31510, 41, 31511, 45, 65345, static_cast<uint16_t>(-128), 32602, static_cast<uint16_t>(-128) };
-static const MultiCharacterSpecialCase kToUppercaseMultiStrings2[] = { {0, {0}} };
+static const uint16_t kToUppercaseTable1[28] = { 31488, 1, 31489, 5, 31490, 9, 31491, 13, 31492, 17, 31493, 21, 31494, 25, 31507, 29, 31508, 33, 31509, 37, 31510, 41, 31511, 45, 65345, static_cast<uint16_t>(-128), 32602, static_cast<uint16_t>(-128) }; // NOLINT
+static const MultiCharacterSpecialCase kToUppercaseMultiStrings2[] = { {0, {0}} }; // NOLINT
 static const uint16_t kToUppercaseTable2Size = 2;
-static const uint16_t kToUppercaseTable2[4] = { 33832, static_cast<uint16_t>(-160), 1103, static_cast<uint16_t>(-160) };
+static const uint16_t kToUppercaseTable2[4] = { 33832, static_cast<uint16_t>(-160), 1103, static_cast<uint16_t>(-160) }; // NOLINT
 int ToUppercase::Convert(uchar c,
                       uchar n,
                       uchar* result,
@@ -796,7 +796,7 @@
 uchar UnicodeData::kMaxCodePoint = 1114109;
 
 int UnicodeData::GetByteCount() {
-  return 0 + (sizeof(uint16_t) * kUppercaseTable0Size) + (sizeof(uint16_t) * kUppercaseTable1Size) + (sizeof(uint16_t) * kUppercaseTable2Size) + (sizeof(uint16_t) * kUppercaseTable3Size) + (sizeof(uint16_t) * kLowercaseTable0Size) + (sizeof(uint16_t) * kLowercaseTable1Size) + (sizeof(uint16_t) * kLowercaseTable2Size) + (sizeof(uint16_t) * kLowercaseTable3Size) + (sizeof(uint16_t) * kLetterTable0Size) + (sizeof(uint16_t) * kLetterTable1Size) + (sizeof(uint16_t) * kLetterTable2Size) + (sizeof(uint16_t) * kLetterTable3Size) + (sizeof(uint16_t) * kLetterTable4Size) + (sizeof(uint16_t) * kLetterTable5Size) + (sizeof(uint16_t) * kSpaceTable0Size) + (sizeof(uint16_t) * kTitlecaseTable0Size) + (sizeof(uint16_t) * kNumberTable0Size) + (sizeof(uint16_t) * kNumberTable1Size) + (sizeof(uint16_t) * kNumberTable2Size) + (sizeof(uint16_t) * kNumberTable3Size) + (sizeof(uint16_t) * kDecimalDigitTable0Size) + (sizeof(uint16_t) * kDecimalDigitTable1Size) + (sizeof(uint16_t) * kDecimalDigitTable2Size) + (sizeof(uint16_t) * kDecimalDigitTable3Size) + (sizeof(uint16_t) * kIdeographicTable0Size) + (sizeof(uint16_t) * kIdeographicTable1Size) + (sizeof(uint16_t) * kIdeographicTable4Size) + (sizeof(uint16_t) * kIdeographicTable5Size) + (sizeof(uint16_t) * kWhiteSpaceTable0Size) + (sizeof(uint16_t) * kHexDigitTable0Size) + (sizeof(uint16_t) * kHexDigitTable1Size) + (sizeof(uint16_t) * kAsciiHexDigitTable0Size) + (sizeof(uint16_t) * kBidiControlTable0Size) + (sizeof(uint16_t) * kJoinControlTable0Size) + (sizeof(uint16_t) * kDashTable0Size) + (sizeof(uint16_t) * kDashTable1Size) + (sizeof(uint16_t) * kHyphenTable0Size) + (sizeof(uint16_t) * kHyphenTable1Size) + (sizeof(uint16_t) * kLineTerminatorTable0Size) + (sizeof(uint16_t) * kCombiningMarkTable0Size) + (sizeof(uint16_t) * kCombiningMarkTable1Size) + (sizeof(uint16_t) * kCombiningMarkTable2Size) + (sizeof(uint16_t) * kCombiningMarkTable3Size) + (sizeof(uint16_t) * kCombiningMarkTable28Size) + (sizeof(uint16_t) * kConnectorPunctuationTable0Size) + (sizeof(uint16_t) * kConnectorPunctuationTable1Size) + (sizeof(uint16_t) * kToLowercaseTable0Size) + (sizeof(uint16_t) * kToLowercaseTable1Size) + (sizeof(uint16_t) * kToLowercaseTable2Size) + (sizeof(uint16_t) * kToUppercaseTable0Size) + (sizeof(uint16_t) * kToUppercaseTable1Size) + (sizeof(uint16_t) * kToUppercaseTable2Size);
+  return 0 + (sizeof(uint16_t) * kUppercaseTable0Size) + (sizeof(uint16_t) * kUppercaseTable1Size) + (sizeof(uint16_t) * kUppercaseTable2Size) + (sizeof(uint16_t) * kUppercaseTable3Size) + (sizeof(uint16_t) * kLowercaseTable0Size) + (sizeof(uint16_t) * kLowercaseTable1Size) + (sizeof(uint16_t) * kLowercaseTable2Size) + (sizeof(uint16_t) * kLowercaseTable3Size) + (sizeof(uint16_t) * kLetterTable0Size) + (sizeof(uint16_t) * kLetterTable1Size) + (sizeof(uint16_t) * kLetterTable2Size) + (sizeof(uint16_t) * kLetterTable3Size) + (sizeof(uint16_t) * kLetterTable4Size) + (sizeof(uint16_t) * kLetterTable5Size) + (sizeof(uint16_t) * kSpaceTable0Size) + (sizeof(uint16_t) * kTitlecaseTable0Size) + (sizeof(uint16_t) * kNumberTable0Size) + (sizeof(uint16_t) * kNumberTable1Size) + (sizeof(uint16_t) * kNumberTable2Size) + (sizeof(uint16_t) * kNumberTable3Size) + (sizeof(uint16_t) * kDecimalDigitTable0Size) + (sizeof(uint16_t) * kDecimalDigitTable1Size) + (sizeof(uint16_t) * kDecimalDigitTable2Size) + (sizeof(uint16_t) * kDecimalDigitTable3Size) + (sizeof(uint16_t) * kIdeographicTable0Size) + (sizeof(uint16_t) * kIdeographicTable1Size) + (sizeof(uint16_t) * kIdeographicTable4Size) + (sizeof(uint16_t) * kIdeographicTable5Size) + (sizeof(uint16_t) * kWhiteSpaceTable0Size) + (sizeof(uint16_t) * kHexDigitTable0Size) + (sizeof(uint16_t) * kHexDigitTable1Size) + (sizeof(uint16_t) * kAsciiHexDigitTable0Size) + (sizeof(uint16_t) * kBidiControlTable0Size) + (sizeof(uint16_t) * kJoinControlTable0Size) + (sizeof(uint16_t) * kDashTable0Size) + (sizeof(uint16_t) * kDashTable1Size) + (sizeof(uint16_t) * kHyphenTable0Size) + (sizeof(uint16_t) * kHyphenTable1Size) + (sizeof(uint16_t) * kLineTerminatorTable0Size) + (sizeof(uint16_t) * kCombiningMarkTable0Size) + (sizeof(uint16_t) * kCombiningMarkTable1Size) + (sizeof(uint16_t) * kCombiningMarkTable2Size) + (sizeof(uint16_t) * kCombiningMarkTable3Size) + (sizeof(uint16_t) * kCombiningMarkTable28Size) + (sizeof(uint16_t) * kConnectorPunctuationTable0Size) + (sizeof(uint16_t) * kConnectorPunctuationTable1Size) + (sizeof(uint16_t) * kToLowercaseTable0Size) + (sizeof(uint16_t) * kToLowercaseTable1Size) + (sizeof(uint16_t) * kToLowercaseTable2Size) + (sizeof(uint16_t) * kToUppercaseTable0Size) + (sizeof(uint16_t) * kToUppercaseTable1Size) + (sizeof(uint16_t) * kToUppercaseTable2Size); // NOLINT
 }
 
 }  // namespace unicode
diff --git a/src/usage-analyzer.cc b/src/usage-analyzer.cc
index cafe8ca..231a8e4 100644
--- a/src/usage-analyzer.cc
+++ b/src/usage-analyzer.cc
@@ -285,13 +285,11 @@
 
 
 void UsageComputer::VisitObjectLiteral(ObjectLiteral* node) {
-  Read(node->result());
   ReadList(node->properties());
 }
 
 
 void UsageComputer::VisitArrayLiteral(ArrayLiteral* node) {
-  Read(node->result());
   ReadList(node->values());
 }
 
diff --git a/src/v8natives.js b/src/v8natives.js
index 3755f74..5ead3ad 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -33,7 +33,7 @@
 // const $Number = global.Number;
 // const $Function = global.Function;
 // const $Array = global.Array;
-// const $NaN = %NumberNaN();
+// const $NaN = 0/0;
 
 
 // ECMA 262 - 15.1.1.1.
@@ -212,7 +212,8 @@
 %AddProperty(global, "execScript", function(expr, lang) {
   // NOTE: We don't care about the character casing.
   if (!lang || /javascript/i.test(lang)) {
-    %CompileString(ToString(expr), false)();
+    var f = %CompileString(ToString(expr), false);
+    f.call(global);
   }
   return null;
 }, DONT_ENUM);
@@ -257,10 +258,10 @@
 %AddProperty($Number.prototype, "constructor", $Number, DONT_ENUM);
 
 // ECMA-262 section 15.7.3.1.
-%AddProperty($Number, "MAX_VALUE", %NumberMaxValue(), DONT_ENUM | DONT_DELETE | READ_ONLY);
+%AddProperty($Number, "MAX_VALUE", 1.7976931348623157e+308, DONT_ENUM | DONT_DELETE | READ_ONLY);
 
 // ECMA-262 section 15.7.3.2.
-%AddProperty($Number, "MIN_VALUE", %NumberMinValue(), DONT_ENUM | DONT_DELETE | READ_ONLY);
+%AddProperty($Number, "MIN_VALUE", 5e-324, DONT_ENUM | DONT_DELETE | READ_ONLY);
 
 // ECMA-262 section 15.7.3.3.
 %AddProperty($Number, "NaN", $NaN, DONT_ENUM | DONT_DELETE | READ_ONLY);
diff --git a/src/zone.cc b/src/zone.cc
index a518a10..ed443d8 100644
--- a/src/zone.cc
+++ b/src/zone.cc
@@ -37,6 +37,7 @@
 
 bool AssertNoZoneAllocation::allow_allocation_ = true;
 
+int ZoneScope::nesting_ = 0;
 
 // Segments represent chunks of memory: They have starting address
 // (encoded in the this pointer) and a size in bytes. Segments are
diff --git a/src/zone.h b/src/zone.h
index 28ac954..336fd34 100644
--- a/src/zone.h
+++ b/src/zone.h
@@ -31,6 +31,14 @@
 namespace v8 { namespace internal {
 
 
+// Zone scopes are in one of two modes.  Either they delete the zone
+// on exit or they do not.
+enum ZoneScopeMode {
+  DELETE_ON_EXIT,
+  DONT_DELETE_ON_EXIT
+};
+
+
 // The Zone supports very fast allocation of small chunks of
 // memory. The chunks cannot be deallocated individually, but instead
 // the Zone supports deallocating all chunks in one fast
@@ -143,6 +151,31 @@
 };
 
 
+// ZoneScopes keep track of the current parsing and compilation
+// nesting and cleans up generated ASTs in the Zone when exiting the
+// outer-most scope.
+class ZoneScope BASE_EMBEDDED {
+ public:
+  explicit ZoneScope(ZoneScopeMode mode) : mode_(mode) {
+    nesting_++;
+  }
+
+  ~ZoneScope() {
+    if (--nesting_ == 0 && mode_ == DELETE_ON_EXIT) Zone::DeleteAll();
+  }
+
+  // For ZoneScopes that do not delete on exit by default, call this
+  // method to request deletion on exit.
+  void DeleteOnExit() {
+    mode_ = DELETE_ON_EXIT;
+  }
+
+ private:
+  ZoneScopeMode mode_;
+  static int nesting_;
+};
+
+
 } }  // namespace v8::internal
 
 #endif  // V8_ZONE_H_