All builders that used level 1 should meanwhile define
v8_enable_slow_dchecks, and so they can use level 2 without losing
coverage. Level 2, however, is considerably faster, so we want to use it
on those builders as well. The make optdebug setting is not affected by
this change.
BUG=none
R=machenbach@chromium.org
LOG=n
Review URL: https://codereview.chromium.org/
847753002
Cr-Commit-Position: refs/heads/master@{#26019}
ifeq ($(vtunejit), on)
GYPFLAGS += -Dv8_enable_vtunejit=1
endif
-# optdebug=on
-ifeq ($(optdebug), on)
- GYPFLAGS += -Dv8_optimized_debug=2
-endif
# unalignedaccess=on
ifeq ($(unalignedaccess), on)
GYPFLAGS += -Dv8_can_use_unaligned_accesses=true
-Dv8_target_arch=$(V8_TARGET_ARCH) \
$(if $(findstring $(CXX_TARGET_ARCH),$(V8_TARGET_ARCH)), \
-Dtarget_arch=$(V8_TARGET_ARCH),) \
- $(if $(findstring optdebug,$@),-Dv8_optimized_debug=2,) \
+ $(if $(findstring optdebug,$@),-Dv8_optimized_debug=1,) \
-S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS)
$(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE)
# Speeds up Debug builds:
# 0 - Compiler optimizations off (debuggable) (default). This may
# be 5x slower than Release (or worse).
- # 1 - Turn on compiler optimizations. This may be hard or impossible to
- # debug. This may still be 2x slower than Release (or worse).
- # 2 - Turn on optimizations, and also #undef DEBUG / #define NDEBUG
- # (but leave V8_ENABLE_CHECKS and most other assertions enabled.
- # This may cause some v8 tests to fail in the Debug configuration.
- # This roughly matches the performance of a Release build and can
- # be used by embedders that need to build their own code as debug
- # but don't want or need a debug version of V8. This should produce
- # near-release speeds.
+ # 1 - Turn on optimizations and disable slow DCHECKs, but leave
+ # V8_ENABLE_CHECKS and most other assertions enabled. This may cause
+ # some v8 tests to fail in the Debug configuration. This roughly
+ # matches the performance of a Release build and can be used by
+ # embedders that need to build their own code as debug but don't want
+ # or need a debug version of V8. This should produce near-release
+ # speeds.
'v8_optimized_debug%': 0,
# Use external files for startup data blobs:
],
},
'Optdebug': {
- 'inherit_from': [ 'DebugBaseCommon', 'DebugBase2' ],
+ 'inherit_from': [ 'DebugBaseCommon', 'DebugBase1' ],
},
'Debug': {
# Xcode insists on this empty entry.
}, # DebugBase0
# Abstract configuration for v8_optimized_debug == 1.
'DebugBase1': {
- 'abstract': 1,
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'Optimization': '1',
- 'InlineFunctionExpansion': '2',
- 'EnableIntrinsicFunctions': 'true',
- 'FavorSizeOrSpeed': '0',
- 'StringPooling': 'true',
- 'BasicRuntimeChecks': '0',
- 'conditions': [
- ['component=="shared_library"', {
- 'RuntimeLibrary': '3', # /MDd
- }, {
- 'RuntimeLibrary': '1', # /MTd
- }],
- ],
- },
- 'VCLinkerTool': {
- 'LinkIncremental': '2',
- },
- },
- 'variables': {
- 'v8_enable_slow_dchecks%': 1,
- },
- 'conditions': [
- ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
- OS=="qnx"', {
- 'cflags!': [
- '-O0',
- '-O3', # TODO(2807) should be -O1.
- '-O2',
- '-Os',
- ],
- 'cflags': [
- '-fdata-sections',
- '-ffunction-sections',
- '-O1', # TODO(2807) should be -O3.
- ],
- }],
- ['OS=="mac"', {
- 'xcode_settings': {
- 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
- 'GCC_STRICT_ALIASING': 'YES',
- },
- }],
- ['v8_enable_slow_dchecks==1', {
- 'defines': [
- 'ENABLE_SLOW_DCHECKS',
- ],
- }],
- ],
- }, # DebugBase1
- # Abstract configuration for v8_optimized_debug == 2.
- 'DebugBase2': {
'abstract': 1,
'msvs_settings': {
'VCCLCompilerTool': {
],
}],
],
- }, # DebugBase2
+ }, # DebugBase1
# Common settings for the Debug configuration.
'DebugBaseCommon': {
'abstract': 1,
'conditions': [
['v8_optimized_debug==0', {
'inherit_from': ['DebugBase0'],
- }],
- ['v8_optimized_debug==1', {
+ }, {
'inherit_from': ['DebugBase1'],
}],
- ['v8_optimized_debug==2', {
- 'inherit_from': ['DebugBase2'],
- }],
],
}, # Debug
'Release': {
// backing store (e.g. Add).
inline T& operator[](int i) const {
DCHECK(0 <= i);
- SLOW_DCHECK(i < length_);
+ SLOW_DCHECK(static_cast<unsigned>(i) < static_cast<unsigned>(length_));
return data_[i];
}
inline T& at(int i) const { return operator[](i); }
// Returns a vector using the same backing storage as this one,
// spanning from and including 'from', to but not including 'to'.
Vector<T> SubVector(int from, int to) {
- SLOW_DCHECK(to <= length_);
- SLOW_DCHECK(from < to);
DCHECK(0 <= from);
+ SLOW_DCHECK(from < to);
+ SLOW_DCHECK(static_cast<unsigned>(to) <= static_cast<unsigned>(length_));
return Vector<T>(start() + from, to - from);
}