Fix Arm64 assembler on Android.

BUG=v8:8157

Change-Id: I66bac3897eaad640b5723cdd0ec900e40cce1214
Reviewed-on: https://chromium-review.googlesource.com/1226917
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Rodolph Perfetta <rodolph.perfetta@arm.com>
Cr-Commit-Position: refs/heads/master@{#55988}
This commit is contained in:
Ross McIlroy 2018-09-18 09:57:47 +01:00 committed by Commit Bot
parent b6bdd7415c
commit 5e16d3ba02
2 changed files with 7 additions and 26 deletions

View File

@ -373,29 +373,6 @@
['system == android', {
# Uses too much memory.
'test-api/NewStringRangeError': [SKIP],
# https://crbug.com/v8/8157
'test-assembler-arm64/abs': [FAIL],
'test-assembler-arm64/adcs_sbcs_w': [FAIL],
'test-assembler-arm64/adcs_sbcs_x': [FAIL],
'test-assembler-arm64/default_nan_double': [FAIL],
'test-assembler-arm64/default_nan_float': [FAIL],
'test-assembler-arm64/fcvt_sd': [FAIL],
'test-assembler-arm64/fmadd_fmsub_double': [FAIL],
'test-assembler-arm64/fmadd_fmsub_double_nans': [FAIL],
'test-assembler-arm64/fmadd_fmsub_float': [FAIL],
'test-assembler-arm64/fmadd_fmsub_float_nans': [FAIL],
'test-assembler-arm64/fmax_fmin_d': [FAIL],
'test-assembler-arm64/fmax_fmin_s': [FAIL],
'test-assembler-arm64/ldr_pcrel_large_offset': [FAIL],
'test-assembler-arm64/process_nans_double': [FAIL],
'test-assembler-arm64/process_nans_float': [FAIL],
'test-assembler-arm64/push_pop_fp_simple_32': [FAIL],
'test-assembler-arm64/push_pop_fp_simple_64': [FAIL],
'test-assembler-arm64/push_pop_simple_64': [FAIL],
'test-assembler-arm64/scvtf_ucvtf_double': [FAIL],
'test-assembler-arm64/scvtf_ucvtf_float': [FAIL],
'test-assembler-arm64/smull': [FAIL],
'test-code-stubs-arm64/ConvertDToI': [FAIL],
}], # 'system == android'
##############################################################################

View File

@ -26,13 +26,17 @@ static inline uint8_t* AllocateAssemblerBuffer(
static inline void MakeAssemblerBufferExecutable(uint8_t* buffer,
size_t allocated) {
// Flush the instruction cache as part of making the buffer executable.
// Note: we do this before setting permissions to ReadExecute because on
// some older Arm64 kernels there is a bug which causes an access error on
// cache flush instructions to trigger access error on non-writable memory.
// See https://bugs.chromium.org/p/v8/issues/detail?id=8157
Assembler::FlushICache(buffer, allocated);
bool result =
v8::internal::SetPermissions(GetPlatformPageAllocator(), buffer,
allocated, v8::PageAllocator::kReadExecute);
CHECK(result);
// Flush the instruction cache as part of making the buffer executable.
Assembler::FlushICache(buffer, allocated);
}
static inline void MakeAssemblerBufferWritable(uint8_t* buffer,