2009-10-08 12:36:12 +00:00
|
|
|
// Copyright 2009 the V8 project authors. All rights reserved.
|
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
// modification, are permitted provided that the following conditions are
|
|
|
|
// met:
|
|
|
|
//
|
|
|
|
// * Redistributions of source code must retain the above copyright
|
|
|
|
// notice, this list of conditions and the following disclaimer.
|
|
|
|
// * Redistributions in binary form must reproduce the above
|
|
|
|
// copyright notice, this list of conditions and the following
|
|
|
|
// disclaimer in the documentation and/or other materials provided
|
|
|
|
// with the distribution.
|
|
|
|
// * Neither the name of Google Inc. nor the names of its
|
|
|
|
// contributors may be used to endorse or promote products derived
|
|
|
|
// from this software without specific prior written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2019-05-24 13:51:59 +00:00
|
|
|
#include "src/init/v8.h"
|
2009-10-08 12:36:12 +00:00
|
|
|
|
2014-06-30 13:25:46 +00:00
|
|
|
#include "src/base/platform/platform.h"
|
2019-05-21 09:30:15 +00:00
|
|
|
#include "src/codegen/macro-assembler.h"
|
2019-05-28 13:17:52 +00:00
|
|
|
#include "src/codegen/x64/assembler-x64-inl.h"
|
2019-05-22 07:55:37 +00:00
|
|
|
#include "src/execution/simulator.h"
|
2018-04-09 19:11:22 +00:00
|
|
|
#include "src/heap/factory.h"
|
2019-05-23 08:51:46 +00:00
|
|
|
#include "src/objects/objects-inl.h"
|
2018-11-03 00:13:22 +00:00
|
|
|
#include "src/objects/smi.h"
|
2019-05-23 13:27:57 +00:00
|
|
|
#include "src/utils/ostreams.h"
|
2014-06-03 08:12:43 +00:00
|
|
|
#include "test/cctest/cctest.h"
|
Reland "[turboassembler] Introduce hard-abort mode"
This is a reland of a462a7854a081f4f34bb4c112ee33f3d69efa309
Original change's description:
> [turboassembler] Introduce hard-abort mode
>
> For checks and assertions (mostly for debug code, like stack alignment
> or zero extension), we had two modes: Emit a call to the {Abort}
> runtime function (the default), and emit a debug break (used for
> testing, enabled via --trap-on-abort).
> In wasm, where we cannot just call a runtime function because code must
> be isolate independent, we always used the trap-on-abort behaviour.
> This causes problems for our fuzzers, which do not catch SIGTRAP, and
> hence do not detect debug code failures.
>
> This CL introduces a third mode ("hard abort"), which calls a C
> function via {ExternalReference}. The C function still outputs the
> abort reason, but does not print the stack trace. It then aborts via
> "OS::Abort", just like the runtime function.
> This will allow fuzzers to detect the crash and even find a nice error
> message.
>
> Even though this looks like a lot of code churn, it is actually not.
> Most added lines are new tests, and other changes are minimal.
>
> R=mstarzinger@chromium.org
>
> Bug: chromium:863799
> Change-Id: I77c58ff72db552d49014614436259ccfb49ba87b
> Reviewed-on: https://chromium-review.googlesource.com/1142163
> Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#54592}
Bug: chromium:863799
Change-Id: I7729a47b4823a982a8e201df36520aa2b6ef5326
Reviewed-on: https://chromium-review.googlesource.com/1146100
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54656}
2018-07-24 14:12:47 +00:00
|
|
|
#include "test/common/assembler-tester.h"
|
2009-10-08 12:36:12 +00:00
|
|
|
|
2017-09-21 03:29:52 +00:00
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
namespace test_macro_assembler_x64 {
|
2009-10-08 12:36:12 +00:00
|
|
|
|
|
|
|
// Test the x64 assembler by compiling some simple functions into
|
|
|
|
// a buffer and executing them. These tests do not initialize the
|
|
|
|
// V8 library, create a context, or use any V8 objects.
|
|
|
|
// The AMD64 calling convention is used, with the first five arguments
|
|
|
|
// in RSI, RDI, RDX, RCX, R8, and R9, and floating point arguments in
|
|
|
|
// the XMM registers. The return value is in RAX.
|
|
|
|
// This calling convention is used on Linux, with GCC, and on Mac OS,
|
|
|
|
// with GCC. A different convention is used on 64-bit windows.
|
|
|
|
|
2019-05-28 08:28:04 +00:00
|
|
|
using F0 = int();
|
2009-10-08 12:36:12 +00:00
|
|
|
|
|
|
|
#define __ masm->
|
|
|
|
|
2010-07-02 14:09:35 +00:00
|
|
|
static void EntryCode(MacroAssembler* masm) {
|
|
|
|
// Smi constant register is callee save.
|
2017-09-21 03:29:52 +00:00
|
|
|
__ pushq(kRootRegister);
|
2011-03-23 09:05:13 +00:00
|
|
|
__ InitializeRootRegister();
|
2010-07-02 14:09:35 +00:00
|
|
|
}
|
|
|
|
|
2017-09-21 03:29:52 +00:00
|
|
|
static void ExitCode(MacroAssembler* masm) { __ popq(kRootRegister); }
|
2010-07-02 14:09:35 +00:00
|
|
|
|
2009-10-08 12:36:12 +00:00
|
|
|
TEST(Smi) {
|
|
|
|
// Check that C++ Smi operations work as expected.
|
2009-12-10 17:46:45 +00:00
|
|
|
int64_t test_numbers[] = {
|
2009-10-08 12:36:12 +00:00
|
|
|
0, 1, -1, 127, 128, -128, -129, 255, 256, -256, -257,
|
2009-12-10 17:46:45 +00:00
|
|
|
Smi::kMaxValue, static_cast<int64_t>(Smi::kMaxValue) + 1,
|
|
|
|
Smi::kMinValue, static_cast<int64_t>(Smi::kMinValue) - 1
|
2009-10-08 12:36:12 +00:00
|
|
|
};
|
|
|
|
int test_number_count = 15;
|
|
|
|
for (int i = 0; i < test_number_count; i++) {
|
2009-12-10 17:46:45 +00:00
|
|
|
int64_t number = test_numbers[i];
|
2009-10-08 12:36:12 +00:00
|
|
|
bool is_valid = Smi::IsValid(number);
|
|
|
|
bool is_in_range = number >= Smi::kMinValue && number <= Smi::kMaxValue;
|
|
|
|
CHECK_EQ(is_in_range, is_valid);
|
|
|
|
if (is_valid) {
|
2018-11-03 00:13:22 +00:00
|
|
|
Smi smi_from_intptr = Smi::FromIntptr(number);
|
2009-10-08 12:36:12 +00:00
|
|
|
if (static_cast<int>(number) == number) { // Is a 32-bit int.
|
2018-11-03 00:13:22 +00:00
|
|
|
Smi smi_from_int = Smi::FromInt(static_cast<int32_t>(number));
|
2009-10-08 12:36:12 +00:00
|
|
|
CHECK_EQ(smi_from_int, smi_from_intptr);
|
|
|
|
}
|
2009-12-10 17:46:45 +00:00
|
|
|
int64_t smi_value = smi_from_intptr.value();
|
|
|
|
CHECK_EQ(number, smi_value);
|
2009-10-08 12:36:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-03 00:13:22 +00:00
|
|
|
static void TestMoveSmi(MacroAssembler* masm, Label* exit, int id, Smi value) {
|
2009-10-08 12:36:12 +00:00
|
|
|
__ movl(rax, Immediate(id));
|
2013-10-04 07:21:31 +00:00
|
|
|
__ Move(rcx, value);
|
2018-11-03 00:13:22 +00:00
|
|
|
__ Set(rdx, static_cast<intptr_t>(value.ptr()));
|
2020-02-27 10:35:33 +00:00
|
|
|
__ cmpq(rcx, rdx);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ j(not_equal, exit);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Test that we can move a Smi value literally into a register.
|
|
|
|
TEST(SmiMove) {
|
2013-09-19 09:17:13 +00:00
|
|
|
Isolate* isolate = CcTest::i_isolate();
|
2013-02-15 09:27:10 +00:00
|
|
|
HandleScope handles(isolate);
|
2019-01-17 10:23:16 +00:00
|
|
|
auto buffer = AllocateAssemblerBuffer();
|
|
|
|
MacroAssembler assembler(isolate, v8::internal::CodeObjectRequired::kYes,
|
|
|
|
buffer->CreateView());
|
2009-10-08 12:36:12 +00:00
|
|
|
MacroAssembler* masm = &assembler; // Create a pointer for the __ macro.
|
2010-07-02 14:09:35 +00:00
|
|
|
EntryCode(masm);
|
2009-10-08 12:36:12 +00:00
|
|
|
Label exit;
|
|
|
|
|
2018-11-03 00:13:22 +00:00
|
|
|
TestMoveSmi(masm, &exit, 1, Smi::zero());
|
2009-10-08 12:36:12 +00:00
|
|
|
TestMoveSmi(masm, &exit, 2, Smi::FromInt(127));
|
|
|
|
TestMoveSmi(masm, &exit, 3, Smi::FromInt(128));
|
|
|
|
TestMoveSmi(masm, &exit, 4, Smi::FromInt(255));
|
|
|
|
TestMoveSmi(masm, &exit, 5, Smi::FromInt(256));
|
|
|
|
TestMoveSmi(masm, &exit, 6, Smi::FromInt(Smi::kMaxValue));
|
|
|
|
TestMoveSmi(masm, &exit, 7, Smi::FromInt(-1));
|
|
|
|
TestMoveSmi(masm, &exit, 8, Smi::FromInt(-128));
|
|
|
|
TestMoveSmi(masm, &exit, 9, Smi::FromInt(-129));
|
|
|
|
TestMoveSmi(masm, &exit, 10, Smi::FromInt(-256));
|
|
|
|
TestMoveSmi(masm, &exit, 11, Smi::FromInt(-257));
|
|
|
|
TestMoveSmi(masm, &exit, 12, Smi::FromInt(Smi::kMinValue));
|
|
|
|
|
2014-03-26 12:15:35 +00:00
|
|
|
__ xorq(rax, rax); // Success.
|
2009-10-08 12:36:12 +00:00
|
|
|
__ bind(&exit);
|
2010-07-02 14:09:35 +00:00
|
|
|
ExitCode(masm);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ ret(0);
|
|
|
|
|
|
|
|
CodeDesc desc;
|
2017-05-31 14:00:11 +00:00
|
|
|
masm->GetCode(isolate, &desc);
|
2019-01-17 10:23:16 +00:00
|
|
|
buffer->MakeExecutable();
|
2009-10-08 12:36:12 +00:00
|
|
|
// Call the function from C++.
|
2019-01-17 10:23:16 +00:00
|
|
|
auto f = GeneratedCode<F0>::FromBuffer(CcTest::i_isolate(), buffer->start());
|
2018-04-07 01:32:39 +00:00
|
|
|
int result = f.Call();
|
2009-10-08 12:36:12 +00:00
|
|
|
CHECK_EQ(0, result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TestSmiCompare(MacroAssembler* masm, Label* exit, int id, int x, int y) {
|
|
|
|
__ Move(rcx, Smi::FromInt(x));
|
|
|
|
__ movq(r8, rcx);
|
|
|
|
__ Move(rdx, Smi::FromInt(y));
|
|
|
|
__ movq(r9, rdx);
|
|
|
|
__ SmiCompare(rcx, rdx);
|
|
|
|
if (x < y) {
|
|
|
|
__ movl(rax, Immediate(id + 1));
|
|
|
|
__ j(greater_equal, exit);
|
|
|
|
} else if (x > y) {
|
|
|
|
__ movl(rax, Immediate(id + 2));
|
|
|
|
__ j(less_equal, exit);
|
|
|
|
} else {
|
2015-12-07 05:36:41 +00:00
|
|
|
CHECK_EQ(x, y);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ movl(rax, Immediate(id + 3));
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
}
|
|
|
|
__ movl(rax, Immediate(id + 4));
|
|
|
|
__ cmpq(rcx, r8);
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
__ incq(rax);
|
|
|
|
__ cmpq(rdx, r9);
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
|
|
|
|
if (x != y) {
|
|
|
|
__ SmiCompare(rdx, rcx);
|
|
|
|
if (y < x) {
|
|
|
|
__ movl(rax, Immediate(id + 9));
|
|
|
|
__ j(greater_equal, exit);
|
|
|
|
} else {
|
2015-12-07 05:36:41 +00:00
|
|
|
CHECK(y > x);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ movl(rax, Immediate(id + 10));
|
|
|
|
__ j(less_equal, exit);
|
|
|
|
}
|
|
|
|
} else {
|
2011-03-15 10:03:57 +00:00
|
|
|
__ cmpq(rcx, rcx);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ movl(rax, Immediate(id + 11));
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
__ incq(rax);
|
|
|
|
__ cmpq(rcx, r8);
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Test that we can compare smis for equality (and more).
|
|
|
|
TEST(SmiCompare) {
|
2013-09-19 09:17:13 +00:00
|
|
|
Isolate* isolate = CcTest::i_isolate();
|
2013-02-15 09:27:10 +00:00
|
|
|
HandleScope handles(isolate);
|
2019-11-13 16:58:58 +00:00
|
|
|
auto buffer = AllocateAssemblerBuffer(2 * Assembler::kDefaultBufferSize);
|
2019-01-17 10:23:16 +00:00
|
|
|
MacroAssembler assembler(isolate, v8::internal::CodeObjectRequired::kYes,
|
|
|
|
buffer->CreateView());
|
2009-10-08 12:36:12 +00:00
|
|
|
|
|
|
|
MacroAssembler* masm = &assembler;
|
2010-07-02 14:09:35 +00:00
|
|
|
EntryCode(masm);
|
2009-10-08 12:36:12 +00:00
|
|
|
Label exit;
|
|
|
|
|
|
|
|
TestSmiCompare(masm, &exit, 0x10, 0, 0);
|
|
|
|
TestSmiCompare(masm, &exit, 0x20, 0, 1);
|
|
|
|
TestSmiCompare(masm, &exit, 0x30, 1, 0);
|
|
|
|
TestSmiCompare(masm, &exit, 0x40, 1, 1);
|
|
|
|
TestSmiCompare(masm, &exit, 0x50, 0, -1);
|
|
|
|
TestSmiCompare(masm, &exit, 0x60, -1, 0);
|
|
|
|
TestSmiCompare(masm, &exit, 0x70, -1, -1);
|
|
|
|
TestSmiCompare(masm, &exit, 0x80, 0, Smi::kMinValue);
|
|
|
|
TestSmiCompare(masm, &exit, 0x90, Smi::kMinValue, 0);
|
|
|
|
TestSmiCompare(masm, &exit, 0xA0, 0, Smi::kMaxValue);
|
|
|
|
TestSmiCompare(masm, &exit, 0xB0, Smi::kMaxValue, 0);
|
|
|
|
TestSmiCompare(masm, &exit, 0xC0, -1, Smi::kMinValue);
|
|
|
|
TestSmiCompare(masm, &exit, 0xD0, Smi::kMinValue, -1);
|
|
|
|
TestSmiCompare(masm, &exit, 0xE0, -1, Smi::kMaxValue);
|
|
|
|
TestSmiCompare(masm, &exit, 0xF0, Smi::kMaxValue, -1);
|
|
|
|
TestSmiCompare(masm, &exit, 0x100, Smi::kMinValue, Smi::kMinValue);
|
|
|
|
TestSmiCompare(masm, &exit, 0x110, Smi::kMinValue, Smi::kMaxValue);
|
|
|
|
TestSmiCompare(masm, &exit, 0x120, Smi::kMaxValue, Smi::kMinValue);
|
|
|
|
TestSmiCompare(masm, &exit, 0x130, Smi::kMaxValue, Smi::kMaxValue);
|
|
|
|
|
2014-03-26 12:15:35 +00:00
|
|
|
__ xorq(rax, rax); // Success.
|
2009-10-08 12:36:12 +00:00
|
|
|
__ bind(&exit);
|
2010-07-02 14:09:35 +00:00
|
|
|
ExitCode(masm);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ ret(0);
|
|
|
|
|
|
|
|
CodeDesc desc;
|
2017-05-31 14:00:11 +00:00
|
|
|
masm->GetCode(isolate, &desc);
|
2019-01-17 10:23:16 +00:00
|
|
|
buffer->MakeExecutable();
|
2009-10-08 12:36:12 +00:00
|
|
|
// Call the function from C++.
|
2019-01-17 10:23:16 +00:00
|
|
|
auto f = GeneratedCode<F0>::FromBuffer(CcTest::i_isolate(), buffer->start());
|
2018-04-07 01:32:39 +00:00
|
|
|
int result = f.Call();
|
2009-10-08 12:36:12 +00:00
|
|
|
CHECK_EQ(0, result);
|
|
|
|
}
|
|
|
|
|
2018-05-25 21:06:46 +00:00
|
|
|
TEST(SmiTag) {
|
2013-09-19 09:17:13 +00:00
|
|
|
Isolate* isolate = CcTest::i_isolate();
|
2013-02-15 09:27:10 +00:00
|
|
|
HandleScope handles(isolate);
|
2019-01-17 10:23:16 +00:00
|
|
|
auto buffer = AllocateAssemblerBuffer();
|
|
|
|
MacroAssembler assembler(isolate, v8::internal::CodeObjectRequired::kYes,
|
|
|
|
buffer->CreateView());
|
2009-10-08 12:36:12 +00:00
|
|
|
|
|
|
|
MacroAssembler* masm = &assembler;
|
2010-07-02 14:09:35 +00:00
|
|
|
EntryCode(masm);
|
2009-10-08 12:36:12 +00:00
|
|
|
Label exit;
|
|
|
|
|
|
|
|
__ movq(rax, Immediate(1)); // Test number.
|
2018-05-25 21:06:46 +00:00
|
|
|
__ movq(rcx, Immediate(0));
|
2019-09-26 19:54:05 +00:00
|
|
|
__ SmiTag(rcx);
|
2019-11-15 10:39:28 +00:00
|
|
|
__ Set(rdx, Smi::zero().ptr());
|
2019-09-25 14:49:49 +00:00
|
|
|
__ cmp_tagged(rcx, rdx);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ j(not_equal, &exit);
|
|
|
|
|
|
|
|
__ movq(rax, Immediate(2)); // Test number.
|
2018-05-25 21:06:46 +00:00
|
|
|
__ movq(rcx, Immediate(1024));
|
2019-09-26 19:54:05 +00:00
|
|
|
__ SmiTag(rcx);
|
2018-11-03 00:13:22 +00:00
|
|
|
__ Set(rdx, Smi::FromInt(1024).ptr());
|
2019-09-25 14:49:49 +00:00
|
|
|
__ cmp_tagged(rcx, rdx);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ j(not_equal, &exit);
|
|
|
|
|
|
|
|
__ movq(rax, Immediate(3)); // Test number.
|
2018-05-25 21:06:46 +00:00
|
|
|
__ movq(rcx, Immediate(-1));
|
2019-09-26 19:54:05 +00:00
|
|
|
__ SmiTag(rcx);
|
2018-11-03 00:13:22 +00:00
|
|
|
__ Set(rdx, Smi::FromInt(-1).ptr());
|
2019-09-25 14:49:49 +00:00
|
|
|
__ cmp_tagged(rcx, rdx);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ j(not_equal, &exit);
|
|
|
|
|
|
|
|
__ movq(rax, Immediate(4)); // Test number.
|
2018-05-25 21:06:46 +00:00
|
|
|
__ movq(rcx, Immediate(Smi::kMaxValue));
|
2019-09-26 19:54:05 +00:00
|
|
|
__ SmiTag(rcx);
|
2018-11-03 00:13:22 +00:00
|
|
|
__ Set(rdx, Smi::FromInt(Smi::kMaxValue).ptr());
|
2019-09-25 14:49:49 +00:00
|
|
|
__ cmp_tagged(rcx, rdx);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ j(not_equal, &exit);
|
|
|
|
|
|
|
|
__ movq(rax, Immediate(5)); // Test number.
|
2018-05-25 21:06:46 +00:00
|
|
|
__ movq(rcx, Immediate(Smi::kMinValue));
|
2019-09-26 19:54:05 +00:00
|
|
|
__ SmiTag(rcx);
|
2018-11-03 00:13:22 +00:00
|
|
|
__ Set(rdx, Smi::FromInt(Smi::kMinValue).ptr());
|
2019-09-25 14:49:49 +00:00
|
|
|
__ cmp_tagged(rcx, rdx);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ j(not_equal, &exit);
|
|
|
|
|
|
|
|
// Different target register.
|
|
|
|
|
|
|
|
__ movq(rax, Immediate(6)); // Test number.
|
2018-05-25 21:06:46 +00:00
|
|
|
__ movq(rcx, Immediate(0));
|
|
|
|
__ SmiTag(r8, rcx);
|
2018-11-03 00:13:22 +00:00
|
|
|
__ Set(rdx, Smi::zero().ptr());
|
2019-09-25 14:49:49 +00:00
|
|
|
__ cmp_tagged(r8, rdx);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ j(not_equal, &exit);
|
|
|
|
|
|
|
|
__ movq(rax, Immediate(7)); // Test number.
|
2018-05-25 21:06:46 +00:00
|
|
|
__ movq(rcx, Immediate(1024));
|
|
|
|
__ SmiTag(r8, rcx);
|
2018-11-03 00:13:22 +00:00
|
|
|
__ Set(rdx, Smi::FromInt(1024).ptr());
|
2019-09-25 14:49:49 +00:00
|
|
|
__ cmp_tagged(r8, rdx);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ j(not_equal, &exit);
|
|
|
|
|
|
|
|
__ movq(rax, Immediate(8)); // Test number.
|
2018-05-25 21:06:46 +00:00
|
|
|
__ movq(rcx, Immediate(-1));
|
|
|
|
__ SmiTag(r8, rcx);
|
2018-11-03 00:13:22 +00:00
|
|
|
__ Set(rdx, Smi::FromInt(-1).ptr());
|
2019-09-25 14:49:49 +00:00
|
|
|
__ cmp_tagged(r8, rdx);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ j(not_equal, &exit);
|
|
|
|
|
|
|
|
__ movq(rax, Immediate(9)); // Test number.
|
2018-05-25 21:06:46 +00:00
|
|
|
__ movq(rcx, Immediate(Smi::kMaxValue));
|
|
|
|
__ SmiTag(r8, rcx);
|
2018-11-03 00:13:22 +00:00
|
|
|
__ Set(rdx, Smi::FromInt(Smi::kMaxValue).ptr());
|
2019-09-25 14:49:49 +00:00
|
|
|
__ cmp_tagged(r8, rdx);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ j(not_equal, &exit);
|
|
|
|
|
|
|
|
__ movq(rax, Immediate(10)); // Test number.
|
2018-05-25 21:06:46 +00:00
|
|
|
__ movq(rcx, Immediate(Smi::kMinValue));
|
|
|
|
__ SmiTag(r8, rcx);
|
2018-11-03 00:13:22 +00:00
|
|
|
__ Set(rdx, Smi::FromInt(Smi::kMinValue).ptr());
|
2019-09-25 14:49:49 +00:00
|
|
|
__ cmp_tagged(r8, rdx);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ j(not_equal, &exit);
|
|
|
|
|
|
|
|
|
2014-03-26 12:15:35 +00:00
|
|
|
__ xorq(rax, rax); // Success.
|
2009-10-08 12:36:12 +00:00
|
|
|
__ bind(&exit);
|
2010-07-02 14:09:35 +00:00
|
|
|
ExitCode(masm);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ ret(0);
|
|
|
|
|
|
|
|
CodeDesc desc;
|
2017-05-31 14:00:11 +00:00
|
|
|
masm->GetCode(isolate, &desc);
|
2019-01-17 10:23:16 +00:00
|
|
|
buffer->MakeExecutable();
|
2009-10-08 12:36:12 +00:00
|
|
|
// Call the function from C++.
|
2019-01-17 10:23:16 +00:00
|
|
|
auto f = GeneratedCode<F0>::FromBuffer(CcTest::i_isolate(), buffer->start());
|
2018-04-07 01:32:39 +00:00
|
|
|
int result = f.Call();
|
2009-10-08 12:36:12 +00:00
|
|
|
CHECK_EQ(0, result);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(SmiCheck) {
|
2013-09-19 09:17:13 +00:00
|
|
|
Isolate* isolate = CcTest::i_isolate();
|
2013-02-15 09:27:10 +00:00
|
|
|
HandleScope handles(isolate);
|
2019-01-17 10:23:16 +00:00
|
|
|
auto buffer = AllocateAssemblerBuffer();
|
|
|
|
MacroAssembler assembler(isolate, v8::internal::CodeObjectRequired::kYes,
|
|
|
|
buffer->CreateView());
|
2009-10-08 12:36:12 +00:00
|
|
|
|
|
|
|
MacroAssembler* masm = &assembler;
|
2010-07-02 14:09:35 +00:00
|
|
|
EntryCode(masm);
|
2009-10-08 12:36:12 +00:00
|
|
|
Label exit;
|
|
|
|
Condition cond;
|
|
|
|
|
|
|
|
__ movl(rax, Immediate(1)); // Test number.
|
|
|
|
|
|
|
|
// CheckSmi
|
|
|
|
|
|
|
|
__ movl(rcx, Immediate(0));
|
2019-09-26 19:54:05 +00:00
|
|
|
__ SmiTag(rcx);
|
2009-10-08 12:36:12 +00:00
|
|
|
cond = masm->CheckSmi(rcx);
|
|
|
|
__ j(NegateCondition(cond), &exit);
|
|
|
|
|
|
|
|
__ incq(rax);
|
2014-03-26 12:15:35 +00:00
|
|
|
__ xorq(rcx, Immediate(kSmiTagMask));
|
2009-10-08 12:36:12 +00:00
|
|
|
cond = masm->CheckSmi(rcx);
|
|
|
|
__ j(cond, &exit);
|
|
|
|
|
|
|
|
__ incq(rax);
|
|
|
|
__ movl(rcx, Immediate(-1));
|
2019-09-26 19:54:05 +00:00
|
|
|
__ SmiTag(rcx);
|
2009-10-08 12:36:12 +00:00
|
|
|
cond = masm->CheckSmi(rcx);
|
|
|
|
__ j(NegateCondition(cond), &exit);
|
|
|
|
|
|
|
|
__ incq(rax);
|
2014-03-26 12:15:35 +00:00
|
|
|
__ xorq(rcx, Immediate(kSmiTagMask));
|
2009-10-08 12:36:12 +00:00
|
|
|
cond = masm->CheckSmi(rcx);
|
|
|
|
__ j(cond, &exit);
|
|
|
|
|
|
|
|
__ incq(rax);
|
|
|
|
__ movl(rcx, Immediate(Smi::kMaxValue));
|
2019-09-26 19:54:05 +00:00
|
|
|
__ SmiTag(rcx);
|
2009-10-08 12:36:12 +00:00
|
|
|
cond = masm->CheckSmi(rcx);
|
|
|
|
__ j(NegateCondition(cond), &exit);
|
|
|
|
|
|
|
|
__ incq(rax);
|
2014-03-26 12:15:35 +00:00
|
|
|
__ xorq(rcx, Immediate(kSmiTagMask));
|
2009-10-08 12:36:12 +00:00
|
|
|
cond = masm->CheckSmi(rcx);
|
|
|
|
__ j(cond, &exit);
|
|
|
|
|
|
|
|
__ incq(rax);
|
|
|
|
__ movl(rcx, Immediate(Smi::kMinValue));
|
2019-09-26 19:54:05 +00:00
|
|
|
__ SmiTag(rcx);
|
2009-10-08 12:36:12 +00:00
|
|
|
cond = masm->CheckSmi(rcx);
|
|
|
|
__ j(NegateCondition(cond), &exit);
|
|
|
|
|
|
|
|
__ incq(rax);
|
2014-03-26 12:15:35 +00:00
|
|
|
__ xorq(rcx, Immediate(kSmiTagMask));
|
2009-10-08 12:36:12 +00:00
|
|
|
cond = masm->CheckSmi(rcx);
|
|
|
|
__ j(cond, &exit);
|
|
|
|
|
|
|
|
// Success
|
2014-03-26 12:15:35 +00:00
|
|
|
__ xorq(rax, rax);
|
2009-10-08 12:36:12 +00:00
|
|
|
|
|
|
|
__ bind(&exit);
|
2010-07-02 14:09:35 +00:00
|
|
|
ExitCode(masm);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ ret(0);
|
|
|
|
|
|
|
|
CodeDesc desc;
|
2017-05-31 14:00:11 +00:00
|
|
|
masm->GetCode(isolate, &desc);
|
2019-01-17 10:23:16 +00:00
|
|
|
buffer->MakeExecutable();
|
2009-10-08 12:36:12 +00:00
|
|
|
// Call the function from C++.
|
2019-01-17 10:23:16 +00:00
|
|
|
auto f = GeneratedCode<F0>::FromBuffer(CcTest::i_isolate(), buffer->start());
|
2018-04-07 01:32:39 +00:00
|
|
|
int result = f.Call();
|
2009-10-08 12:36:12 +00:00
|
|
|
CHECK_EQ(0, result);
|
|
|
|
}
|
|
|
|
|
2017-08-11 11:14:38 +00:00
|
|
|
void TestSmiIndex(MacroAssembler* masm, Label* exit, int id, int x) {
|
|
|
|
__ movl(rax, Immediate(id));
|
2009-10-08 12:36:12 +00:00
|
|
|
|
2017-08-11 11:14:38 +00:00
|
|
|
for (int i = 0; i < 8; i++) {
|
|
|
|
__ Move(rcx, Smi::FromInt(x));
|
|
|
|
SmiIndex index = masm->SmiToIndex(rdx, rcx, i);
|
2017-09-07 14:23:11 +00:00
|
|
|
CHECK(index.reg == rcx || index.reg == rdx);
|
2017-08-11 11:14:38 +00:00
|
|
|
__ shlq(index.reg, Immediate(index.scale));
|
|
|
|
__ Set(r8, static_cast<intptr_t>(x) << i);
|
|
|
|
__ cmpq(index.reg, r8);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ j(not_equal, exit);
|
|
|
|
__ incq(rax);
|
2017-08-11 11:14:38 +00:00
|
|
|
__ Move(rcx, Smi::FromInt(x));
|
|
|
|
index = masm->SmiToIndex(rcx, rcx, i);
|
2017-09-07 14:23:11 +00:00
|
|
|
CHECK(index.reg == rcx);
|
2017-08-11 11:14:38 +00:00
|
|
|
__ shlq(rcx, Immediate(index.scale));
|
|
|
|
__ Set(r8, static_cast<intptr_t>(x) << i);
|
2011-03-15 10:03:57 +00:00
|
|
|
__ cmpq(rcx, r8);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ j(not_equal, exit);
|
|
|
|
__ incq(rax);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-30 06:57:15 +00:00
|
|
|
TEST(EmbeddedObj) {
|
|
|
|
#ifdef V8_COMPRESS_POINTERS
|
|
|
|
FLAG_always_compact = true;
|
|
|
|
v8::V8::Initialize();
|
|
|
|
|
|
|
|
Isolate* isolate = CcTest::i_isolate();
|
|
|
|
HandleScope handles(isolate);
|
|
|
|
auto buffer = AllocateAssemblerBuffer();
|
|
|
|
MacroAssembler assembler(isolate, v8::internal::CodeObjectRequired::kYes,
|
|
|
|
buffer->CreateView());
|
|
|
|
|
|
|
|
MacroAssembler* masm = &assembler;
|
|
|
|
EntryCode(masm);
|
|
|
|
Label exit;
|
|
|
|
Handle<HeapObject> old_array = isolate->factory()->NewFixedArray(2000);
|
|
|
|
Handle<HeapObject> my_array = isolate->factory()->NewFixedArray(1000);
|
|
|
|
__ Move(rcx, my_array, RelocInfo::COMPRESSED_EMBEDDED_OBJECT);
|
|
|
|
__ Move(rax, old_array, RelocInfo::FULL_EMBEDDED_OBJECT);
|
|
|
|
__ bind(&exit);
|
|
|
|
ExitCode(masm);
|
|
|
|
__ ret(0);
|
|
|
|
|
|
|
|
CodeDesc desc;
|
|
|
|
masm->GetCode(isolate, &desc);
|
2020-09-30 11:28:28 +00:00
|
|
|
Handle<Code> code = Factory::CodeBuilder(
|
|
|
|
isolate, desc, CodeKind::DEOPT_ENTRIES_OR_FOR_TESTING)
|
|
|
|
.Build();
|
2019-04-30 06:57:15 +00:00
|
|
|
#ifdef OBJECT_PRINT
|
|
|
|
StdoutStream os;
|
|
|
|
code->Print(os);
|
|
|
|
#endif
|
2019-05-28 08:28:04 +00:00
|
|
|
using myF0 = Address();
|
2019-05-14 08:28:25 +00:00
|
|
|
auto f = GeneratedCode<myF0>::FromAddress(isolate, code->entry());
|
2019-05-15 14:28:57 +00:00
|
|
|
Object result = Object(f.Call());
|
2019-04-30 06:57:15 +00:00
|
|
|
CHECK_EQ(old_array->ptr(), result.ptr());
|
|
|
|
|
|
|
|
// Collect garbage to ensure reloc info can be walked by the heap.
|
|
|
|
CcTest::CollectAllGarbage();
|
|
|
|
CcTest::CollectAllGarbage();
|
|
|
|
CcTest::CollectAllGarbage();
|
|
|
|
|
|
|
|
// Test the user-facing reloc interface.
|
|
|
|
const int mode_mask = RelocInfo::EmbeddedObjectModeMask();
|
|
|
|
for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) {
|
|
|
|
RelocInfo::Mode mode = it.rinfo()->rmode();
|
|
|
|
if (RelocInfo::IsCompressedEmbeddedObject(mode)) {
|
|
|
|
CHECK_EQ(*my_array, it.rinfo()->target_object());
|
|
|
|
} else {
|
|
|
|
CHECK(RelocInfo::IsFullEmbeddedObject(mode));
|
|
|
|
CHECK_EQ(*old_array, it.rinfo()->target_object());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif // V8_COMPRESS_POINTERS
|
|
|
|
}
|
|
|
|
|
2017-08-11 11:14:38 +00:00
|
|
|
TEST(SmiIndex) {
|
2013-09-19 09:17:13 +00:00
|
|
|
Isolate* isolate = CcTest::i_isolate();
|
2013-02-15 09:27:10 +00:00
|
|
|
HandleScope handles(isolate);
|
2019-01-17 10:23:16 +00:00
|
|
|
auto buffer = AllocateAssemblerBuffer();
|
|
|
|
MacroAssembler assembler(isolate, v8::internal::CodeObjectRequired::kYes,
|
|
|
|
buffer->CreateView());
|
2009-10-08 12:36:12 +00:00
|
|
|
|
|
|
|
MacroAssembler* masm = &assembler;
|
2010-07-02 14:09:35 +00:00
|
|
|
EntryCode(masm);
|
2009-10-08 12:36:12 +00:00
|
|
|
Label exit;
|
|
|
|
|
2017-08-11 11:14:38 +00:00
|
|
|
TestSmiIndex(masm, &exit, 0x10, 0);
|
|
|
|
TestSmiIndex(masm, &exit, 0x20, 1);
|
|
|
|
TestSmiIndex(masm, &exit, 0x30, 100);
|
|
|
|
TestSmiIndex(masm, &exit, 0x40, 1000);
|
|
|
|
TestSmiIndex(masm, &exit, 0x50, Smi::kMaxValue);
|
2009-10-08 12:36:12 +00:00
|
|
|
|
2014-03-26 12:15:35 +00:00
|
|
|
__ xorq(rax, rax); // Success.
|
2009-10-08 12:36:12 +00:00
|
|
|
__ bind(&exit);
|
2010-07-02 14:09:35 +00:00
|
|
|
ExitCode(masm);
|
2009-10-08 12:36:12 +00:00
|
|
|
__ ret(0);
|
|
|
|
|
|
|
|
CodeDesc desc;
|
2017-05-31 14:00:11 +00:00
|
|
|
masm->GetCode(isolate, &desc);
|
2019-01-17 10:23:16 +00:00
|
|
|
buffer->MakeExecutable();
|
2009-10-08 12:36:12 +00:00
|
|
|
// Call the function from C++.
|
2019-01-17 10:23:16 +00:00
|
|
|
auto f = GeneratedCode<F0>::FromBuffer(CcTest::i_isolate(), buffer->start());
|
2018-04-07 01:32:39 +00:00
|
|
|
int result = f.Call();
|
2009-10-08 12:36:12 +00:00
|
|
|
CHECK_EQ(0, result);
|
|
|
|
}
|
|
|
|
|
2010-05-26 10:02:07 +00:00
|
|
|
TEST(OperandOffset) {
|
2013-11-12 12:09:38 +00:00
|
|
|
uint32_t data[256];
|
|
|
|
for (uint32_t i = 0; i < 256; i++) { data[i] = i * 0x01010101; }
|
2010-05-26 10:02:07 +00:00
|
|
|
|
2013-09-19 09:17:13 +00:00
|
|
|
Isolate* isolate = CcTest::i_isolate();
|
2013-02-15 09:27:10 +00:00
|
|
|
HandleScope handles(isolate);
|
2019-01-17 10:23:16 +00:00
|
|
|
auto buffer = AllocateAssemblerBuffer();
|
|
|
|
MacroAssembler assembler(isolate, v8::internal::CodeObjectRequired::kYes,
|
|
|
|
buffer->CreateView());
|
2010-05-26 10:02:07 +00:00
|
|
|
|
|
|
|
MacroAssembler* masm = &assembler;
|
|
|
|
Label exit;
|
|
|
|
|
2010-07-02 14:09:35 +00:00
|
|
|
EntryCode(masm);
|
2014-03-19 08:59:04 +00:00
|
|
|
__ pushq(r13);
|
|
|
|
__ pushq(r14);
|
|
|
|
__ pushq(rbx);
|
|
|
|
__ pushq(rbp);
|
|
|
|
__ pushq(Immediate(0x100)); // <-- rbp
|
2010-05-26 10:02:07 +00:00
|
|
|
__ movq(rbp, rsp);
|
2014-03-19 08:59:04 +00:00
|
|
|
__ pushq(Immediate(0x101));
|
|
|
|
__ pushq(Immediate(0x102));
|
|
|
|
__ pushq(Immediate(0x103));
|
|
|
|
__ pushq(Immediate(0x104));
|
|
|
|
__ pushq(Immediate(0x105)); // <-- rbx
|
|
|
|
__ pushq(Immediate(0x106));
|
|
|
|
__ pushq(Immediate(0x107));
|
|
|
|
__ pushq(Immediate(0x108));
|
|
|
|
__ pushq(Immediate(0x109)); // <-- rsp
|
2010-05-26 10:02:07 +00:00
|
|
|
// rbp = rsp[9]
|
2011-03-10 10:14:24 +00:00
|
|
|
// r15 = rsp[3]
|
2010-05-26 10:02:07 +00:00
|
|
|
// rbx = rsp[5]
|
|
|
|
// r13 = rsp[7]
|
2018-12-21 11:11:35 +00:00
|
|
|
__ leaq(r14, Operand(rsp, 3 * kSystemPointerSize));
|
|
|
|
__ leaq(r13, Operand(rbp, -3 * kSystemPointerSize));
|
|
|
|
__ leaq(rbx, Operand(rbp, -5 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ movl(rcx, Immediate(2));
|
2018-01-22 14:04:45 +00:00
|
|
|
__ Move(r8, reinterpret_cast<Address>(&data[128]), RelocInfo::NONE);
|
2010-05-26 10:02:07 +00:00
|
|
|
__ movl(rax, Immediate(1));
|
|
|
|
|
|
|
|
Operand sp0 = Operand(rsp, 0);
|
|
|
|
|
|
|
|
// Test 1.
|
|
|
|
__ movl(rdx, sp0); // Sanity check.
|
|
|
|
__ cmpl(rdx, Immediate(0x109));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
// Test 2.
|
|
|
|
// Zero to non-zero displacement.
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(sp0, 2 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x107));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2018-12-21 11:11:35 +00:00
|
|
|
Operand sp2 = Operand(rsp, 2 * kSystemPointerSize);
|
2010-05-26 10:02:07 +00:00
|
|
|
|
|
|
|
// Test 3.
|
|
|
|
__ movl(rdx, sp2); // Sanity check.
|
|
|
|
__ cmpl(rdx, Immediate(0x107));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(sp2, 2 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x105));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
// Non-zero to zero displacement.
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(sp2, -2 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x109));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2019-02-14 16:23:27 +00:00
|
|
|
Operand sp2c2 =
|
|
|
|
Operand(rsp, rcx, times_system_pointer_size, 2 * kSystemPointerSize);
|
2010-05-26 10:02:07 +00:00
|
|
|
|
|
|
|
// Test 6.
|
|
|
|
__ movl(rdx, sp2c2); // Sanity check.
|
|
|
|
__ cmpl(rdx, Immediate(0x105));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(sp2c2, 2 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x103));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
// Non-zero to zero displacement.
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(sp2c2, -2 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x107));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
|
|
|
|
Operand bp0 = Operand(rbp, 0);
|
|
|
|
|
|
|
|
// Test 9.
|
|
|
|
__ movl(rdx, bp0); // Sanity check.
|
|
|
|
__ cmpl(rdx, Immediate(0x100));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
// Zero to non-zero displacement.
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(bp0, -2 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x102));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2018-12-21 11:11:35 +00:00
|
|
|
Operand bp2 = Operand(rbp, -2 * kSystemPointerSize);
|
2010-05-26 10:02:07 +00:00
|
|
|
|
|
|
|
// Test 11.
|
|
|
|
__ movl(rdx, bp2); // Sanity check.
|
|
|
|
__ cmpl(rdx, Immediate(0x102));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
// Non-zero to zero displacement.
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(bp2, 2 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x100));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(bp2, -2 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x104));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2018-12-21 11:11:35 +00:00
|
|
|
Operand bp2c4 =
|
2019-02-14 16:23:27 +00:00
|
|
|
Operand(rbp, rcx, times_system_pointer_size, -4 * kSystemPointerSize);
|
2010-05-26 10:02:07 +00:00
|
|
|
|
|
|
|
// Test 14:
|
|
|
|
__ movl(rdx, bp2c4); // Sanity check.
|
|
|
|
__ cmpl(rdx, Immediate(0x102));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(bp2c4, 2 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x100));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(bp2c4, -2 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x104));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
Operand bx0 = Operand(rbx, 0);
|
|
|
|
|
|
|
|
// Test 17.
|
|
|
|
__ movl(rdx, bx0); // Sanity check.
|
|
|
|
__ cmpl(rdx, Immediate(0x105));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(bx0, 5 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x100));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(bx0, -4 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x109));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2018-12-21 11:11:35 +00:00
|
|
|
Operand bx2 = Operand(rbx, 2 * kSystemPointerSize);
|
2010-05-26 10:02:07 +00:00
|
|
|
|
|
|
|
// Test 20.
|
|
|
|
__ movl(rdx, bx2); // Sanity check.
|
|
|
|
__ cmpl(rdx, Immediate(0x103));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(bx2, 2 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x101));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
// Non-zero to zero displacement.
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(bx2, -2 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x105));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2018-12-21 11:11:35 +00:00
|
|
|
Operand bx2c2 =
|
2019-02-14 16:23:27 +00:00
|
|
|
Operand(rbx, rcx, times_system_pointer_size, -2 * kSystemPointerSize);
|
2010-05-26 10:02:07 +00:00
|
|
|
|
|
|
|
// Test 23.
|
|
|
|
__ movl(rdx, bx2c2); // Sanity check.
|
|
|
|
__ cmpl(rdx, Immediate(0x105));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(bx2c2, 2 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x103));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
2018-12-21 11:11:35 +00:00
|
|
|
__ movl(rdx, Operand(bx2c2, -2 * kSystemPointerSize));
|
2010-05-26 10:02:07 +00:00
|
|
|
__ cmpl(rdx, Immediate(0x107));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
Operand r80 = Operand(r8, 0);
|
|
|
|
|
|
|
|
// Test 26.
|
|
|
|
__ movl(rdx, r80); // Sanity check.
|
|
|
|
__ cmpl(rdx, Immediate(0x80808080));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r80, -8 * kIntSize));
|
|
|
|
__ cmpl(rdx, Immediate(0x78787878));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r80, 8 * kIntSize));
|
|
|
|
__ cmpl(rdx, Immediate(0x88888888));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r80, -64 * kIntSize));
|
|
|
|
__ cmpl(rdx, Immediate(0x40404040));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r80, 64 * kIntSize));
|
|
|
|
__ cmpl(rdx, Immediate(0xC0C0C0C0));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
Operand r88 = Operand(r8, 8 * kIntSize);
|
|
|
|
|
|
|
|
// Test 31.
|
|
|
|
__ movl(rdx, r88); // Sanity check.
|
|
|
|
__ cmpl(rdx, Immediate(0x88888888));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r88, -8 * kIntSize));
|
|
|
|
__ cmpl(rdx, Immediate(0x80808080));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r88, 8 * kIntSize));
|
|
|
|
__ cmpl(rdx, Immediate(0x90909090));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r88, -64 * kIntSize));
|
|
|
|
__ cmpl(rdx, Immediate(0x48484848));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r88, 64 * kIntSize));
|
|
|
|
__ cmpl(rdx, Immediate(0xC8C8C8C8));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
|
|
|
|
Operand r864 = Operand(r8, 64 * kIntSize);
|
|
|
|
|
|
|
|
// Test 36.
|
|
|
|
__ movl(rdx, r864); // Sanity check.
|
|
|
|
__ cmpl(rdx, Immediate(0xC0C0C0C0));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r864, -8 * kIntSize));
|
|
|
|
__ cmpl(rdx, Immediate(0xB8B8B8B8));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r864, 8 * kIntSize));
|
|
|
|
__ cmpl(rdx, Immediate(0xC8C8C8C8));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r864, -64 * kIntSize));
|
|
|
|
__ cmpl(rdx, Immediate(0x80808080));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r864, 32 * kIntSize));
|
|
|
|
__ cmpl(rdx, Immediate(0xE0E0E0E0));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
// 32-bit offset to 8-bit offset.
|
|
|
|
__ movl(rdx, Operand(r864, -60 * kIntSize));
|
|
|
|
__ cmpl(rdx, Immediate(0x84848484));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r864, 60 * kIntSize));
|
|
|
|
__ cmpl(rdx, Immediate(0xFCFCFCFC));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
// Test unaligned offsets.
|
|
|
|
|
|
|
|
// Test 43.
|
|
|
|
__ movl(rdx, Operand(r80, 2));
|
|
|
|
__ cmpl(rdx, Immediate(0x81818080));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r80, -2));
|
|
|
|
__ cmpl(rdx, Immediate(0x80807F7F));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r80, 126));
|
|
|
|
__ cmpl(rdx, Immediate(0xA0A09F9F));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r80, -126));
|
|
|
|
__ cmpl(rdx, Immediate(0x61616060));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r80, 254));
|
|
|
|
__ cmpl(rdx, Immediate(0xC0C0BFBF));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
__ movl(rdx, Operand(r80, -254));
|
|
|
|
__ cmpl(rdx, Immediate(0x41414040));
|
|
|
|
__ j(not_equal, &exit);
|
|
|
|
__ incq(rax);
|
|
|
|
|
|
|
|
// Success.
|
|
|
|
|
|
|
|
__ movl(rax, Immediate(0));
|
|
|
|
__ bind(&exit);
|
2018-12-21 11:11:35 +00:00
|
|
|
__ leaq(rsp, Operand(rbp, kSystemPointerSize));
|
2014-03-19 08:59:04 +00:00
|
|
|
__ popq(rbp);
|
|
|
|
__ popq(rbx);
|
|
|
|
__ popq(r14);
|
|
|
|
__ popq(r13);
|
2010-07-02 14:09:35 +00:00
|
|
|
ExitCode(masm);
|
2010-05-26 10:02:07 +00:00
|
|
|
__ ret(0);
|
|
|
|
|
|
|
|
|
|
|
|
CodeDesc desc;
|
2017-05-31 14:00:11 +00:00
|
|
|
masm->GetCode(isolate, &desc);
|
2019-01-17 10:23:16 +00:00
|
|
|
buffer->MakeExecutable();
|
2010-05-26 10:02:07 +00:00
|
|
|
// Call the function from C++.
|
2019-01-17 10:23:16 +00:00
|
|
|
auto f = GeneratedCode<F0>::FromBuffer(CcTest::i_isolate(), buffer->start());
|
2018-04-07 01:32:39 +00:00
|
|
|
int result = f.Call();
|
2010-05-26 10:02:07 +00:00
|
|
|
CHECK_EQ(0, result);
|
|
|
|
}
|
|
|
|
|
2016-07-21 11:01:44 +00:00
|
|
|
void TestFloat32x4Abs(MacroAssembler* masm, Label* exit, float x, float y,
|
|
|
|
float z, float w) {
|
2019-05-02 17:02:14 +00:00
|
|
|
__ AllocateStackSpace(kSimd128Size);
|
2016-07-21 11:01:44 +00:00
|
|
|
|
|
|
|
__ Move(xmm1, x);
|
|
|
|
__ Movss(Operand(rsp, 0 * kFloatSize), xmm1);
|
|
|
|
__ Move(xmm2, y);
|
|
|
|
__ Movss(Operand(rsp, 1 * kFloatSize), xmm2);
|
|
|
|
__ Move(xmm3, z);
|
|
|
|
__ Movss(Operand(rsp, 2 * kFloatSize), xmm3);
|
|
|
|
__ Move(xmm4, w);
|
|
|
|
__ Movss(Operand(rsp, 3 * kFloatSize), xmm4);
|
|
|
|
__ Movups(xmm0, Operand(rsp, 0));
|
|
|
|
|
|
|
|
__ Absps(xmm0);
|
|
|
|
__ Movups(Operand(rsp, 0), xmm0);
|
|
|
|
|
|
|
|
__ incq(rax);
|
|
|
|
__ Move(xmm1, fabsf(x));
|
|
|
|
__ Ucomiss(xmm1, Operand(rsp, 0 * kFloatSize));
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
__ incq(rax);
|
|
|
|
__ Move(xmm2, fabsf(y));
|
|
|
|
__ Ucomiss(xmm2, Operand(rsp, 1 * kFloatSize));
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
__ incq(rax);
|
|
|
|
__ Move(xmm3, fabsf(z));
|
|
|
|
__ Ucomiss(xmm3, Operand(rsp, 2 * kFloatSize));
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
__ incq(rax);
|
|
|
|
__ Move(xmm4, fabsf(w));
|
|
|
|
__ Ucomiss(xmm4, Operand(rsp, 3 * kFloatSize));
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
|
|
|
|
__ addq(rsp, Immediate(kSimd128Size));
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestFloat32x4Neg(MacroAssembler* masm, Label* exit, float x, float y,
|
|
|
|
float z, float w) {
|
2019-05-02 17:02:14 +00:00
|
|
|
__ AllocateStackSpace(kSimd128Size);
|
2016-07-21 11:01:44 +00:00
|
|
|
|
|
|
|
__ Move(xmm1, x);
|
|
|
|
__ Movss(Operand(rsp, 0 * kFloatSize), xmm1);
|
|
|
|
__ Move(xmm2, y);
|
|
|
|
__ Movss(Operand(rsp, 1 * kFloatSize), xmm2);
|
|
|
|
__ Move(xmm3, z);
|
|
|
|
__ Movss(Operand(rsp, 2 * kFloatSize), xmm3);
|
|
|
|
__ Move(xmm4, w);
|
|
|
|
__ Movss(Operand(rsp, 3 * kFloatSize), xmm4);
|
|
|
|
__ Movups(xmm0, Operand(rsp, 0));
|
|
|
|
|
|
|
|
__ Negps(xmm0);
|
|
|
|
__ Movups(Operand(rsp, 0), xmm0);
|
|
|
|
|
|
|
|
__ incq(rax);
|
|
|
|
__ Move(xmm1, -x);
|
|
|
|
__ Ucomiss(xmm1, Operand(rsp, 0 * kFloatSize));
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
__ incq(rax);
|
|
|
|
__ Move(xmm2, -y);
|
|
|
|
__ Ucomiss(xmm2, Operand(rsp, 1 * kFloatSize));
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
__ incq(rax);
|
|
|
|
__ Move(xmm3, -z);
|
|
|
|
__ Ucomiss(xmm3, Operand(rsp, 2 * kFloatSize));
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
__ incq(rax);
|
|
|
|
__ Move(xmm4, -w);
|
|
|
|
__ Ucomiss(xmm4, Operand(rsp, 3 * kFloatSize));
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
|
|
|
|
__ addq(rsp, Immediate(kSimd128Size));
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestFloat64x2Abs(MacroAssembler* masm, Label* exit, double x, double y) {
|
2019-05-02 17:02:14 +00:00
|
|
|
__ AllocateStackSpace(kSimd128Size);
|
2016-07-21 11:01:44 +00:00
|
|
|
|
|
|
|
__ Move(xmm1, x);
|
|
|
|
__ Movsd(Operand(rsp, 0 * kDoubleSize), xmm1);
|
|
|
|
__ Move(xmm2, y);
|
|
|
|
__ Movsd(Operand(rsp, 1 * kDoubleSize), xmm2);
|
2017-06-30 12:58:31 +00:00
|
|
|
__ movupd(xmm0, Operand(rsp, 0));
|
2016-07-21 11:01:44 +00:00
|
|
|
|
|
|
|
__ Abspd(xmm0);
|
2017-06-30 12:58:31 +00:00
|
|
|
__ movupd(Operand(rsp, 0), xmm0);
|
2016-07-21 11:01:44 +00:00
|
|
|
|
|
|
|
__ incq(rax);
|
|
|
|
__ Move(xmm1, fabs(x));
|
|
|
|
__ Ucomisd(xmm1, Operand(rsp, 0 * kDoubleSize));
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
__ incq(rax);
|
|
|
|
__ Move(xmm2, fabs(y));
|
|
|
|
__ Ucomisd(xmm2, Operand(rsp, 1 * kDoubleSize));
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
|
|
|
|
__ addq(rsp, Immediate(kSimd128Size));
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestFloat64x2Neg(MacroAssembler* masm, Label* exit, double x, double y) {
|
2019-05-02 17:02:14 +00:00
|
|
|
__ AllocateStackSpace(kSimd128Size);
|
2016-07-21 11:01:44 +00:00
|
|
|
|
|
|
|
__ Move(xmm1, x);
|
|
|
|
__ Movsd(Operand(rsp, 0 * kDoubleSize), xmm1);
|
|
|
|
__ Move(xmm2, y);
|
|
|
|
__ Movsd(Operand(rsp, 1 * kDoubleSize), xmm2);
|
2017-06-30 12:58:31 +00:00
|
|
|
__ movupd(xmm0, Operand(rsp, 0));
|
2016-07-21 11:01:44 +00:00
|
|
|
|
|
|
|
__ Negpd(xmm0);
|
2017-06-30 12:58:31 +00:00
|
|
|
__ movupd(Operand(rsp, 0), xmm0);
|
2016-07-21 11:01:44 +00:00
|
|
|
|
|
|
|
__ incq(rax);
|
|
|
|
__ Move(xmm1, -x);
|
|
|
|
__ Ucomisd(xmm1, Operand(rsp, 0 * kDoubleSize));
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
__ incq(rax);
|
|
|
|
__ Move(xmm2, -y);
|
|
|
|
__ Ucomisd(xmm2, Operand(rsp, 1 * kDoubleSize));
|
|
|
|
__ j(not_equal, exit);
|
|
|
|
|
|
|
|
__ addq(rsp, Immediate(kSimd128Size));
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(SIMDMacros) {
|
|
|
|
Isolate* isolate = CcTest::i_isolate();
|
|
|
|
HandleScope handles(isolate);
|
2019-01-17 10:23:16 +00:00
|
|
|
auto buffer = AllocateAssemblerBuffer();
|
|
|
|
MacroAssembler assembler(isolate, v8::internal::CodeObjectRequired::kYes,
|
|
|
|
buffer->CreateView());
|
2016-07-21 11:01:44 +00:00
|
|
|
|
|
|
|
MacroAssembler* masm = &assembler;
|
|
|
|
EntryCode(masm);
|
|
|
|
Label exit;
|
|
|
|
|
|
|
|
__ xorq(rax, rax);
|
|
|
|
TestFloat32x4Abs(masm, &exit, 1.5, -1.5, 0.5, -0.5);
|
|
|
|
TestFloat32x4Neg(masm, &exit, 1.5, -1.5, 0.5, -0.5);
|
|
|
|
TestFloat64x2Abs(masm, &exit, 1.75, -1.75);
|
|
|
|
TestFloat64x2Neg(masm, &exit, 1.75, -1.75);
|
|
|
|
|
|
|
|
__ xorq(rax, rax); // Success.
|
|
|
|
__ bind(&exit);
|
|
|
|
ExitCode(masm);
|
|
|
|
__ ret(0);
|
|
|
|
|
|
|
|
CodeDesc desc;
|
2017-05-31 14:00:11 +00:00
|
|
|
masm->GetCode(isolate, &desc);
|
2019-01-17 10:23:16 +00:00
|
|
|
buffer->MakeExecutable();
|
2016-07-21 11:01:44 +00:00
|
|
|
// Call the function from C++.
|
2019-01-17 10:23:16 +00:00
|
|
|
auto f = GeneratedCode<F0>::FromBuffer(CcTest::i_isolate(), buffer->start());
|
2018-04-07 01:32:39 +00:00
|
|
|
int result = f.Call();
|
2016-07-21 11:01:44 +00:00
|
|
|
CHECK_EQ(0, result);
|
|
|
|
}
|
2010-05-26 10:02:07 +00:00
|
|
|
|
2018-12-07 16:23:20 +00:00
|
|
|
TEST(AreAliased) {
|
|
|
|
DCHECK(!AreAliased(rax));
|
|
|
|
DCHECK(!AreAliased(rax, no_reg));
|
|
|
|
DCHECK(!AreAliased(no_reg, rax, no_reg));
|
|
|
|
|
|
|
|
DCHECK(AreAliased(rax, rax));
|
|
|
|
DCHECK(!AreAliased(no_reg, no_reg));
|
|
|
|
|
|
|
|
DCHECK(!AreAliased(rax, rbx, rcx, rdx, no_reg));
|
|
|
|
DCHECK(AreAliased(rax, rbx, rcx, rdx, rax, no_reg));
|
|
|
|
|
|
|
|
// no_regs are allowed in
|
|
|
|
DCHECK(!AreAliased(rax, no_reg, rbx, no_reg, rcx, no_reg, rdx, no_reg));
|
|
|
|
DCHECK(AreAliased(rax, no_reg, rbx, no_reg, rcx, no_reg, rdx, rax, no_reg));
|
|
|
|
}
|
|
|
|
|
2009-10-08 12:36:12 +00:00
|
|
|
#undef __
|
2017-09-21 03:29:52 +00:00
|
|
|
|
|
|
|
} // namespace test_macro_assembler_x64
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|