| Index: test/cctest/test-macro-assembler-x64.cc
|
| diff --git a/test/cctest/test-macro-assembler-x64.cc b/test/cctest/test-macro-assembler-x64.cc
|
| index 61914b58c333beb53e4c7a02afe0922845a40eeb..a85d8e0468154c3e447914283289cc1396e6a492 100644
|
| --- a/test/cctest/test-macro-assembler-x64.cc
|
| +++ b/test/cctest/test-macro-assembler-x64.cc
|
| @@ -35,50 +35,53 @@
|
| #include "serialize.h"
|
| #include "cctest.h"
|
|
|
| -using v8::internal::Assembler;
|
| -using v8::internal::CodeDesc;
|
| -using v8::internal::Condition;
|
| -using v8::internal::FUNCTION_CAST;
|
| -using v8::internal::HandleScope;
|
| -using v8::internal::Immediate;
|
| -using v8::internal::Isolate;
|
| -using v8::internal::Label;
|
| -using v8::internal::MacroAssembler;
|
| -using v8::internal::OS;
|
| -using v8::internal::Operand;
|
| -using v8::internal::RelocInfo;
|
| -using v8::internal::Representation;
|
| -using v8::internal::Smi;
|
| -using v8::internal::SmiIndex;
|
| -using v8::internal::byte;
|
| -using v8::internal::carry;
|
| -using v8::internal::greater;
|
| -using v8::internal::greater_equal;
|
| -using v8::internal::kIntSize;
|
| -using v8::internal::kPointerSize;
|
| -using v8::internal::kSmiTagMask;
|
| -using v8::internal::kSmiValueSize;
|
| -using v8::internal::less_equal;
|
| -using v8::internal::negative;
|
| -using v8::internal::not_carry;
|
| -using v8::internal::not_equal;
|
| -using v8::internal::not_zero;
|
| -using v8::internal::positive;
|
| -using v8::internal::r11;
|
| -using v8::internal::r13;
|
| -using v8::internal::r14;
|
| -using v8::internal::r15;
|
| -using v8::internal::r8;
|
| -using v8::internal::r9;
|
| -using v8::internal::rax;
|
| -using v8::internal::rbp;
|
| -using v8::internal::rbx;
|
| -using v8::internal::rcx;
|
| -using v8::internal::rdi;
|
| -using v8::internal::rdx;
|
| -using v8::internal::rsi;
|
| -using v8::internal::rsp;
|
| -using v8::internal::times_pointer_size;
|
| +namespace i = v8::internal;
|
| +using i::Address;
|
| +using i::Assembler;
|
| +using i::CodeDesc;
|
| +using i::Condition;
|
| +using i::FUNCTION_CAST;
|
| +using i::HandleScope;
|
| +using i::Immediate;
|
| +using i::Isolate;
|
| +using i::Label;
|
| +using i::MacroAssembler;
|
| +using i::OS;
|
| +using i::Operand;
|
| +using i::RelocInfo;
|
| +using i::Representation;
|
| +using i::Smi;
|
| +using i::SmiIndex;
|
| +using i::byte;
|
| +using i::carry;
|
| +using i::greater;
|
| +using i::greater_equal;
|
| +using i::kIntSize;
|
| +using i::kPointerSize;
|
| +using i::kSmiTagMask;
|
| +using i::kSmiValueSize;
|
| +using i::less_equal;
|
| +using i::negative;
|
| +using i::not_carry;
|
| +using i::not_equal;
|
| +using i::equal;
|
| +using i::not_zero;
|
| +using i::positive;
|
| +using i::r11;
|
| +using i::r13;
|
| +using i::r14;
|
| +using i::r15;
|
| +using i::r8;
|
| +using i::r9;
|
| +using i::rax;
|
| +using i::rbp;
|
| +using i::rbx;
|
| +using i::rcx;
|
| +using i::rdi;
|
| +using i::rdx;
|
| +using i::rsi;
|
| +using i::rsp;
|
| +using i::times_pointer_size;
|
|
|
| // Test the x64 assembler by compiling some simple functions into
|
| // a buffer and executing them. These tests do not initialize the
|
| @@ -96,8 +99,8 @@ typedef int (*F0)();
|
|
|
| static void EntryCode(MacroAssembler* masm) {
|
| // Smi constant register is callee save.
|
| - __ push(v8::internal::kSmiConstantRegister);
|
| - __ push(v8::internal::kRootRegister);
|
| + __ push(i::kSmiConstantRegister);
|
| + __ push(i::kRootRegister);
|
| __ InitializeSmiConstantRegister();
|
| __ InitializeRootRegister();
|
| }
|
| @@ -106,11 +109,11 @@ static void EntryCode(MacroAssembler* masm) {
|
| static void ExitCode(MacroAssembler* masm) {
|
| // Return -1 if kSmiConstantRegister was clobbered during the test.
|
| __ Move(rdx, Smi::FromInt(1));
|
| - __ cmpq(rdx, v8::internal::kSmiConstantRegister);
|
| + __ cmpq(rdx, i::kSmiConstantRegister);
|
| __ movq(rdx, Immediate(-1));
|
| __ cmovq(not_equal, rax, rdx);
|
| - __ pop(v8::internal::kRootRegister);
|
| - __ pop(v8::internal::kSmiConstantRegister);
|
| + __ pop(i::kRootRegister);
|
| + __ pop(i::kSmiConstantRegister);
|
| }
|
|
|
|
|
| @@ -151,7 +154,7 @@ static void TestMoveSmi(MacroAssembler* masm, Label* exit, int id, Smi* value) {
|
|
|
| // Test that we can move a Smi value literally into a register.
|
| TEST(SmiMove) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
|
| @@ -239,7 +242,7 @@ void TestSmiCompare(MacroAssembler* masm, Label* exit, int id, int x, int y) {
|
|
|
| // Test that we can compare smis for equality (and more).
|
| TEST(SmiCompare) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -291,7 +294,7 @@ TEST(SmiCompare) {
|
|
|
|
|
| TEST(Integer32ToSmi) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
|
| @@ -402,7 +405,7 @@ void TestI64PlusConstantToSmi(MacroAssembler* masm,
|
| ASSERT(Smi::IsValid(result));
|
| __ movl(rax, Immediate(id));
|
| __ Move(r8, Smi::FromInt(static_cast<int>(result)));
|
| - __ movq(rcx, x, RelocInfo::NONE64);
|
| + __ movq(rcx, x);
|
| __ movq(r11, rcx);
|
| __ Integer64PlusConstantToSmi(rdx, rcx, y);
|
| __ cmpq(rdx, r8);
|
| @@ -420,7 +423,7 @@ void TestI64PlusConstantToSmi(MacroAssembler* masm,
|
|
|
|
|
| TEST(Integer64PlusConstantToSmi) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
|
| @@ -465,7 +468,7 @@ TEST(Integer64PlusConstantToSmi) {
|
|
|
|
|
| TEST(SmiCheck) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
|
| @@ -713,7 +716,7 @@ void TestSmiNeg(MacroAssembler* masm, Label* exit, int id, int x) {
|
|
|
|
|
| TEST(SmiNeg) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -770,7 +773,7 @@ static void SmiAddTest(MacroAssembler* masm,
|
| __ j(not_equal, exit);
|
|
|
| __ incq(rax);
|
| - __ SmiAdd(rcx, rcx, rdx, exit); \
|
| + __ SmiAdd(rcx, rcx, rdx, exit);
|
| __ cmpq(rcx, r8);
|
| __ j(not_equal, exit);
|
|
|
| @@ -789,13 +792,30 @@ static void SmiAddTest(MacroAssembler* masm,
|
| __ movl(rcx, Immediate(first));
|
| __ Integer32ToSmi(rcx, rcx);
|
|
|
| + i::SmiOperationExecutionMode mode;
|
| + mode.Add(i::PRESERVE_SOURCE_REGISTER);
|
| + mode.Add(i::BAILOUT_ON_OVERFLOW);
|
| __ incq(rax);
|
| - __ SmiAddConstant(r9, rcx, Smi::FromInt(second), exit);
|
| + __ SmiAddConstant(r9, rcx, Smi::FromInt(second), mode, exit);
|
| __ cmpq(r9, r8);
|
| __ j(not_equal, exit);
|
|
|
| __ incq(rax);
|
| - __ SmiAddConstant(rcx, rcx, Smi::FromInt(second), exit);
|
| + __ SmiAddConstant(rcx, rcx, Smi::FromInt(second), mode, exit);
|
| + __ cmpq(rcx, r8);
|
| + __ j(not_equal, exit);
|
| +
|
| + __ movl(rcx, Immediate(first));
|
| + __ Integer32ToSmi(rcx, rcx);
|
| +
|
| + mode.RemoveAll();
|
| + mode.Add(i::PRESERVE_SOURCE_REGISTER);
|
| + mode.Add(i::BAILOUT_ON_NO_OVERFLOW);
|
| + Label done;
|
| + __ incq(rax);
|
| + __ SmiAddConstant(rcx, rcx, Smi::FromInt(second), mode, &done);
|
| + __ jmp(exit);
|
| + __ bind(&done);
|
| __ cmpq(rcx, r8);
|
| __ j(not_equal, exit);
|
| }
|
| @@ -835,11 +855,14 @@ static void SmiAddOverflowTest(MacroAssembler* masm,
|
| __ j(not_equal, exit);
|
| }
|
|
|
| + i::SmiOperationExecutionMode mode;
|
| + mode.Add(i::PRESERVE_SOURCE_REGISTER);
|
| + mode.Add(i::BAILOUT_ON_OVERFLOW);
|
| __ movq(rcx, r11);
|
| {
|
| Label overflow_ok;
|
| __ incq(rax);
|
| - __ SmiAddConstant(r9, rcx, Smi::FromInt(y_min), &overflow_ok);
|
| + __ SmiAddConstant(r9, rcx, Smi::FromInt(y_min), mode, &overflow_ok);
|
| __ jmp(exit);
|
| __ bind(&overflow_ok);
|
| __ incq(rax);
|
| @@ -850,7 +873,7 @@ static void SmiAddOverflowTest(MacroAssembler* masm,
|
| {
|
| Label overflow_ok;
|
| __ incq(rax);
|
| - __ SmiAddConstant(rcx, rcx, Smi::FromInt(y_min), &overflow_ok);
|
| + __ SmiAddConstant(rcx, rcx, Smi::FromInt(y_min), mode, &overflow_ok);
|
| __ jmp(exit);
|
| __ bind(&overflow_ok);
|
| __ incq(rax);
|
| @@ -886,7 +909,7 @@ static void SmiAddOverflowTest(MacroAssembler* masm,
|
| {
|
| Label overflow_ok;
|
| __ incq(rax);
|
| - __ SmiAddConstant(r9, rcx, Smi::FromInt(y_max), &overflow_ok);
|
| + __ SmiAddConstant(r9, rcx, Smi::FromInt(y_max), mode, &overflow_ok);
|
| __ jmp(exit);
|
| __ bind(&overflow_ok);
|
| __ incq(rax);
|
| @@ -894,21 +917,23 @@ static void SmiAddOverflowTest(MacroAssembler* masm,
|
| __ j(not_equal, exit);
|
| }
|
|
|
| + mode.RemoveAll();
|
| + mode.Add(i::BAILOUT_ON_OVERFLOW);
|
| {
|
| Label overflow_ok;
|
| __ incq(rax);
|
| - __ SmiAddConstant(rcx, rcx, Smi::FromInt(y_max), &overflow_ok);
|
| + __ SmiAddConstant(rcx, rcx, Smi::FromInt(y_max), mode, &overflow_ok);
|
| __ jmp(exit);
|
| __ bind(&overflow_ok);
|
| __ incq(rax);
|
| __ cmpq(rcx, r11);
|
| - __ j(not_equal, exit);
|
| + __ j(equal, exit);
|
| }
|
| }
|
|
|
|
|
| TEST(SmiAdd) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -987,15 +1012,30 @@ static void SmiSubTest(MacroAssembler* masm,
|
| __ cmpq(rcx, r8);
|
| __ j(not_equal, exit);
|
|
|
| + i::SmiOperationExecutionMode mode;
|
| + mode.Add(i::PRESERVE_SOURCE_REGISTER);
|
| + mode.Add(i::BAILOUT_ON_OVERFLOW);
|
| __ Move(rcx, Smi::FromInt(first));
|
| -
|
| __ incq(rax); // Test 4.
|
| - __ SmiSubConstant(r9, rcx, Smi::FromInt(second), exit);
|
| - __ cmpq(r9, r8);
|
| + __ SmiSubConstant(rcx, rcx, Smi::FromInt(second), mode, exit);
|
| + __ cmpq(rcx, r8);
|
| __ j(not_equal, exit);
|
|
|
| + __ Move(rcx, Smi::FromInt(first));
|
| __ incq(rax); // Test 5.
|
| - __ SmiSubConstant(rcx, rcx, Smi::FromInt(second), exit);
|
| + __ SmiSubConstant(r9, rcx, Smi::FromInt(second), mode, exit);
|
| + __ cmpq(r9, r8);
|
| + __ j(not_equal, exit);
|
| +
|
| + mode.RemoveAll();
|
| + mode.Add(i::PRESERVE_SOURCE_REGISTER);
|
| + mode.Add(i::BAILOUT_ON_NO_OVERFLOW);
|
| + __ Move(rcx, Smi::FromInt(first));
|
| + Label done;
|
| + __ incq(rax); // Test 6.
|
| + __ SmiSubConstant(rcx, rcx, Smi::FromInt(second), mode, &done);
|
| + __ jmp(exit);
|
| + __ bind(&done);
|
| __ cmpq(rcx, r8);
|
| __ j(not_equal, exit);
|
| }
|
| @@ -1035,11 +1075,15 @@ static void SmiSubOverflowTest(MacroAssembler* masm,
|
| __ j(not_equal, exit);
|
| }
|
|
|
| + i::SmiOperationExecutionMode mode;
|
| + mode.Add(i::PRESERVE_SOURCE_REGISTER);
|
| + mode.Add(i::BAILOUT_ON_OVERFLOW);
|
| +
|
| __ movq(rcx, r11);
|
| {
|
| Label overflow_ok;
|
| __ incq(rax);
|
| - __ SmiSubConstant(r9, rcx, Smi::FromInt(y_min), &overflow_ok);
|
| + __ SmiSubConstant(r9, rcx, Smi::FromInt(y_min), mode, &overflow_ok);
|
| __ jmp(exit);
|
| __ bind(&overflow_ok);
|
| __ incq(rax);
|
| @@ -1050,7 +1094,7 @@ static void SmiSubOverflowTest(MacroAssembler* masm,
|
| {
|
| Label overflow_ok;
|
| __ incq(rax);
|
| - __ SmiSubConstant(rcx, rcx, Smi::FromInt(y_min), &overflow_ok);
|
| + __ SmiSubConstant(rcx, rcx, Smi::FromInt(y_min), mode, &overflow_ok);
|
| __ jmp(exit);
|
| __ bind(&overflow_ok);
|
| __ incq(rax);
|
| @@ -1086,7 +1130,7 @@ static void SmiSubOverflowTest(MacroAssembler* masm,
|
| {
|
| Label overflow_ok;
|
| __ incq(rax);
|
| - __ SmiSubConstant(r9, rcx, Smi::FromInt(y_max), &overflow_ok);
|
| + __ SmiSubConstant(rcx, rcx, Smi::FromInt(y_max), mode, &overflow_ok);
|
| __ jmp(exit);
|
| __ bind(&overflow_ok);
|
| __ incq(rax);
|
| @@ -1094,21 +1138,24 @@ static void SmiSubOverflowTest(MacroAssembler* masm,
|
| __ j(not_equal, exit);
|
| }
|
|
|
| + mode.RemoveAll();
|
| + mode.Add(i::BAILOUT_ON_OVERFLOW);
|
| + __ movq(rcx, r11);
|
| {
|
| Label overflow_ok;
|
| __ incq(rax);
|
| - __ SmiSubConstant(rcx, rcx, Smi::FromInt(y_max), &overflow_ok);
|
| + __ SmiSubConstant(rcx, rcx, Smi::FromInt(y_max), mode, &overflow_ok);
|
| __ jmp(exit);
|
| __ bind(&overflow_ok);
|
| __ incq(rax);
|
| __ cmpq(rcx, r11);
|
| - __ j(not_equal, exit);
|
| + __ j(equal, exit);
|
| }
|
| }
|
|
|
|
|
| TEST(SmiSub) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -1200,7 +1247,7 @@ void TestSmiMul(MacroAssembler* masm, Label* exit, int id, int x, int y) {
|
|
|
|
|
| TEST(SmiMul) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
|
| @@ -1306,7 +1353,7 @@ void TestSmiDiv(MacroAssembler* masm, Label* exit, int id, int x, int y) {
|
|
|
|
|
| TEST(SmiDiv) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -1417,7 +1464,7 @@ void TestSmiMod(MacroAssembler* masm, Label* exit, int id, int x, int y) {
|
|
|
|
|
| TEST(SmiMod) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -1515,7 +1562,7 @@ void TestSmiIndex(MacroAssembler* masm, Label* exit, int id, int x) {
|
|
|
|
|
| TEST(SmiIndex) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -1585,7 +1632,7 @@ void TestSelectNonSmi(MacroAssembler* masm, Label* exit, int id, int x, int y) {
|
|
|
|
|
| TEST(SmiSelectNonSmi) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -1665,7 +1712,7 @@ void TestSmiAnd(MacroAssembler* masm, Label* exit, int id, int x, int y) {
|
|
|
|
|
| TEST(SmiAnd) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -1747,7 +1794,7 @@ void TestSmiOr(MacroAssembler* masm, Label* exit, int id, int x, int y) {
|
|
|
|
|
| TEST(SmiOr) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -1831,7 +1878,7 @@ void TestSmiXor(MacroAssembler* masm, Label* exit, int id, int x, int y) {
|
|
|
|
|
| TEST(SmiXor) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -1899,7 +1946,7 @@ void TestSmiNot(MacroAssembler* masm, Label* exit, int id, int x) {
|
|
|
|
|
| TEST(SmiNot) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -1996,7 +2043,7 @@ void TestSmiShiftLeft(MacroAssembler* masm, Label* exit, int id, int x) {
|
|
|
|
|
| TEST(SmiShiftLeft) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -2103,7 +2150,7 @@ void TestSmiShiftLogicalRight(MacroAssembler* masm,
|
|
|
|
|
| TEST(SmiShiftLogicalRight) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -2173,7 +2220,7 @@ void TestSmiShiftArithmeticRight(MacroAssembler* masm,
|
|
|
|
|
| TEST(SmiShiftArithmeticRight) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -2238,7 +2285,7 @@ void TestPositiveSmiPowerUp(MacroAssembler* masm, Label* exit, int id, int x) {
|
|
|
|
|
| TEST(PositiveSmiTimesPowerOfTwoToInteger64) {
|
| - v8::internal::V8::Initialize(NULL);
|
| + i::V8::Initialize(NULL);
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| byte* buffer =
|
| @@ -2279,9 +2326,9 @@ TEST(PositiveSmiTimesPowerOfTwoToInteger64) {
|
|
|
|
|
| TEST(OperandOffset) {
|
| - v8::internal::V8::Initialize(NULL);
|
| - int data[256];
|
| - for (int i = 0; i < 256; i++) { data[i] = i * 0x01010101; }
|
| + i::V8::Initialize(NULL);
|
| + uint32_t data[256];
|
| + for (uint32_t i = 0; i < 256; i++) { data[i] = i * 0x01010101; }
|
|
|
| // Allocate an executable page of memory.
|
| size_t actual_size;
|
| @@ -2322,7 +2369,7 @@ TEST(OperandOffset) {
|
| __ lea(r13, Operand(rbp, -3 * kPointerSize));
|
| __ lea(rbx, Operand(rbp, -5 * kPointerSize));
|
| __ movl(rcx, Immediate(2));
|
| - __ movq(r8, reinterpret_cast<uintptr_t>(&data[128]), RelocInfo::NONE64);
|
| + __ movq(r8, reinterpret_cast<Address>(&data[128]), RelocInfo::NONE64);
|
| __ movl(rax, Immediate(1));
|
|
|
| Operand sp0 = Operand(rsp, 0);
|
| @@ -2657,12 +2704,12 @@ TEST(LoadAndStoreWithRepresentation) {
|
| __ movq(rax, Immediate(1)); // Test number.
|
| __ movq(Operand(rsp, 0 * kPointerSize), Immediate(0));
|
| __ movq(rcx, Immediate(-1));
|
| - __ Store(Operand(rsp, 0 * kPointerSize), rcx, Representation::Byte());
|
| + __ Store(Operand(rsp, 0 * kPointerSize), rcx, Representation::UInteger8());
|
| __ movq(rcx, Operand(rsp, 0 * kPointerSize));
|
| __ movl(rdx, Immediate(255));
|
| __ cmpq(rcx, rdx);
|
| __ j(not_equal, &exit);
|
| - __ Load(rdx, Operand(rsp, 0 * kPointerSize), Representation::Byte());
|
| + __ Load(rdx, Operand(rsp, 0 * kPointerSize), Representation::UInteger8());
|
| __ cmpq(rcx, rdx);
|
| __ j(not_equal, &exit);
|
|
|
| @@ -2731,6 +2778,47 @@ TEST(LoadAndStoreWithRepresentation) {
|
| __ cmpq(rcx, rdx);
|
| __ j(not_equal, &exit);
|
|
|
| + // Test 7.
|
| + __ movq(rax, Immediate(7)); // Test number.
|
| + __ movq(Operand(rsp, 0 * kPointerSize), Immediate(0));
|
| + __ movq(rcx, Immediate(-1));
|
| + __ Store(Operand(rsp, 0 * kPointerSize), rcx, Representation::Integer8());
|
| + __ movq(rcx, Operand(rsp, 0 * kPointerSize));
|
| + __ movl(rdx, Immediate(255));
|
| + __ cmpq(rcx, rdx);
|
| + __ j(not_equal, &exit);
|
| + __ Load(rdx, Operand(rsp, 0 * kPointerSize), Representation::Integer8());
|
| + __ movq(rcx, Immediate(-1));
|
| + __ cmpq(rcx, rdx);
|
| + __ j(not_equal, &exit);
|
| +
|
| + // Test 8.
|
| + __ movq(rax, Immediate(8)); // Test number.
|
| + __ movq(Operand(rsp, 0 * kPointerSize), Immediate(0));
|
| + __ movq(rcx, Immediate(-1));
|
| + __ Store(Operand(rsp, 0 * kPointerSize), rcx, Representation::Integer16());
|
| + __ movq(rcx, Operand(rsp, 0 * kPointerSize));
|
| + __ movl(rdx, Immediate(65535));
|
| + __ cmpq(rcx, rdx);
|
| + __ j(not_equal, &exit);
|
| + __ Load(rdx, Operand(rsp, 0 * kPointerSize), Representation::Integer16());
|
| + __ movq(rcx, Immediate(-1));
|
| + __ cmpq(rcx, rdx);
|
| + __ j(not_equal, &exit);
|
| +
|
| + // Test 9.
|
| + __ movq(rax, Immediate(9)); // Test number.
|
| + __ movq(Operand(rsp, 0 * kPointerSize), Immediate(0));
|
| + __ movq(rcx, Immediate(-1));
|
| + __ Store(Operand(rsp, 0 * kPointerSize), rcx, Representation::UInteger16());
|
| + __ movq(rcx, Operand(rsp, 0 * kPointerSize));
|
| + __ movl(rdx, Immediate(65535));
|
| + __ cmpq(rcx, rdx);
|
| + __ j(not_equal, &exit);
|
| + __ Load(rdx, Operand(rsp, 0 * kPointerSize), Representation::UInteger16());
|
| + __ cmpq(rcx, rdx);
|
| + __ j(not_equal, &exit);
|
| +
|
| __ xor_(rax, rax); // Success.
|
| __ bind(&exit);
|
| __ addq(rsp, Immediate(1 * kPointerSize));
|
|
|