Skip to content

Commit

Permalink
Upgrade V8 to v3.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Aug 12, 2011
1 parent fb7faef commit 89bed19
Show file tree
Hide file tree
Showing 103 changed files with 3,959 additions and 2,069 deletions.
1 change: 0 additions & 1 deletion deps/v8/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ shell_g
/tools/visual_studio/Release
/xcodebuild/
TAGS
Makefile
*.Makefile
18 changes: 18 additions & 0 deletions deps/v8/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
2011-08-10: Version 3.5.4

Added a preliminary implementation of ES Harmony weak maps. Weak
maps can be enabled by the flag --harmony-weakmaps.

Introduced a toplevel Makefile to support GYP-based building. GYP
can be obtained from http://gyp.googlecode.com.

Fixed a bug in the length property of functions created by
Function.prototype.bind.

Reduced malloc heap allocation on process startup.

Several important code generation bug fixes.

Performance improvements on all platforms.


2011-08-03: Version 3.5.3

MIPS: Port of fix to ClassOf check from ARM.
Expand Down
110 changes: 110 additions & 0 deletions deps/v8/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Copyright 2011 the V8 project authors. All rights reserved.
# 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.
# * 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.
#
# 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.


# Variable default definitions. Override them by exporting them in your shell.
CXX ?= "g++" # For distcc: export CXX="distcc g++"
LINK ?= "g++"
OUTDIR ?= out
TESTJOBS ?= -j16
GYPFLAGS ?= -Dv8_can_use_vfp_instructions=true

# Architectures and modes to be compiled.
ARCHES = ia32 x64 arm
MODES = release debug

# List of files that trigger Makefile regeneration:
GYPFILES = build/all.gyp build/common.gypi build/v8-features.gypi \
preparser/preparser.gyp samples/samples.gyp src/d8.gyp \
test/cctest/cctest.gyp tools/gyp/v8.gyp

# Generates all combinations of ARCHES and MODES, e.g. "ia32.release".
BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES)))
CHECKS = $(addsuffix .check,$(BUILDS))
# Generates corresponding test targets, e.g. "ia32.release.check".

.PHONY: all release debug ia32 x64 arm $(BUILDS)

# Target definitions. "all" is the default, you can specify any others on the
# command line, e.g. "make ia32". Targets defined in $(BUILDS), e.g.
# "ia32.debug", can also be specified.
all: release debug

release: $(addsuffix .release,$(ARCHES))

debug: $(addsuffix .debug,$(ARCHES))

ia32: $(addprefix ia32.,$(MODES))

x64: $(addprefix x64.,$(MODES))

arm: $(addprefix arm.,$(MODES))

.SECONDEXPANSION:
$(BUILDS): $(OUTDIR)/Makefile-$$(basename $$@)
@$(MAKE) -C "$(OUTDIR)" -f Makefile-$(basename $@) \
CXX="$(CXX)" LINK="$(LINK)" \
BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
python -c "print raw_input().capitalize()") \
builddir="$(shell pwd)/$(OUTDIR)/$@"

# Test targets.
check: all
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)

$(addsuffix .check,$(MODES)): $$(basename $$@)
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) --mode=$(basename $@)

$(addsuffix .check,$(ARCHES)): $$(basename $$@)
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) --arch=$(basename $@)

$(CHECKS): $$(basename $$@)
@tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) --arch-and-mode=$(basename $@)

# Clean targets. You can clean each architecture individually, or everything.
$(addsuffix .clean,$(ARCHES)):
rm -f $(OUTDIR)/Makefile-$(basename $@)
rm -rf $(OUTDIR)/$(basename $@).release
rm -rf $(OUTDIR)/$(basename $@).debug

clean: $(addsuffix .clean,$(ARCHES))

# GYP file generation targets.
$(OUTDIR)/Makefile-ia32: $(GYPFILES)
build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-Ibuild/common.gypi --depth=. -Dtarget_arch=ia32 -S-ia32 \
$(GYPFLAGS)

$(OUTDIR)/Makefile-x64: $(GYPFILES)
build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-Ibuild/common.gypi --depth=. -Dtarget_arch=x64 -S-x64 \
$(GYPFLAGS)

