| Index: test/cctest/test-assembler-x64.cc
|
| diff --git a/test/cctest/test-assembler-x64.cc b/test/cctest/test-assembler-x64.cc
|
| index f7d2311192303b20c8d38c771e592056add110e5..7fd4db4e510e2c01450beeec0629b3442ee57149 100644
|
| --- a/test/cctest/test-assembler-x64.cc
|
| +++ b/test/cctest/test-assembler-x64.cc
|
| @@ -35,34 +35,7 @@
|
| #include "serialize.h"
|
| #include "cctest.h"
|
|
|
| -using v8::internal::Assembler;
|
| -using v8::internal::Code;
|
| -using v8::internal::CodeDesc;
|
| -using v8::internal::FUNCTION_CAST;
|
| -using v8::internal::Immediate;
|
| -using v8::internal::Isolate;
|
| -using v8::internal::Label;
|
| -using v8::internal::OS;
|
| -using v8::internal::Operand;
|
| -using v8::internal::byte;
|
| -using v8::internal::greater;
|
| -using v8::internal::less_equal;
|
| -using v8::internal::equal;
|
| -using v8::internal::not_equal;
|
| -using v8::internal::r13;
|
| -using v8::internal::r15;
|
| -using v8::internal::r8;
|
| -using v8::internal::r9;
|
| -using v8::internal::rax;
|
| -using v8::internal::rbx;
|
| -using v8::internal::rbp;
|
| -using v8::internal::rcx;
|
| -using v8::internal::rdi;
|
| -using v8::internal::rdx;
|
| -using v8::internal::rsi;
|
| -using v8::internal::rsp;
|
| -using v8::internal::times_1;
|
| -using v8::internal::xmm0;
|
| +using namespace v8::internal;
|
|
|
| // Test the x64 assembler by compiling some simple functions into
|
| // a buffer and executing them. These tests do not initialize the
|
| @@ -92,9 +65,10 @@ static const v8::internal::Register arg2 = rsi;
|
| TEST(AssemblerX64ReturnOperation) {
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| - byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
|
| - &actual_size,
|
| - true));
|
| + byte* buffer = static_cast<byte*>(VirtualMemory::AllocateRegion(
|
| + Assembler::kMinimalBufferSize,
|
| + &actual_size,
|
| + VirtualMemory::EXECUTABLE));
|
| CHECK(buffer);
|
| Assembler assm(Isolate::Current(), buffer, static_cast<int>(actual_size));
|
|
|
| @@ -114,9 +88,10 @@ TEST(AssemblerX64ReturnOperation) {
|
| TEST(AssemblerX64StackOperations) {
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| - byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
|
| - &actual_size,
|
| - true));
|
| + byte* buffer = static_cast<byte*>(VirtualMemory::AllocateRegion(
|
| + Assembler::kMinimalBufferSize,
|
| + &actual_size,
|
| + VirtualMemory::EXECUTABLE));
|
| CHECK(buffer);
|
| Assembler assm(Isolate::Current(), buffer, static_cast<int>(actual_size));
|
|
|
| @@ -146,9 +121,10 @@ TEST(AssemblerX64StackOperations) {
|
| TEST(AssemblerX64ArithmeticOperations) {
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| - byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
|
| - &actual_size,
|
| - true));
|
| + byte* buffer = static_cast<byte*>(VirtualMemory::AllocateRegion(
|
| + Assembler::kMinimalBufferSize,
|
| + &actual_size,
|
| + VirtualMemory::EXECUTABLE));
|
| CHECK(buffer);
|
| Assembler assm(Isolate::Current(), buffer, static_cast<int>(actual_size));
|
|
|
| @@ -168,9 +144,10 @@ TEST(AssemblerX64ArithmeticOperations) {
|
| TEST(AssemblerX64ImulOperation) {
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| - byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
|
| - &actual_size,
|
| - true));
|
| + byte* buffer = static_cast<byte*>(VirtualMemory::AllocateRegion(
|
| + Assembler::kMinimalBufferSize,
|
| + &actual_size,
|
| + VirtualMemory::EXECUTABLE));
|
| CHECK(buffer);
|
| Assembler assm(Isolate::Current(), buffer, static_cast<int>(actual_size));
|
|
|
| @@ -196,9 +173,10 @@ TEST(AssemblerX64ImulOperation) {
|
| TEST(AssemblerX64MemoryOperands) {
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| - byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
|
| - &actual_size,
|
| - true));
|
| + byte* buffer = static_cast<byte*>(VirtualMemory::AllocateRegion(
|
| + Assembler::kMinimalBufferSize,
|
| + &actual_size,
|
| + VirtualMemory::EXECUTABLE));
|
| CHECK(buffer);
|
| Assembler assm(Isolate::Current(), buffer, static_cast<int>(actual_size));
|
|
|
| @@ -230,9 +208,10 @@ TEST(AssemblerX64MemoryOperands) {
|
| TEST(AssemblerX64ControlFlow) {
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| - byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
|
| - &actual_size,
|
| - true));
|
| + byte* buffer = static_cast<byte*>(VirtualMemory::AllocateRegion(
|
| + Assembler::kMinimalBufferSize,
|
| + &actual_size,
|
| + VirtualMemory::EXECUTABLE));
|
| CHECK(buffer);
|
| Assembler assm(Isolate::Current(), buffer, static_cast<int>(actual_size));
|
|
|
| @@ -259,9 +238,10 @@ TEST(AssemblerX64ControlFlow) {
|
| TEST(AssemblerX64LoopImmediates) {
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| - byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
|
| - &actual_size,
|
| - true));
|
| + byte* buffer = static_cast<byte*>(VirtualMemory::AllocateRegion(
|
| + Assembler::kMinimalBufferSize,
|
| + &actual_size,
|
| + VirtualMemory::EXECUTABLE));
|
| CHECK(buffer);
|
| Assembler assm(Isolate::Current(), buffer, static_cast<int>(actual_size));
|
| // Assemble two loops using rax as counter, and verify the ending counts.
|
|
|