From 2ebd6921510f9efbf1ef7eb6988ccecac25ee988 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 31 Jul 2009 14:36:48 +0200 Subject: [PATCH] Upgrade V8 to 1.3.1 --- deps/v8/ChangeLog | 47 + deps/v8/SConstruct | 75 +- deps/v8/benchmarks/run.html | 32 + deps/v8/benchmarks/style.css | 9 + deps/v8/include/v8.h | 76 +- deps/v8/src/SConscript | 2 +- deps/v8/src/api.cc | 102 +- deps/v8/src/arm/codegen-arm.cc | 70 +- deps/v8/src/arm/codegen-arm.h | 4 +- deps/v8/src/arm/ic-arm.cc | 37 +- deps/v8/src/arm/macro-assembler-arm.cc | 2 +- deps/v8/src/arm/register-allocator-arm-inl.h | 8 +- deps/v8/src/arm/stub-cache-arm.cc | 51 +- deps/v8/src/ast.cc | 2 +- deps/v8/src/ast.h | 31 +- deps/v8/src/bootstrapper.cc | 14 +- deps/v8/src/builtins.cc | 26 +- deps/v8/src/codegen.cc | 2 +- deps/v8/src/compilation-cache.cc | 9 + deps/v8/src/debug-agent.cc | 4 +- deps/v8/src/debug.cc | 39 +- deps/v8/src/execution.cc | 40 +- deps/v8/src/factory.cc | 10 + deps/v8/src/factory.h | 4 + deps/v8/src/flag-definitions.h | 5 +- deps/v8/src/frame-element.cc | 45 + deps/v8/src/frame-element.h | 5 +- deps/v8/src/globals.h | 1 + deps/v8/src/handles.cc | 23 +- deps/v8/src/handles.h | 4 +- deps/v8/src/hashmap.cc | 5 +- deps/v8/src/heap-inl.h | 25 + deps/v8/src/heap.cc | 240 ++- deps/v8/src/heap.h | 40 +- deps/v8/src/ia32/codegen-ia32.cc | 22 +- deps/v8/src/ia32/codegen-ia32.h | 4 +- deps/v8/src/ia32/ic-ia32.cc | 156 +- deps/v8/src/ia32/macro-assembler-ia32.cc | 9 +- .../src/ia32/regexp-macro-assembler-ia32.cc | 25 +- .../v8/src/ia32/register-allocator-ia32-inl.h | 8 +- deps/v8/src/ia32/stub-cache-ia32.cc | 502 ++++- deps/v8/src/ic.cc | 59 +- deps/v8/src/ic.h | 36 +- deps/v8/src/interpreter-irregexp.cc | 8 +- deps/v8/src/jsregexp-inl.h | 260 --- deps/v8/src/jsregexp.cc | 8 +- deps/v8/src/jsregexp.h | 102 - deps/v8/src/log.cc | 32 +- deps/v8/src/log.h | 4 + deps/v8/src/messages.js | 41 +- deps/v8/src/objects-debug.cc | 94 +- deps/v8/src/objects-inl.h | 110 +- deps/v8/src/objects.cc | 1017 ++++++---- deps/v8/src/objects.h | 88 +- deps/v8/src/parser.cc | 29 +- deps/v8/src/platform-linux.cc | 76 +- deps/v8/src/platform-macos.cc | 23 +- deps/v8/src/platform-posix.cc | 14 +- deps/v8/src/prettyprinter.cc | 10 +- deps/v8/src/prettyprinter.h | 10 +- deps/v8/src/register-allocator.cc | 6 + deps/v8/src/register-allocator.h | 5 +- deps/v8/src/rewriter.cc | 9 +- deps/v8/src/runtime.cc | 158 +- deps/v8/src/serialize.cc | 6 +- deps/v8/src/spaces.cc | 6 +- deps/v8/src/spaces.h | 40 +- deps/v8/src/string-stream.cc | 6 - deps/v8/src/string-stream.h | 5 +- deps/v8/src/stub-cache.cc | 152 +- deps/v8/src/stub-cache.h | 29 +- deps/v8/src/usage-analyzer.cc | 4 +- deps/v8/src/version.cc | 6 +- deps/v8/src/x64/assembler-x64.cc | 87 +- deps/v8/src/x64/assembler-x64.h | 37 +- deps/v8/src/x64/builtins-x64.cc | 6 +- deps/v8/src/x64/codegen-x64.cc | 462 ++++- deps/v8/src/x64/codegen-x64.h | 4 +- deps/v8/src/x64/debug-x64.cc | 15 + deps/v8/src/x64/disasm-x64.cc | 698 ++++--- deps/v8/src/x64/ic-x64.cc | 613 ++++-- deps/v8/src/x64/macro-assembler-x64.cc | 173 +- deps/v8/src/x64/macro-assembler-x64.h | 6 +- deps/v8/src/x64/register-allocator-x64-inl.h | 8 +- deps/v8/src/x64/stub-cache-x64.cc | 1688 ++++++++++++++++- deps/v8/src/zone-inl.h | 217 +++ deps/v8/src/zone.cc | 5 +- deps/v8/src/zone.h | 102 + deps/v8/test/cctest/cctest.status | 12 +- deps/v8/test/cctest/test-api.cc | 610 ++++++ deps/v8/test/cctest/test-ast.cc | 4 +- deps/v8/test/cctest/test-debug.cc | 68 +- deps/v8/test/cctest/test-heap.cc | 4 +- deps/v8/test/cctest/test-log.cc | 40 +- deps/v8/test/cctest/test-mark-compact.cc | 5 +- deps/v8/test/cctest/test-regexp.cc | 2 +- deps/v8/test/message/message.status | 20 +- deps/v8/test/mjsunit/debug-stepin-accessor.js | 248 +++ deps/v8/test/mjsunit/debug-stepin-builtin.js | 78 + deps/v8/test/mjsunit/mjsunit.status | 67 +- .../test/mjsunit/regexp-call-as-function.js | 36 + .../v8/test/mjsunit/regress/regress-155924.js | 46 + deps/v8/test/mjsunit/regress/regress-345.js | 51 + deps/v8/test/mjsunit/regress/regress-406.js | 69 + deps/v8/test/mjsunit/stack-traces.js | 28 +- deps/v8/test/mjsunit/tools/codemap.js | 30 +- deps/v8/test/mjsunit/tools/profile.js | 4 +- .../mjsunit/tools/tickprocessor-test.default | 25 +- .../tools/tickprocessor-test.ignore-unknown | 25 +- .../tools/tickprocessor-test.separate-ic | 29 +- deps/v8/test/mjsunit/tools/tickprocessor.js | 131 +- deps/v8/test/mozilla/mozilla.status | 17 +- deps/v8/tools/codemap.js | 36 +- deps/v8/tools/gyp/v8.gyp | 35 +- deps/v8/tools/mac-nm | 18 + deps/v8/tools/mac-tick-processor | 6 + deps/v8/tools/process-heap-prof.py | 80 + deps/v8/tools/profile.js | 18 +- deps/v8/tools/test.py | 1 + deps/v8/tools/tickprocessor-driver.js | 8 +- deps/v8/tools/tickprocessor.js | 65 +- deps/v8/tools/v8.xcodeproj/project.pbxproj | 10 +- deps/v8/tools/visual_studio/v8_base.vcproj | 16 +- .../v8/tools/visual_studio/v8_base_arm.vcproj | 12 +- 124 files changed, 7951 insertions(+), 2392 deletions(-) mode change 100755 => 100644 deps/v8/benchmarks/run.html mode change 100755 => 100644 deps/v8/benchmarks/style.css create mode 100644 deps/v8/src/frame-element.cc delete mode 100644 deps/v8/src/jsregexp-inl.h create mode 100644 deps/v8/test/mjsunit/debug-stepin-accessor.js create mode 100644 deps/v8/test/mjsunit/debug-stepin-builtin.js create mode 100644 deps/v8/test/mjsunit/regexp-call-as-function.js create mode 100644 deps/v8/test/mjsunit/regress/regress-155924.js create mode 100644 deps/v8/test/mjsunit/regress/regress-345.js create mode 100644 deps/v8/test/mjsunit/regress/regress-406.js create mode 100755 deps/v8/tools/mac-nm create mode 100755 deps/v8/tools/mac-tick-processor create mode 100755 deps/v8/tools/process-heap-prof.py mode change 100755 => 100644 deps/v8/tools/v8.xcodeproj/project.pbxproj diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index 83ebc02530..a932e0bc30 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,50 @@ +2009-07-30: Version 1.3.1 + + Speed improvements to accessors and interceptors. + + Added support for capturing stack information on custom errors. + + Added support for morphing an object into a pixel array where its + indexed properties are stored in an external byte array. Values written + are always clamped to the 0..255 interval. + + Profiler on x64 now handles C/C++ functions from shared libraries. + + Changed the debugger to avoid stepping into function.call/apply if the + function is a built-in. + + Initial implementation of constructor heap profile for JS objects. + + More fine grained control of profiling aspects through the API. + + Optimized the called as constructor check for API calls. + + +2009-07-27: Version 1.3.0 + + Allowed RegExp objects to be called as functions (issue 132). + + Fixed issue where global property cells would escape after + detaching the global object; see http://crbug.com/16276. + + Added support for stepping into setters and getters in the + debugger. + + Changed the debugger to avoid stopping in its own JavaScript code + and in the code of built-in functions. + + Fixed issue 345 by avoiding duplicate escaping labels. + + Fixed ARM code generator crash in short-circuited boolean + expressions and added regression tests. + + Added an external allocation limit to avoid issues where small V8 + objects would hold on to large amounts of external memory without + causing garbage collections. + + Finished more of the inline caching stubs for x64 targets. + + 2009-07-13: Version 1.2.14 Added separate paged heap space for global property cells and diff --git a/deps/v8/SConstruct b/deps/v8/SConstruct index 78b050d735..dbcd616862 100644 --- a/deps/v8/SConstruct +++ b/deps/v8/SConstruct @@ -149,31 +149,22 @@ LIBRARY_FLAGS = { '-Wstrict-aliasing=2'], 'CPPPATH': ANDROID_INCLUDES, }, - 'wordsize:32': { - 'arch:x64': { - 'CCFLAGS': ['-m64'], - 'LINKFLAGS': ['-m64'] - } - }, - 'wordsize:64': { - 'arch:ia32': { - 'CCFLAGS': ['-m32'], - 'LINKFLAGS': ['-m32'] - }, - 'arch:arm': { - 'CCFLAGS': ['-m32'], - 'LINKFLAGS': ['-m32'] - } - }, 'arch:ia32': { - 'CPPDEFINES': ['V8_TARGET_ARCH_IA32'] + 'CPPDEFINES': ['V8_TARGET_ARCH_IA32'], + 'CCFLAGS': ['-m32'], + 'LINKFLAGS': ['-m32'] }, 'arch:arm': { 'CPPDEFINES': ['V8_TARGET_ARCH_ARM'] }, + 'simulator:arm': { + 'CCFLAGS': ['-m32'], + 'LINKFLAGS': ['-m32'] + }, 'arch:x64': { - 'CCFLAGS': ['-fno-strict-aliasing'], - 'CPPDEFINES': ['V8_TARGET_ARCH_X64'] + 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], + 'CCFLAGS': ['-fno-strict-aliasing', '-m64'], + 'LINKFLAGS': ['-m64'], }, 'prof:oprofile': { 'CPPDEFINES': ['ENABLE_OPROFILE_AGENT'] @@ -341,22 +332,6 @@ CCTEST_EXTRA_FLAGS = { 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] } }, - 'wordsize:32': { - 'arch:x64': { - 'CCFLAGS': ['-m64'], - 'LINKFLAGS': ['-m64'] - } - }, - 'wordsize:64': { - 'arch:ia32': { - 'CCFLAGS': ['-m32'], - 'LINKFLAGS': ['-m32'] - }, - 'arch:arm': { - 'CCFLAGS': ['-m32'], - 'LINKFLAGS': ['-m32'] - } - } }, 'msvc': { 'all': { @@ -408,21 +383,17 @@ SAMPLE_FLAGS = { 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] } }, - 'wordsize:32': { - 'arch:x64': { - 'CCFLAGS': ['-m64'], - 'LINKFLAGS': ['-m64'] - } + 'arch:ia32': { + 'CCFLAGS': ['-m32'], + 'LINKFLAGS': ['-m32'] }, - 'wordsize:64': { - 'arch:ia32': { - 'CCFLAGS': ['-m32'], - 'LINKFLAGS': ['-m32'] - }, - 'arch:arm': { - 'CCFLAGS': ['-m32'], - 'LINKFLAGS': ['-m32'] - } + 'arch:x64': { + 'CCFLAGS': ['-m64'], + 'LINKFLAGS': ['-m64'] + }, + 'simulator:arm': { + 'CCFLAGS': ['-m32'], + 'LINKFLAGS': ['-m32'] }, 'mode:release': { 'CCFLAGS': ['-O2'] @@ -533,7 +504,6 @@ def GuessToolchain(os): OS_GUESS = utils.GuessOS() TOOLCHAIN_GUESS = GuessToolchain(OS_GUESS) ARCH_GUESS = utils.GuessArchitecture() -WORDSIZE_GUESS = utils.GuessWordsize() SIMPLE_OPTIONS = { @@ -587,11 +557,6 @@ SIMPLE_OPTIONS = { 'default': 'on', 'help': 'use Microsoft Visual C++ link-time code generation' }, - 'wordsize': { - 'values': ['64', '32'], - 'default': WORDSIZE_GUESS, - 'help': 'the word size' - }, 'simulator': { 'values': ['arm', 'none'], 'default': 'none', diff --git a/deps/v8/benchmarks/run.html b/deps/v8/benchmarks/run.html old mode 100755 new mode 100644 index 050764e013..ef2c186412 --- a/deps/v8/benchmarks/run.html +++ b/deps/v8/benchmarks/run.html @@ -55,9 +55,35 @@ function Run() { NotifyScore: AddScore }); } +function ShowWarningIfObsolete() { + // If anything goes wrong we will just catch the exception and no + // warning is shown, i.e., no harm is done. + try { + var xmlhttp; + var next_version = parseInt(BenchmarkSuite.version) + 1; + var next_version_url = "../v" + next_version + "/run.html"; + if (window.XMLHttpRequest) { + xmlhttp = new window.XMLHttpRequest(); + } else if (window.ActiveXObject) { + xmlhttp = new window.ActiveXObject("Microsoft.XMLHTTP"); + } + xmlhttp.open('GET', next_version_url, true); + xmlhttp.onreadystatechange = function() { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { + document.getElementById('obsolete').style.display="block"; + } + }; + xmlhttp.send(null); + } catch(e) { + // Ignore exception if check for next version fails. + // Hence no warning is displayed. + } +} + function Load() { var version = BenchmarkSuite.version; document.getElementById("version").innerHTML = version; + ShowWarningIfObsolete(); setTimeout(Run, 200); } @@ -65,6 +91,12 @@ function Load() {

V8 Benchmark Suite - version ?

+
+Warning! This is not the latest version of the V8 benchmark +suite. Consider running the + +latest version. +
diff --git a/deps/v8/benchmarks/style.css b/deps/v8/benchmarks/style.css old mode 100755 new mode 100644 index 46320c1ebe..d9f4dbfc0c --- a/deps/v8/benchmarks/style.css +++ b/deps/v8/benchmarks/style.css @@ -55,6 +55,15 @@ div.run { border: 1px solid rgb(51, 102, 204); } +div.warning { + background: #ffffd9; + border: 1px solid #d2d26a; + display: none; + margin: 1em 0 2em; + padding: 8px; + text-align: center; +} + #status { text-align: center; margin-top: 50px; diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 8f22c81b65..5e3dbffb68 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -180,7 +180,7 @@ template class V8EXPORT_INLINE Handle { /** * Creates an empty handle. */ - Handle(); + inline Handle(); /** * Creates a new handle for the specified value. @@ -264,7 +264,7 @@ template class V8EXPORT_INLINE Handle { */ template class V8EXPORT_INLINE Local : public Handle { public: - Local(); + inline Local(); template inline Local(Local that) : Handle(reinterpret_cast(*that)) { /** @@ -284,7 +284,7 @@ template class V8EXPORT_INLINE Local : public Handle { * The referee is kept alive by the local handle even when * the original handle is destroyed/disposed. */ - static Local New(Handle that); + inline static Local New(Handle that); }; @@ -312,7 +312,7 @@ template class V8EXPORT_INLINE Persistent : public Handle { * Creates an empty persistent handle that doesn't point to any * storage cell. */ - Persistent(); + inline Persistent(); /** * Creates a persistent handle for the same storage cell as the @@ -353,7 +353,7 @@ template class V8EXPORT_INLINE Persistent : public Handle { * Creates a new persistent handle for an existing local or * persistent handle. */ - static Persistent New(Handle that); + inline static Persistent New(Handle that); /** * Releases the storage cell referenced by this persistent handle. @@ -361,7 +361,7 @@ template class V8EXPORT_INLINE Persistent : public Handle { * This handle's reference, and any any other references to the storage * cell remain and IsEmpty will still return false. */ - void Dispose(); + inline void Dispose(); /** * Make the reference to this object weak. When only weak handles @@ -369,20 +369,20 @@ template class V8EXPORT_INLINE Persistent : public Handle { * callback to the given V8::WeakReferenceCallback function, passing * it the object reference and the given parameters. */ - void MakeWeak(void* parameters, WeakReferenceCallback callback); + inline void MakeWeak(void* parameters, WeakReferenceCallback callback); /** Clears the weak reference to this object.*/ - void ClearWeak(); + inline void ClearWeak(); /** *Checks if the handle holds the only reference to an object. */ - bool IsNearDeath() const; + inline bool IsNearDeath() const; /** * Returns true if the handle's reference is weak. */ - bool IsWeak() const; + inline bool IsWeak() const; private: friend class ImplementationUtilities; @@ -1113,6 +1113,13 @@ class V8EXPORT Object : public Value { /** Sets the value in an internal field. */ void SetInternalField(int index, Handle value); + // The two functions below do not perform index bounds checks and + // they do not check that the VM is still running. Use with caution. + /** Gets a native pointer from an internal field. */ + void* GetPointerFromInternalField(int index); + /** Sets a native pointer in an internal field. */ + void SetPointerInInternalField(int index, void* value); + // Testers for local properties. bool HasRealNamedProperty(Handle key); bool HasRealIndexedProperty(uint32_t index); @@ -1162,6 +1169,15 @@ class V8EXPORT Object : public Value { */ Local Clone(); + /** + * Set the backing store of the indexed properties to be managed by the + * embedding layer. Access to the indexed properties will follow the rules + * spelled out in CanvasPixelArray. + * Note: The embedding program still owns the data and needs to ensure that + * the backing store is preserved while V8 has a reference. + */ + void SetIndexedPropertiesToPixelData(uint8_t* data, int length); + static Local New(); static Object* Cast(Value* obj); private: @@ -1950,6 +1966,20 @@ typedef void (*GCCallback)(); typedef Persistent (*ContextGenerator)(); +/** + * Profiler modules. + * + * In V8, profiler consists of several modules: CPU profiler, and different + * kinds of heap profiling. Each can be turned on / off independently. + */ +enum ProfilerModules { + PROFILER_MODULE_NONE = 0, + PROFILER_MODULE_CPU = 1, + PROFILER_MODULE_HEAP_STATS = 1 << 1, + PROFILER_MODULE_JS_CONSTRUCTORS = 1 << 2 +}; + + /** * Container class for static utility functions. */ @@ -2103,6 +2133,32 @@ class V8EXPORT V8 { */ static bool IsProfilerPaused(); + /** + * Resumes specified profiler modules. + * "ResumeProfiler" is equivalent to "ResumeProfilerEx(PROFILER_MODULE_CPU)". + * See ProfilerModules enum. + * + * \param flags Flags specifying profiler modules. + */ + static void ResumeProfilerEx(int flags); + + /** + * Pauses specified profiler modules. + * "PauseProfiler" is equivalent to "PauseProfilerEx(PROFILER_MODULE_CPU)". + * See ProfilerModules enum. + * + * \param flags Flags specifying profiler modules. + */ + static void PauseProfilerEx(int flags); + + /** + * Returns active (resumed) profiler modules. + * See ProfilerModules enum. + * + * \returns active profiler modules. + */ + static int GetActiveProfilerModules(); + /** * If logging is performed into a memory buffer (via --logfile=*), allows to * retrieve previously written messages. This can be used for retrieving diff --git a/deps/v8/src/SConscript b/deps/v8/src/SConscript index f1ca8753c2..f9f9634081 100755 --- a/deps/v8/src/SConscript +++ b/deps/v8/src/SConscript @@ -40,7 +40,7 @@ SOURCES = { 'codegen.cc', 'compilation-cache.cc', 'compiler.cc', 'contexts.cc', 'conversions.cc', 'counters.cc', 'dateparser.cc', 'debug.cc', 'debug-agent.cc', 'disassembler.cc', 'execution.cc', 'factory.cc', - 'flags.cc', 'frames.cc', 'func-name-inferrer.cc', + 'flags.cc', 'frame-element.cc', 'frames.cc', 'func-name-inferrer.cc', 'global-handles.cc', 'handles.cc', 'hashmap.cc', 'heap.cc', 'ic.cc', 'interpreter-irregexp.cc', 'jsregexp.cc', 'jump-target.cc', 'log.cc', 'log-utils.cc', 'mark-compact.cc', 'messages.cc', diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index b9e0cec8b6..08281012bd 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -1085,8 +1085,9 @@ Local