$(OUTDIR)/Makefile-arm: $(GYPFILES) build/armu.gypi
build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-Ibuild/common.gypi --depth=. -Ibuild/armu.gypi -S-arm \
$(GYPFLAGS)
84 changes: 75 additions & 9 deletions deps/v8/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,19 @@ LIBRARY_FLAGS = {
}
},
'armeabi:softfp' : {
'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0', 'CAN_USE_VFP_INSTRUCTIONS'],
'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
'vfp3:on': {
'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']
},
'simulator:none': {
'CCFLAGS': ['-mfloat-abi=softfp'],
}
},
'armeabi:hard' : {
'CPPDEFINES' : ['USE_EABI_HARDFLOAT=1', 'CAN_USE_VFP_INSTRUCTIONS'],
'CPPDEFINES' : ['USE_EABI_HARDFLOAT=1'],
'vfp3:on': {
'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']
},
'simulator:none': {
'CCFLAGS': ['-mfloat-abi=hard'],
}
Expand Down Expand Up @@ -436,7 +442,7 @@ CCTEST_EXTRA_FLAGS = {
},
'arch:x64': {
'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
'LINKFLAGS': ['/STACK:2091752']
'LINKFLAGS': ['/STACK:2097152']
},
}
}
Expand Down Expand Up @@ -496,7 +502,10 @@ SAMPLE_FLAGS = {
}
},
'armeabi:hard' : {
'CPPDEFINES' : ['USE_EABI_HARDFLOAT=1', 'CAN_USE_VFP_INSTRUCTIONS'],
'CPPDEFINES' : ['USE_EABI_HARDFLOAT=1'],
'vfp3:on': {
'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']
},
'simulator:none': {
'CCFLAGS': ['-mfloat-abi=hard'],
}
Expand Down Expand Up @@ -601,7 +610,7 @@ SAMPLE_FLAGS = {
},
'arch:x64': {
'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'],
'LINKFLAGS': ['/MACHINE:X64', '/STACK:2091752']
'LINKFLAGS': ['/MACHINE:X64', '/STACK:2097152']
},
'mode:debug': {
'CCFLAGS': ['/Od'],
Expand Down Expand Up @@ -756,7 +765,7 @@ PREPARSER_FLAGS = {
},
'arch:x64': {
'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'],
'LINKFLAGS': ['/MACHINE:X64', '/STACK:2091752']
'LINKFLAGS': ['/MACHINE:X64', '/STACK:2097152']
},
'mode:debug': {
'CCFLAGS': ['/Od'],
Expand Down Expand Up @@ -822,6 +831,57 @@ D8_FLAGS = {
'msvc': {
'all': {
'LIBS': ['winmm', 'ws2_32']
},
'verbose:off': {
'CCFLAGS': ['/nologo'],
'LINKFLAGS': ['/NOLOGO']
},
'verbose:on': {
'LINKFLAGS': ['/VERBOSE']
},
'prof:on': {
'LINKFLAGS': ['/MAP']
},
'mode:release': {
'CCFLAGS': ['/O2'],
'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'],
'msvcrt:static': {
'CCFLAGS': ['/MT']
},
'msvcrt:shared': {
'CCFLAGS': ['/MD']
},
'msvcltcg:on': {
'CCFLAGS': ['/GL'],
'pgo:off': {
'LINKFLAGS': ['/LTCG'],
},
},
'pgo:instrument': {
'LINKFLAGS': ['/LTCG:PGI']
},
'pgo:optimize': {
'LINKFLAGS': ['/LTCG:PGO']
}
},
'arch:ia32': {
'CPPDEFINES': ['V8_TARGET_ARCH_IA32', 'WIN32'],
'LINKFLAGS': ['/MACHINE:X86']
},
'arch:x64': {
'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'],
'LINKFLAGS': ['/MACHINE:X64', '/STACK:2097152']
},
'mode:debug': {
'CCFLAGS': ['/Od'],
'LINKFLAGS': ['/DEBUG'],
'CPPDEFINES': ['DEBUG'],
'msvcrt:static': {
'CCFLAGS': ['/MTd']
},
'msvcrt:shared': {
'CCFLAGS': ['/MDd']
}
}
}
}
Expand Down Expand Up @@ -1039,6 +1099,12 @@ SIMPLE_OPTIONS = {
'default': 'off',
'help': 'compress startup data (snapshot) [Linux only]'
},
'vfp3': {
'values': ['on', 'off'],
'default': 'on',
'help': 'use vfp3 instructions when building the snapshot [Arm only]'
},

}

