| Index: base/android/jni_generator/jni_generator.py
|
| diff --git a/base/android/jni_generator/jni_generator.py b/base/android/jni_generator/jni_generator.py
|
| index 428c4939ae82c879dcf8f4c146c1deab21c33a9e..f115b45f33ff467aa77486c4a964855aa0c6da29 100755
|
| --- a/base/android/jni_generator/jni_generator.py
|
| +++ b/base/android/jni_generator/jni_generator.py
|
| @@ -1030,8 +1030,14 @@ ${NATIVES}
|
| 'PARAM0_NAME': native.params[0].name,
|
| 'P0_TYPE': native.p0_type,
|
| })
|
| + # 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
|
| template = Template("""\
|
| extern "C" __attribute__((visibility("default")))
|
| +#if defined(ARCH_CPU_X86)
|
| +__attribute__((force_align_arg_pointer))
|
| +#endif
|
| ${RETURN} ${STUB_NAME}(JNIEnv* env,
|
| ${PARAMS_IN_STUB}) {
|
| ${PROFILING_ENTERED_NATIVE}
|
| @@ -1045,6 +1051,9 @@ ${RETURN} ${STUB_NAME}(JNIEnv* env,
|
| static ${RETURN_DECLARATION} ${NAME}(JNIEnv* env, ${PARAMS});
|
|
|
| extern "C" __attribute__((visibility("default")))
|
| +#if defined(ARCH_CPU_X86)
|
| +__attribute__((force_align_arg_pointer))
|
| +#endif
|
| ${RETURN} ${STUB_NAME}(JNIEnv* env, ${PARAMS_IN_STUB}) {
|
| ${PROFILING_ENTERED_NATIVE}
|
| return ${NAME}(${PARAMS_IN_CALL})${POST_CALL};
|
|
|