| Index: base/android/jni_generator/jni_generator_helper.h
|
| diff --git a/base/android/jni_generator/jni_generator_helper.h b/base/android/jni_generator/jni_generator_helper.h
|
| index 56a2ec818ba7be9aa8fcb42ca20b751f57852bdc..4c159c03a9f3975b08b487821a1839185918017b 100644
|
| --- a/base/android/jni_generator/jni_generator_helper.h
|
| +++ b/base/android/jni_generator/jni_generator_helper.h
|
| @@ -2,7 +2,6 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -
|
| #ifndef BASE_ANDROID_JNI_GENERATOR_JNI_GENERATOR_HELPER_H_
|
| #define BASE_ANDROID_JNI_GENERATOR_JNI_GENERATOR_HELPER_H_
|
|
|
| @@ -11,26 +10,37 @@
|
| #include "base/android/jni_android.h"
|
| #include "base/android/scoped_java_ref.h"
|
| #include "base/logging.h"
|
| +#include "build/build_config.h"
|
|
|
| // Project-specific macros used by the header files generated by
|
| // jni_generator.py. Different projects can then specify their own
|
| // implementation for this file.
|
| #define CHECK_NATIVE_PTR(env, jcaller, native_ptr, method_name, ...) \
|
| - DCHECK(native_ptr) << method_name;
|
| + DCHECK(native_ptr) << method_name;
|
| +
|
| +#define CHECK_CLAZZ(env, jcaller, clazz, ...) DCHECK(clazz);
|
|
|
| -#define CHECK_CLAZZ(env, jcaller, clazz, ...) \
|
| - DCHECK(clazz);
|
| +#if defined(ARCH_CPU_X86)
|
| +// Dalvik JIT generated code doesn't guarantee 16-byte stack alignment on
|
| +// x86 - use force_align_arg_pointer to realign the stack at the JNI
|
| +// boundary. crbug.com/655248
|
| +#define JNI_GENERATOR_EXPORT \
|
| + extern "C" __attribute__((visibility("default"), force_align_arg_pointer))
|
| +#else
|
| +#define JNI_GENERATOR_EXPORT extern "C" __attribute__((visibility("default")))
|
| +#endif
|
|
|
| namespace jni_generator {
|
|
|
| - inline void HandleRegistrationError(JNIEnv* env, jclass clazz,
|
| - const char* filename) {
|
| - LOG(ERROR) << "RegisterNatives failed in " << filename;
|
| - }
|
| +inline void HandleRegistrationError(JNIEnv* env,
|
| + jclass clazz,
|
| + const char* filename) {
|
| + LOG(ERROR) << "RegisterNatives failed in " << filename;
|
| +}
|
|
|
| - inline void CheckException(JNIEnv* env) {
|
| - base::android::CheckException(env);
|
| - }
|
| +inline void CheckException(JNIEnv* env) {
|
| + base::android::CheckException(env);
|
| +}
|
|
|
| } // namespace jni_generator
|
|
|
|
|