Revert "Load/Store cannot handle double representation."
This reverts r17135 -- test crashes on x64. TBR=bmeurer@chromium.org BUG= Review URL: https://codereview.chromium.org/26653004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17138 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
63d8abb6c6
commit
3c01f30e3f
@ -948,7 +948,6 @@ void MacroAssembler::Cvtlsi2sd(XMMRegister dst, const Operand& src) {
|
||||
|
||||
|
||||
void MacroAssembler::Load(Register dst, const Operand& src, Representation r) {
|
||||
ASSERT(!r.IsDouble());
|
||||
if (r.IsByte()) {
|
||||
movzxbl(dst, src);
|
||||
} else if (r.IsInteger32()) {
|
||||
@ -960,7 +959,6 @@ void MacroAssembler::Load(Register dst, const Operand& src, Representation r) {
|
||||
|
||||
|
||||
void MacroAssembler::Store(const Operand& dst, Register src, Representation r) {
|
||||
ASSERT(!r.IsDouble());
|
||||
if (r.IsByte()) {
|
||||
movb(dst, src);
|
||||
} else if (r.IsInteger32()) {
|
||||
|
@ -47,7 +47,6 @@ 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;
|
||||
@ -2635,117 +2634,5 @@ TEST(OperandOffset) {
|
||||
}
|
||||
|
||||
|
||||
TEST(LoadAndStoreWithRepresentation) {
|
||||
v8::internal::V8::Initialize(NULL);
|
||||
|
||||
// Allocate an executable page of memory.
|
||||
size_t actual_size;
|
||||
byte* buffer = static_cast<byte*>(OS::Allocate(Assembler::kMinimalBufferSize,
|
||||
&actual_size,
|
||||
true));
|
||||
CHECK(buffer);
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope handles(isolate);
|
||||
MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size));
|
||||
MacroAssembler* masm = &assembler; // Create a pointer for the __ macro.
|
||||
masm->set_allow_stub_calls(false);
|
||||
__ push(rbp);
|
||||
__ movq(rbp, rsp);
|
||||
__ subq(rsp, Immediate(1 * kPointerSize));
|
||||
EntryCode(masm);
|
||||
Label exit;
|
||||
|
||||
// Test 1.
|
||||
__ 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());
|
||||
__ 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());
|
||||
__ cmpq(rcx, rdx);
|
||||
__ j(not_equal, &exit);
|
||||
|
||||
// Test 2.
|
||||
__ movq(rax, Immediate(2)); // Test number.
|
||||
__ movq(Operand(rsp, 0 * kPointerSize), Immediate(0));
|
||||
__ Set(rcx, V8_2PART_UINT64_C(0xdeadbeaf, 12345678));
|
||||
__ Store(Operand(rsp, 0 * kPointerSize), rcx, Representation::Smi());
|
||||
__ movq(rcx, Operand(rsp, 0 * kPointerSize));
|
||||
__ Set(rdx, V8_2PART_UINT64_C(0xdeadbeaf, 12345678));
|
||||
__ cmpq(rcx, rdx);
|
||||
__ j(not_equal, &exit);
|
||||
__ Load(rdx, Operand(rsp, 0 * kPointerSize), Representation::Smi());
|
||||
__ cmpq(rcx, rdx);
|
||||
__ j(not_equal, &exit);
|
||||
|
||||
// Test 3.
|
||||
__ movq(rax, Immediate(3)); // Test number.
|
||||
__ movq(Operand(rsp, 0 * kPointerSize), Immediate(0));
|
||||
__ movq(rcx, Immediate(-1));
|
||||
__ Store(Operand(rsp, 0 * kPointerSize), rcx, Representation::Integer32());
|
||||
__ movq(rcx, Operand(rsp, 0 * kPointerSize));
|
||||
__ movl(rdx, Immediate(-1));
|
||||
__ cmpq(rcx, rdx);
|
||||
__ j(not_equal, &exit);
|
||||
__ Load(rdx, Operand(rsp, 0 * kPointerSize), Representation::Integer32());
|
||||
__ cmpq(rcx, rdx);
|
||||
__ j(not_equal, &exit);
|
||||
|
||||
// Test 4.
|
||||
__ movq(rax, Immediate(4)); // Test number.
|
||||
__ movq(Operand(rsp, 0 * kPointerSize), Immediate(0));
|
||||
__ movl(rcx, Immediate(0x44332211));
|
||||
__ Store(Operand(rsp, 0 * kPointerSize), rcx, Representation::HeapObject());
|
||||
__ movq(rcx, Operand(rsp, 0 * kPointerSize));
|
||||
__ movl(rdx, Immediate(0x44332211));
|
||||
__ cmpq(rcx, rdx);
|
||||
__ j(not_equal, &exit);
|
||||
__ Load(rdx, Operand(rsp, 0 * kPointerSize), Representation::HeapObject());
|
||||
__ cmpq(rcx, rdx);
|
||||
__ j(not_equal, &exit);
|
||||
|
||||
// Test 5.
|
||||
__ movq(rax, Immediate(5)); // Test number.
|
||||
__ movq(Operand(rsp, 0 * kPointerSize), Immediate(0));
|
||||
__ Set(rcx, V8_2PART_UINT64_C(0x12345678, deadbeaf));
|
||||
__ Store(Operand(rsp, 0 * kPointerSize), rcx, Representation::Tagged());
|
||||
__ movq(rcx, Operand(rsp, 0 * kPointerSize));
|
||||
__ Set(rdx, V8_2PART_UINT64_C(0x12345678, deadbeaf));
|
||||
__ cmpq(rcx, rdx);
|
||||
__ j(not_equal, &exit);
|
||||
__ Load(rdx, Operand(rsp, 0 * kPointerSize), Representation::Tagged());
|
||||
__ cmpq(rcx, rdx);
|
||||
__ j(not_equal, &exit);
|
||||
|
||||
// Test 6.
|
||||
__ movq(rax, Immediate(6)); // Test number.
|
||||
__ movq(Operand(rsp, 0 * kPointerSize), Immediate(0));
|
||||
__ Set(rcx, V8_2PART_UINT64_C(0x11223344, 55667788));
|
||||
__ Store(Operand(rsp, 0 * kPointerSize), rcx, Representation::External());
|
||||
__ movq(rcx, Operand(rsp, 0 * kPointerSize));
|
||||
__ Set(rdx, V8_2PART_UINT64_C(0x11223344, 55667788));
|
||||
__ cmpq(rcx, rdx);
|
||||
__ j(not_equal, &exit);
|
||||
__ Load(rdx, Operand(rsp, 0 * kPointerSize), Representation::External());
|
||||
__ cmpq(rcx, rdx);
|
||||
__ j(not_equal, &exit);
|
||||
|
||||
__ xor_(rax, rax); // Success.
|
||||
__ bind(&exit);
|
||||
ExitCode(masm);
|
||||
__ movq(rsp, rbp);
|
||||
__ pop(rbp);
|
||||
__ ret(0);
|
||||
|
||||
CodeDesc desc;
|
||||
masm->GetCode(&desc);
|
||||
// Call the function from C++.A
|
||||
int result = FUNCTION_CAST<F0>(buffer)();
|
||||
CHECK_EQ(0, result);
|
||||
}
|
||||
|
||||
|
||||
#undef __
|
||||
|
Loading…
Reference in New Issue
Block a user