Commit 3966891a authored by Georgia Kouveli's avatar Georgia Kouveli Committed by Commit Bot

[arm64] Fix assembler native test failures.

We were attempting to assemble code into the MacroAssembler buffer after
executing it, without resetting the permissions. As a result, tests that
are using START/END multiple times were failing.

Change-Id: Id84c6a07212a869f98edbd33d86ff70ee6c819db
Reviewed-on: https://chromium-review.googlesource.com/939388Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georgia Kouveli <georgia.kouveli@arm.com>
Cr-Commit-Position: refs/heads/master@{#51901}
parent 14c68d4c
......@@ -568,6 +568,13 @@ static inline void MakeAssemblerBufferExecutable(uint8_t* buffer,
CHECK(result);
}
static inline void MakeAssemblerBufferWritable(uint8_t* buffer,
size_t allocated) {
bool result = v8::internal::SetPermissions(buffer, allocated,
v8::PageAllocator::kReadWrite);
CHECK(result);
}
static v8::debug::DebugDelegate dummy_delegate;
static inline void EnableDebugger(v8::Isolate* isolate) {
......
......@@ -182,13 +182,13 @@ static void InitializeVM() {
v8::internal::CodeObjectRequired::kYes); \
RegisterDump core;
#define RESET() \
__ Reset(); \
/* Reset the machine state (like simulator.ResetState()). */ \
__ Msr(NZCV, xzr); \
#define RESET() \
MakeAssemblerBufferWritable(buf, allocated); \
__ Reset(); \
/* Reset the machine state (like simulator.ResetState()). */ \
__ Msr(NZCV, xzr); \
__ Msr(FPCR, xzr);
#define START_AFTER_RESET() \
__ PushCalleeSavedRegisters();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment