Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: test/cctest/test-assembler-arm64.cc

Issue 1748603002: [arm64] Make sure that memory allocated for assembler tests is executable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-assembler-arm64.cc
diff --git a/test/cctest/test-assembler-arm64.cc b/test/cctest/test-assembler-arm64.cc
index d930173937306e7a68d2ce99fd9f429df18d8902..c2c5b782dc65ef1ad0aa044c21b549be33e116f2 100644
--- a/test/cctest/test-assembler-arm64.cc
+++ b/test/cctest/test-assembler-arm64.cc
@@ -37,6 +37,7 @@
#include "src/arm64/disasm-arm64.h"
#include "src/arm64/simulator-arm64.h"
#include "src/arm64/utils-arm64.h"
+#include "src/base/platform/platform.h"
#include "src/base/utils/random-number-generator.h"
#include "src/macro-assembler.h"
#include "test/cctest/cctest.h"
@@ -173,8 +174,10 @@ static void InitializeVM() {
Isolate* isolate = CcTest::i_isolate(); \
HandleScope scope(isolate); \
CHECK(isolate != NULL); \
- byte* buf = new byte[buf_size]; \
- MacroAssembler masm(isolate, buf, buf_size, \
+ size_t actual_size; \
+ byte* buf = static_cast<byte*>( \
+ v8::base::OS::Allocate(buf_size, &actual_size, true)); \
+ MacroAssembler masm(isolate, buf, actual_size, \
v8::internal::CodeObjectRequired::kYes); \
RegisterDump core;
@@ -208,7 +211,7 @@ static void InitializeVM() {
__ GetCode(NULL);
#define TEARDOWN() \
- delete[] buf;
+ v8::base::OS::Free(buf, actual_size);
#endif // ifdef USE_SIMULATOR.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698