diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index 0786ed9296..5b1240df8b 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,20 @@ +2010-03-25: Version 2.1.9 + + Added API support for reattaching a global object to a context. + + Extended debugger API with access to the internal debugger context. + + Fixed Chromium crashes (issues http://crbug.com/39128 and + http://crbug.com/39160) + + +2010-03-24: Version 2.1.8 + + Added fine-grained garbage collection callbacks to the API. + + Performance improvements on all platforms. + + 2010-03-22: Version 2.1.7 Fixed issue 650. diff --git a/deps/v8/SConstruct b/deps/v8/SConstruct index dd26cb4147..bef64eb2d4 100644 --- a/deps/v8/SConstruct +++ b/deps/v8/SConstruct @@ -90,7 +90,7 @@ ANDROID_LINKFLAGS = ['-nostdlib', '-Wl,-z,nocopyreloc', '-Wl,-rpath-link=' + ANDROID_TOP + '/out/target/product/generic/obj/lib', ANDROID_TOP + '/out/target/product/generic/obj/lib/crtbegin_dynamic.o', - ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/lib/gcc/arm-eabi/4.2.1/interwork/libgcc.a', + ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork/libgcc.a', ANDROID_TOP + '/out/target/product/generic/obj/lib/crtend_android.o']; LIBRARY_FLAGS = { @@ -275,6 +275,7 @@ V8_EXTRA_FLAGS = { 'gcc': { 'all': { 'WARNINGFLAGS': ['-Wall', + '-Werror', '-W', '-Wno-unused-parameter', '-Wnon-virtual-dtor'] @@ -370,7 +371,6 @@ DTOA_EXTRA_FLAGS = { CCTEST_EXTRA_FLAGS = { 'all': { 'CPPPATH': [join(root_dir, 'src')], - 'LIBS': ['$LIBRARY'] }, 'gcc': { 'all': { @@ -400,9 +400,10 @@ CCTEST_EXTRA_FLAGS = { '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], 'CCFLAGS': ANDROID_FLAGS, 'CPPPATH': ANDROID_INCLUDES, - 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'], + 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib', + ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork'], 'LINKFLAGS': ANDROID_LINKFLAGS, - 'LIBS': ['log', 'c', 'stdc++', 'm'], + 'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'], 'mode:release': { 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] } @@ -430,7 +431,6 @@ CCTEST_EXTRA_FLAGS = { SAMPLE_FLAGS = { 'all': { 'CPPPATH': [join(abspath('.'), 'include')], - 'LIBS': ['$LIBRARY'], }, 'gcc': { 'all': { @@ -464,9 +464,10 @@ SAMPLE_FLAGS = { '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'], 'CCFLAGS': ANDROID_FLAGS, 'CPPPATH': ANDROID_INCLUDES, - 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'], + 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib', + ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork'], 'LINKFLAGS': ANDROID_LINKFLAGS, - 'LIBS': ['log', 'c', 'stdc++', 'm'], + 'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'], 'mode:release': { 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG'] } @@ -589,9 +590,10 @@ D8_FLAGS = { 'LIBS': ['pthread'], }, 'os:android': { - 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib'], + 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib', + ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork'], 'LINKFLAGS': ANDROID_LINKFLAGS, - 'LIBS': ['log', 'c', 'stdc++', 'm'], + 'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'], }, 'os:win32': { 'LIBS': ['winmm', 'ws2_32'], @@ -987,7 +989,6 @@ def BuildSpecific(env, mode, env_overrides): if context.options['soname'] == 'on': # When building shared object with SONAME version the library name. library_name += '-' + version - env['LIBRARY'] = library_name # Generate library SONAME if required by the build. if context.options['soname'] == 'on': @@ -1008,6 +1009,7 @@ def BuildSpecific(env, mode, env_overrides): # Link the object files into a library. env.Replace(**context.flags['v8']) + env.Prepend(LIBS=[library_name]) context.ApplyEnvOverrides(env) if context.options['library'] == 'static': @@ -1027,8 +1029,9 @@ def BuildSpecific(env, mode, env_overrides): context.d8_targets.append(shell) for sample in context.samples: - sample_env = Environment(LIBRARY=library_name) + sample_env = Environment() sample_env.Replace(**context.flags['sample']) + sample_env.Prepend(LIBS=[library_name]) context.ApplyEnvOverrides(sample_env) sample_object = sample_env.SConscript( join('samples', 'SConscript'), diff --git a/deps/v8/include/v8-debug.h b/deps/v8/include/v8-debug.h index 2e5fb3fde9..f7b4fa12e3 100644 --- a/deps/v8/include/v8-debug.h +++ b/deps/v8/include/v8-debug.h @@ -237,9 +237,10 @@ class EXPORT Debug { * With this call the debugger is entered and the function specified is called * with the execution state as the first argument. This makes it possible to * get access to information otherwise not available during normal JavaScript - * execution e.g. details on stack frames. The following example show a - * JavaScript function which when passed to v8::Debug::Call will return the - * current line of JavaScript execution. + * execution e.g. details on stack frames. Receiver of the function call will + * be the debugger context global object, however this is a subject to change. + * The following example show a JavaScript function which when passed to + * v8::Debug::Call will return the current line of JavaScript execution. * * \code * function frame_source_line(exec_state) { @@ -302,6 +303,14 @@ class EXPORT Debug { * of this method. */ static void ProcessDebugMessages(); + + /** + * Debugger is running in it's own context which is entered while debugger + * messages are being dispatched. This is an explicit getter for this + * debugger context. Note that the content of the debugger context is subject + * to change. + */ + static Local GetDebugContext(); }; diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index bed86cabd0..7b42178782 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -2158,12 +2158,26 @@ typedef void (*FailedAccessCheckCallback)(Local target, // --- G a r b a g e C o l l e c t i o n C a l l b a c k s /** - * Applications can register a callback function which is called - * before and after a major garbage collection. Allocations are not - * allowed in the callback function, you therefore cannot manipulate + * Applications can register callback functions which will be called + * before and after a garbage collection. Allocations are not + * allowed in the callback functions, you therefore cannot manipulate * objects (set or delete properties for example) since it is possible * such operations will result in the allocation of objects. */ +enum GCType { + kGCTypeScavenge = 1 << 0, + kGCTypeMarkSweepCompact = 1 << 1, + kGCTypeAll = kGCTypeScavenge | kGCTypeMarkSweepCompact +}; + +enum GCCallbackFlags { + kNoGCCallbackFlags = 0, + kGCCallbackFlagCompacted = 1 << 0 +}; + +typedef void (*GCPrologueCallback)(GCType type, GCCallbackFlags flags); +typedef void (*GCEpilogueCallback)(GCType type, GCCallbackFlags flags); + typedef void (*GCCallback)(); @@ -2299,7 +2313,27 @@ class V8EXPORT V8 { /** * Enables the host application to receive a notification before a - * major garbage colletion. Allocations are not allowed in the + * garbage collection. Allocations are not allowed in the + * callback function, you therefore cannot manipulate objects (set + * or delete properties for example) since it is possible such + * operations will result in the allocation of objects. It is possible + * to specify the GCType filter for your callback. But it is not possible to + * register the same callback function two times with different + * GCType filters. + */ + static void AddGCPrologueCallback( + GCPrologueCallback callback, GCType gc_type_filter = kGCTypeAll); + + /** + * This function removes callback which was installed by + * AddGCPrologueCallback function. + */ + static void RemoveGCPrologueCallback(GCPrologueCallback callback); + + /** + * The function is deprecated. Please use AddGCPrologueCallback instead. + * Enables the host application to receive a notification before a + * garbage collection. Allocations are not allowed in the * callback function, you therefore cannot manipulate objects (set * or delete properties for example) since it is possible such * operations will result in the allocation of objects. @@ -2307,6 +2341,26 @@ class V8EXPORT V8 { static void SetGlobalGCPrologueCallback(GCCallback); /** + * Enables the host application to receive a notification after a + * garbage collection. Allocations are not allowed in the + * callback function, you therefore cannot manipulate objects (set + * or delete properties for example) since it is possible such + * operations will result in the allocation of objects. It is possible + * to specify the GCType filter for your callback. But it is not possible to + * register the same callback function two times with different + * GCType filters. + */ + static void AddGCEpilogueCallback( + GCEpilogueCallback callback, GCType gc_type_filter = kGCTypeAll); + + /** + * This function removes callback which was installed by + * AddGCEpilogueCallback function. + */ + static void RemoveGCEpilogueCallback(GCEpilogueCallback callback); + + /** + * The function is deprecated. Please use AddGCEpilogueCallback instead. * Enables the host application to receive a notification after a * major garbage collection. Allocations are not allowed in the * callback function, you therefore cannot manipulate objects (set @@ -2681,9 +2735,21 @@ class V8EXPORT Context { */ void DetachGlobal(); + /** + * Reattaches a global object to a context. This can be used to + * restore the connection between a global object and a context + * after DetachGlobal has been called. + * + * \param global_object The global object to reattach to the + * context. For this to work, the global object must be the global + * object that was associated with this context before a call to + * DetachGlobal. + */ + void ReattachGlobal(Handle global_object); + /** Creates a new context. */ static Persistent New( - ExtensionConfiguration* extensions = 0, + ExtensionConfiguration* extensions = NULL, Handle global_template = Handle(), Handle global_object = Handle()); diff --git a/deps/v8/src/SConscript b/deps/v8/src/SConscript index bf42fd4e61..e7f6efd143 100755 --- a/deps/v8/src/SConscript +++ b/deps/v8/src/SConscript @@ -113,6 +113,8 @@ SOURCES = { """), 'arch:arm': Split(""" fast-codegen.cc + jump-target-light.cc + virtual-frame-light.cc arm/builtins-arm.cc arm/codegen-arm.cc arm/constants-arm.cc @@ -156,6 +158,8 @@ SOURCES = { mips/virtual-frame-mips.cc """), 'arch:ia32': Split(""" + jump-target-heavy.cc + virtual-frame-heavy.cc ia32/assembler-ia32.cc ia32/builtins-ia32.cc ia32/codegen-ia32.cc @@ -175,6 +179,8 @@ SOURCES = { """), 'arch:x64': Split(""" fast-codegen.cc + jump-target-heavy.cc + virtual-frame-heavy.cc x64/assembler-x64.cc x64/builtins-x64.cc x64/codegen-x64.cc @@ -252,12 +258,12 @@ uri.js math.js messages.js apinatives.js -debug-delay.js -liveedit-delay.js -mirror-delay.js -date-delay.js -regexp-delay.js -json-delay.js +date.js +regexp.js +json.js +liveedit-debugger.js +mirror-debugger.js +debug-debugger.js '''.split() diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index b2f0e03406..2100480e85 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -537,10 +537,17 @@ i::Object** v8::HandleScope::RawClose(i::Object** value) { LOG_API("CloseHandleScope"); // Read the result before popping the handle block. - i::Object* result = *value; + i::Object* result = NULL; + if (value != NULL) { + result = *value; + } is_closed_ = true; i::HandleScope::Leave(&previous_); + if (value == NULL) { + return NULL; + } + // Allocate a new handle on the previous handle block. i::Handle handle(result); return handle.location(); @@ -1136,7 +1143,7 @@ Local