Reviewers: vogelheim,
Description:
Introduce a new gyp flag to warn about to be deprecated APIs
This should help to keep syntax errors from creeping into v8.h
Also, I'll remove usages of to-be-deprecated APIs and turn this flag on
for standalone builds
BUG=4134
[email protected]
LOG=n
Please review this at https://codereview.chromium.org/1149633003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+27, -4 lines):
M Makefile
M build/features.gypi
M build/standalone.gypi
M include/v8.h
M include/v8config.h
Index: Makefile
diff --git a/Makefile b/Makefile
index
db6cf3b7da534a90d16e262b9c81601cc8dd4419..deab053ce2f04406f83c73d1ebd469ec4a00922d
100644
--- a/Makefile
+++ b/Makefile
@@ -149,6 +149,10 @@ endif
ifeq ($(deprecationwarnings), on)
GYPFLAGS += -Dv8_deprecation_warnings=1
endif
+# imminent_deprecation_warnings=on
+ifeq ($(imminent_deprecationwarnings), on)
+ GYPFLAGS += -Dv8_imminent_deprecation_warnings=1
+endif
# asan=on
ifeq ($(asan), on)
GYPFLAGS += -Dasan=1 -Dclang=1
Index: build/features.gypi
diff --git a/build/features.gypi b/build/features.gypi
index
a3ee0fbbf08cd52e768984be9403ad8426c7eff3..cb69f880ef96cc7d7f7f94647764aa8ebfd21af9
100644
--- a/build/features.gypi
+++ b/build/features.gypi
@@ -59,6 +59,9 @@
# Enable compiler warnings when using V8_DEPRECATED apis.
'v8_deprecation_warnings%': 0,
+ # Enable compiler warnings when using V8_DEPRECATE_SOON apis.
+ 'v8_imminent_deprecation_warnings%': 0,
+
# Set to 1 to enable DCHECKs in release builds.
'dcheck_always_on%': 0,
},
@@ -88,6 +91,9 @@
['v8_deprecation_warnings==1', {
'defines': ['V8_DEPRECATION_WARNINGS',],
}],
+ ['v8_imminent_deprecation_warnings==1', {
+ 'defines': ['V8_IMMINENT_DEPRECATION_WARNINGS',],
+ }],
['v8_enable_i18n_support==1', {
'defines': ['V8_I18N_SUPPORT',],
}],
Index: build/standalone.gypi
diff --git a/build/standalone.gypi b/build/standalone.gypi
index
24f2e7a74f44e16907330197d9d0b8aaaeb49994..a22e42294bc3149a24808bfbae7d1c9364e551bd
100644
--- a/build/standalone.gypi
+++ b/build/standalone.gypi
@@ -43,6 +43,8 @@
'v8_enable_backtrace%': 0,
'v8_enable_i18n_support%': 1,
'v8_deprecation_warnings': 1,
+ # TODO(jochen): Turn this on.
+ 'v8_imminent_deprecation_warnings': 0,
'msvs_multi_core_compile%': '1',
'mac_deployment_target%': '10.5',
'release_extra_cflags%': '',
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index
55e86b3de82a55540bdc8dd6a865e7e585d1e75e..9a2ee34f6d733b17343247f83d15785a4a4265fb
100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -418,11 +418,11 @@ class WeakCallbackInfo {
V8_INLINE void* GetInternalField(int index) const;
V8_INLINE V8_DEPRECATE_SOON("use indexed version",
- void* GetInternalField1()) const {
+ void* GetInternalField1() const) {
return internal_fields_[0];
}
V8_INLINE V8_DEPRECATE_SOON("use indexed version",
- void* GetInternalField2()) const {
+ void* GetInternalField2() const) {
return internal_fields_[1];
}
@@ -3096,8 +3096,8 @@ class V8_EXPORT Function : public Object {
int length = 0);
V8_DEPRECATE_SOON("Use maybe version",
- Local<Object> NewInstance(int argc,
- Handle<Value> argv[])) const;
+ Local<Object> NewInstance(int argc, Handle<Value>
argv[])
+ const);
V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
Local<Context> context, int argc, Handle<Value> argv[]) const;
Index: include/v8config.h
diff --git a/include/v8config.h b/include/v8config.h
index
991a43afd445c066eda7d5fc6e5d56209a5a0cf4..c2b856bd7dd9c3a33002d0c2e4208c950e04d90c
100644
--- a/include/v8config.h
+++ b/include/v8config.h
@@ -328,7 +328,18 @@ declarator __attribute__((deprecated))
// a macro to make it easier to see what will be deprecated.
+#if defined(V8_IMMINENT_DEPRECATION_WARNINGS) && \
+ V8_HAS_ATTRIBUTE_DEPRECATED_MESSAGE
+#define V8_DEPRECATE_SOON(message, declarator) \
+ declarator __attribute__((deprecated(message)))
+#elif defined(V8_IMMINENT_DEPRECATION_WARNINGS) &&
V8_HAS_ATTRIBUTE_DEPRECATED
+#define V8_DEPRECATE_SOON(message, declarator) \
+ declarator __attribute__((deprecated))
+#elif defined(V8_IMMINENT_DEPRECATION_WARNINGS) &&
V8_HAS_DECLSPEC_DEPRECATED
+#define V8_DEPRECATE_SOON(message, declarator) __declspec(deprecated)
declarator
+#else
#define V8_DEPRECATE_SOON(message, declarator) declarator
+#endif
// A macro to provide the compiler with branch prediction information.
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.