ALL_OPTIONS = dict(PLATFORM_OPTIONS, **SIMPLE_OPTIONS)
Expand Down Expand Up @@ -1343,10 +1409,12 @@ def BuildSpecific(env, mode, env_overrides, tools):
env['SONAME'] = soname

# Build the object files by invoking SCons recursively.
d8_env = Environment(tools=tools)
d8_env.Replace(**context.flags['d8'])
(object_files, shell_files, mksnapshot, preparser_files) = env.SConscript(
join('src', 'SConscript'),
build_dir=join('obj', target_id),
exports='context tools',
exports='context tools d8_env',
duplicate=False
)

Expand Down Expand Up @@ -1375,8 +1443,6 @@ def BuildSpecific(env, mode, env_overrides, tools):
context.library_targets.append(library)
context.library_targets.append(preparser_library)

d8_env = Environment(tools=tools)
d8_env.Replace(**context.flags['d8'])
context.ApplyEnvOverrides(d8_env)
if context.options['library'] == 'static':
shell = d8_env.Program('d8' + suffix, object_files + shell_files)
Expand Down
3 changes: 2 additions & 1 deletion deps/v8/build/all.gyp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

Expand All @@ -8,6 +8,7 @@
'target_name': 'All',
'type': 'none',
'dependencies': [
'../preparser/preparser.gyp:*',
'../samples/samples.gyp:*',
'../src/d8.gyp:d8',
],
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/build/armu.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
'armv7': 1,
'arm_neon': 0,
'arm_fpu': 'vfpv3',
}
},
}
27 changes: 23 additions & 4 deletions deps/v8/build/common.gypi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2010 the V8 project authors. All rights reserved.
# Copyright 2011 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
Expand Down Expand Up @@ -30,6 +30,7 @@
'library%': 'static_library',
'component%': 'static_library',
'visibility%': 'hidden',
'msvs_multi_core_compile%': '1',
'variables': {
'conditions': [
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
Expand All @@ -46,23 +47,41 @@
'host_arch%': '<(host_arch)',
'target_arch%': '<(host_arch)',
'v8_target_arch%': '<(target_arch)',
'v8_enable_debugger_support%': 1,
'conditions': [
['(target_arch=="arm" and host_arch!="arm") or \
(target_arch=="x64" and host_arch!="x64")', {
'want_separate_host_toolset': 1,
}, {
'want_separate_host_toolset': 0,
}],
],
},
'target_defaults': {
'default_configuration': 'Debug',
'conditions': [
['v8_enable_debugger_support==1', {
'defines': ['ENABLE_DEBUGGER_SUPPORT',],
},
],
],
'configurations': {
'Debug': {
'cflags': [ '-g', '-O0' ],
'defines': [ 'ENABLE_DISASSEMBLER', 'DEBUG' ],
'defines': [ 'ENABLE_DISASSEMBLER', 'DEBUG', 'V8_ENABLE_CHECKS',
'OBJECT_PRINT' ],
},
'Release': {
'cflags': [ '-O3', '-fomit-frame-pointer', '-fdata-sections', '-ffunction-sections' ],
'cflags': [ '-O3', '-fomit-frame-pointer', '-fdata-sections',
'-ffunction-sections' ],
},
},
},
'conditions': [
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
'target_defaults': {
'cflags': [ '-Wall', '-pthread', '-fno-rtti', '-fno-exceptions' ],
'cflags': [ '-Wall', '-pthread', '-fno-rtti', '-fno-exceptions',
'-pedantic' ],
'ldflags': [ '-pthread', ],
'conditions': [
[ 'target_arch=="ia32"', {
Expand Down
7 changes: 7 additions & 0 deletions deps/v8/build/v8-features.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@
'USE_EABI_HARDFLOAT=1',
'CAN_USE_VFP_INSTRUCTIONS',
],
'cflags': [
'-mfloat-abi=hard',
],
}, {
'defines': [
'USE_EABI_HARDFLOAT=0',
],
}],
],
}],
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -3606,7 +3606,7 @@ class V8EXPORT Locker {
/**
* Returns whether v8::Locker is being used by this V8 instance.
*/
static bool IsActive() { return active_; }
static bool IsActive();

private:
bool has_lock_;
Expand Down
Loading

0 comments on commit 89bed19

Please sign in to comment.