[asm] Remove Assembler(isolate...) constructor
This completes the transition to Assembler::Options, which reduces the assemblers's dependency on isolates, and there is now only one way to create an Assembler, which is to use the options. Note that some operations on assemblers still need an isolate, such as GetCode(), and in these cases, the isolate is an additional argument to the method. R=jgruber@chromium.org CC=mstarzinger@chromium.org Change-Id: I413209d816c63a7c3640f1c226764693dcad1e7f Reviewed-on: https://chromium-review.googlesource.com/1106169 Commit-Queue: Ben Titzer <titzer@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#53925}
This commit is contained in:
parent
f39959d2f7
commit
ea2f33c6c3
@ -628,8 +628,6 @@ class Assembler : public AssemblerBase {
|
||||
// buffer for code generation and assumes its size to be buffer_size. If the
|
||||
// buffer is too small, a fatal error occurs. No deallocation of the buffer is
|
||||
// done upon destruction of the assembler.
|
||||
Assembler(Isolate* isolate, void* buffer, int buffer_size)
|
||||
: Assembler(DefaultOptions(isolate), buffer, buffer_size) {}
|
||||
Assembler(const Options& options, void* buffer, int buffer_size);
|
||||
virtual ~Assembler();
|
||||
|
||||
|
@ -898,8 +898,6 @@ class Assembler : public AssemblerBase {
|
||||
// buffer for code generation and assumes its size to be buffer_size. If the
|
||||
// buffer is too small, a fatal error occurs. No deallocation of the buffer is
|
||||
// done upon destruction of the assembler.
|
||||
Assembler(Isolate* isolate, void* buffer, int buffer_size)
|
||||
: Assembler(DefaultOptions(isolate), buffer, buffer_size) {}
|
||||
Assembler(const Options& options, void* buffer, int buffer_size);
|
||||
|
||||
virtual ~Assembler();
|
||||
|
@ -500,8 +500,6 @@ class Assembler : public AssemblerBase {
|
||||
// buffer for code generation and assumes its size to be buffer_size. If the
|
||||
// buffer is too small, a fatal error occurs. No deallocation of the buffer is
|
||||
// done upon destruction of the assembler.
|
||||
Assembler(Isolate* isolate, void* buffer, int buffer_size)
|
||||
: Assembler(DefaultOptions(isolate), buffer, buffer_size) {}
|
||||
Assembler(const Options& options, void* buffer, int buffer_size);
|
||||
virtual ~Assembler() {}
|
||||
|
||||
|
@ -491,8 +491,6 @@ class Assembler : public AssemblerBase {
|
||||
// buffer for code generation and assumes its size to be buffer_size. If the
|
||||
// buffer is too small, a fatal error occurs. No deallocation of the buffer is
|
||||
// done upon destruction of the assembler.
|
||||
Assembler(Isolate* isolate, void* buffer, int buffer_size)
|
||||
: Assembler(DefaultOptions(isolate), buffer, buffer_size) {}
|
||||
Assembler(const Options& options, void* buffer, int buffer_size);
|
||||
virtual ~Assembler() { }
|
||||
|
||||
|
@ -498,8 +498,6 @@ class Assembler : public AssemblerBase {
|
||||
// buffer for code generation and assumes its size to be buffer_size. If the
|
||||
// buffer is too small, a fatal error occurs. No deallocation of the buffer is
|
||||
// done upon destruction of the assembler.
|
||||
Assembler(Isolate* isolate, void* buffer, int buffer_size)
|
||||
: Assembler(DefaultOptions(isolate), buffer, buffer_size) {}
|
||||
Assembler(const Options& options, void* buffer, int buffer_size);
|
||||
virtual ~Assembler() { }
|
||||
|
||||
|
@ -504,8 +504,6 @@ class Assembler : public AssemblerBase {
|
||||
// buffer for code generation and assumes its size to be buffer_size. If the
|
||||
// buffer is too small, a fatal error occurs. No deallocation of the buffer is
|
||||
// done upon destruction of the assembler.
|
||||
Assembler(Isolate* isolate, void* buffer, int buffer_size)
|
||||
: Assembler(DefaultOptions(isolate), buffer, buffer_size) {}
|
||||
Assembler(const Options& options, void* buffer, int buffer_size);
|
||||
virtual ~Assembler() {}
|
||||
|
||||
|
@ -488,8 +488,6 @@ class Assembler : public AssemblerBase {
|
||||
// buffer for code generation and assumes its size to be buffer_size. If the
|
||||
// buffer is too small, a fatal error occurs. No deallocation of the buffer is
|
||||
// done upon destruction of the assembler.
|
||||
Assembler(Isolate* isolate, void* buffer, int buffer_size)
|
||||
: Assembler(DefaultOptions(isolate), buffer, buffer_size) {}
|
||||
Assembler(const Options& options, void* buffer, int buffer_size);
|
||||
virtual ~Assembler() {}
|
||||
|
||||
|
@ -138,7 +138,8 @@ void LiftoffAssembler::PatchPrepareStackFrame(uint32_t offset,
|
||||
// We can't run out of space, just pass anything big enough to not cause the
|
||||
// assembler to try to grow the buffer.
|
||||
constexpr int kAvailableSpace = 64;
|
||||
Assembler patching_assembler(isolate(), buffer_ + offset, kAvailableSpace);
|
||||
Assembler patching_assembler(Assembler::Options{}, buffer_ + offset,
|
||||
kAvailableSpace);
|
||||
patching_assembler.sub_sp_32(bytes);
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,8 @@ void LiftoffAssembler::PatchPrepareStackFrame(uint32_t offset,
|
||||
// We can't run out of space, just pass anything big enough to not cause the
|
||||
// assembler to try to grow the buffer.
|
||||
constexpr int kAvailableSpace = 64;
|
||||
Assembler patching_assembler(isolate(), buffer_ + offset, kAvailableSpace);
|
||||
Assembler patching_assembler(Assembler::Options{}, buffer_ + offset,
|
||||
kAvailableSpace);
|
||||
patching_assembler.sub_sp_32(bytes);
|
||||
}
|
||||
|
||||
|
@ -449,8 +449,6 @@ class Assembler : public AssemblerBase {
|
||||
// buffer for code generation and assumes its size to be buffer_size. If the
|
||||
// buffer is too small, a fatal error occurs. No deallocation of the buffer is
|
||||
// done upon destruction of the assembler.
|
||||
Assembler(Isolate* isolate, void* buffer, int buffer_size)
|
||||
: Assembler(DefaultOptions(isolate), buffer, buffer_size) {}
|
||||
Assembler(const Options& options, void* buffer, int buffer_size);
|
||||
virtual ~Assembler() {}
|
||||
|
||||
|
@ -14,7 +14,7 @@ namespace internal {
|
||||
|
||||
Handle<Code> AssembleCodeImpl(std::function<void(Assembler&)> assemble) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
assemble(assm);
|
||||
assm.bx(lr);
|
||||
|
@ -211,7 +211,7 @@ static void CheckFindCodeObject(Isolate* isolate) {
|
||||
// Test FindCodeObject
|
||||
#define __ assm.
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
__ nop(); // supported on all architectures
|
||||
|
||||
@ -5779,7 +5779,7 @@ HEAP_TEST(Regress670675) {
|
||||
|
||||
namespace {
|
||||
Handle<Code> GenerateDummyImmovableCode(Isolate* isolate) {
|
||||
Assembler assm(isolate, nullptr, 256);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
const int kNumberOfNops = 1 << 10;
|
||||
for (int i = 0; i < kNumberOfNops; i++) {
|
||||
|
@ -52,7 +52,7 @@ TEST(WeakReferencesBasic) {
|
||||
HandleScope inner_scope(isolate);
|
||||
|
||||
// Create a new Code.
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
assm.nop(); // supported on all architectures
|
||||
CodeDesc desc;
|
||||
assm.GetCode(isolate, &desc);
|
||||
|
@ -53,7 +53,7 @@ TEST(0) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
__ add(r0, r0, Operand(r1));
|
||||
__ mov(pc, Operand(lr));
|
||||
@ -78,7 +78,7 @@ TEST(1) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label L, C;
|
||||
|
||||
__ mov(r1, Operand(r0));
|
||||
@ -114,7 +114,7 @@ TEST(2) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label L, C;
|
||||
|
||||
__ mov(r1, Operand(r0));
|
||||
@ -166,7 +166,7 @@ TEST(3) {
|
||||
} T;
|
||||
T t;
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label L, C;
|
||||
|
||||
__ mov(ip, Operand(sp));
|
||||
@ -235,7 +235,7 @@ TEST(4) {
|
||||
|
||||
// Create a function that accepts &t, and loads, manipulates, and stores
|
||||
// the doubles and floats.
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label L, C;
|
||||
|
||||
if (CpuFeatures::IsSupported(VFPv3)) {
|
||||
@ -367,7 +367,7 @@ TEST(5) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
if (CpuFeatures::IsSupported(ARMv7)) {
|
||||
CpuFeatureScope scope(&assm, ARMv7);
|
||||
@ -401,7 +401,7 @@ TEST(6) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
__ usat(r1, 8, Operand(r0)); // Sat 0xFFFF to 0-255 = 0xFF.
|
||||
__ usat(r2, 12, Operand(r0, ASR, 9)); // Sat (0xFFFF>>9) to 0-4095 = 0x7F.
|
||||
@ -438,7 +438,7 @@ static void TestRoundingMode(VCVTTypes types,
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
Label wrong_exception;
|
||||
|
||||
@ -636,7 +636,7 @@ TEST(8) {
|
||||
|
||||
// Create a function that uses vldm/vstm to move some double and
|
||||
// single precision values around in memory.
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
__ mov(ip, Operand(sp));
|
||||
__ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit());
|
||||
@ -741,7 +741,7 @@ TEST(9) {
|
||||
|
||||
// Create a function that uses vldm/vstm to move some double and
|
||||
// single precision values around in memory.
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
__ mov(ip, Operand(sp));
|
||||
__ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit());
|
||||
@ -850,7 +850,7 @@ TEST(10) {
|
||||
|
||||
// Create a function that uses vldm/vstm to move some double and
|
||||
// single precision values around in memory.
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
__ mov(ip, Operand(sp));
|
||||
__ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit());
|
||||
@ -940,7 +940,7 @@ TEST(11) {
|
||||
i.a = 0xABCD0001;
|
||||
i.b = 0xABCD0000;
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
// Test HeapObject untagging.
|
||||
__ ldr(r1, MemOperand(r0, offsetof(I, a)));
|
||||
@ -992,7 +992,7 @@ TEST(12) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label target;
|
||||
__ b(eq, &target);
|
||||
__ b(ne, &target);
|
||||
@ -1028,7 +1028,7 @@ TEST(13) {
|
||||
|
||||
// Create a function that accepts &t, and loads, manipulates, and stores
|
||||
// the doubles and floats.
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label L, C;
|
||||
|
||||
if (CpuFeatures::IsSupported(VFPv3)) {
|
||||
@ -1142,7 +1142,7 @@ TEST(14) {
|
||||
T t;
|
||||
|
||||
// Create a function that makes the four basic operations.
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
// Ensure FPSCR state (as JSEntryStub does).
|
||||
Label fpscr_done;
|
||||
@ -1321,7 +1321,7 @@ TEST(15) {
|
||||
|
||||
// Create a function that accepts &t, and loads, manipulates, and stores
|
||||
// the doubles, floats, and SIMD values.
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
if (CpuFeatures::IsSupported(NEON)) {
|
||||
CpuFeatureScope scope(&assm, NEON);
|
||||
@ -2296,7 +2296,7 @@ TEST(16) {
|
||||
|
||||
// Create a function that accepts &t, and loads, manipulates, and stores
|
||||
// the doubles and floats.
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
__ stm(db_w, sp, r4.bit() | lr.bit());
|
||||
|
||||
@ -2356,7 +2356,7 @@ TEST(17) {
|
||||
HandleScope scope(isolate);
|
||||
|
||||
// Generate a code segment that will be longer than 2^24 bytes.
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
for (size_t i = 0; i < 1 << 23 ; ++i) { // 2^23
|
||||
__ nop();
|
||||
}
|
||||
@ -2379,7 +2379,7 @@ TEST(sdiv) {
|
||||
CcTest::InitializeVM();
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
struct T {
|
||||
int32_t dividend;
|
||||
@ -2439,7 +2439,7 @@ TEST(udiv) {
|
||||
CcTest::InitializeVM();
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
struct T {
|
||||
uint32_t dividend;
|
||||
@ -2485,7 +2485,7 @@ TEST(smmla) {
|
||||
Isolate* const isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
RandomNumberGenerator* const rng = isolate->random_number_generator();
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
__ smmla(r1, r1, r2, r3);
|
||||
__ str(r1, MemOperand(r0));
|
||||
__ bx(lr);
|
||||
@ -2510,7 +2510,7 @@ TEST(smmul) {
|
||||
Isolate* const isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
RandomNumberGenerator* const rng = isolate->random_number_generator();
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
__ smmul(r1, r1, r2);
|
||||
__ str(r1, MemOperand(r0));
|
||||
__ bx(lr);
|
||||
@ -2535,7 +2535,7 @@ TEST(sxtb) {
|
||||
Isolate* const isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
RandomNumberGenerator* const rng = isolate->random_number_generator();
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
__ sxtb(r1, r1);
|
||||
__ str(r1, MemOperand(r0));
|
||||
__ bx(lr);
|
||||
@ -2560,7 +2560,7 @@ TEST(sxtab) {
|
||||
Isolate* const isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
RandomNumberGenerator* const rng = isolate->random_number_generator();
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
__ sxtab(r1, r2, r1);
|
||||
__ str(r1, MemOperand(r0));
|
||||
__ bx(lr);
|
||||
@ -2585,7 +2585,7 @@ TEST(sxth) {
|
||||
Isolate* const isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
RandomNumberGenerator* const rng = isolate->random_number_generator();
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
__ sxth(r1, r1);
|
||||
__ str(r1, MemOperand(r0));
|
||||
__ bx(lr);
|
||||
@ -2610,7 +2610,7 @@ TEST(sxtah) {
|
||||
Isolate* const isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
RandomNumberGenerator* const rng = isolate->random_number_generator();
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
__ sxtah(r1, r2, r1);
|
||||
__ str(r1, MemOperand(r0));
|
||||
__ bx(lr);
|
||||
@ -2635,7 +2635,7 @@ TEST(uxtb) {
|
||||
Isolate* const isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
RandomNumberGenerator* const rng = isolate->random_number_generator();
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
__ uxtb(r1, r1);
|
||||
__ str(r1, MemOperand(r0));
|
||||
__ bx(lr);
|
||||
@ -2660,7 +2660,7 @@ TEST(uxtab) {
|
||||
Isolate* const isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
RandomNumberGenerator* const rng = isolate->random_number_generator();
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
__ uxtab(r1, r2, r1);
|
||||
__ str(r1, MemOperand(r0));
|
||||
__ bx(lr);
|
||||
@ -2685,7 +2685,7 @@ TEST(uxth) {
|
||||
Isolate* const isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
RandomNumberGenerator* const rng = isolate->random_number_generator();
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
__ uxth(r1, r1);
|
||||
__ str(r1, MemOperand(r0));
|
||||
__ bx(lr);
|
||||
@ -2710,7 +2710,7 @@ TEST(uxtah) {
|
||||
Isolate* const isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
RandomNumberGenerator* const rng = isolate->random_number_generator();
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
__ uxtah(r1, r2, r1);
|
||||
__ str(r1, MemOperand(r0));
|
||||
__ bx(lr);
|
||||
@ -2739,7 +2739,7 @@ TEST(rbit) {
|
||||
CcTest::InitializeVM();
|
||||
Isolate* const isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
if (CpuFeatures::IsSupported(ARMv7)) {
|
||||
CpuFeatureScope scope(&assm, ARMv7);
|
||||
@ -2785,7 +2785,7 @@ TEST(code_relative_offset) {
|
||||
Handle<HeapObject> code_object(isolate->heap()->self_reference_marker(),
|
||||
isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
Label start, target_away, target_faraway;
|
||||
|
||||
@ -2852,7 +2852,7 @@ TEST(msr_mrs) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
// Create a helper function:
|
||||
// void TestMsrMrs(uint32_t nzcv,
|
||||
@ -2934,7 +2934,7 @@ TEST(ARMv8_float32_vrintX) {
|
||||
|
||||
// Create a function that accepts &t, and loads, manipulates, and stores
|
||||
// the floats.
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label L, C;
|
||||
|
||||
|
||||
@ -3036,7 +3036,7 @@ TEST(ARMv8_vrintX) {
|
||||
|
||||
// Create a function that accepts &t, and loads, manipulates, and stores
|
||||
// the doubles and floats.
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label L, C;
|
||||
|
||||
|
||||
@ -3125,7 +3125,7 @@ TEST(ARMv8_vsel) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
// Used to indicate whether a condition passed or failed.
|
||||
static constexpr float kResultPass = 1.0f;
|
||||
@ -3275,7 +3275,7 @@ TEST(ARMv8_vminmax_f64) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
struct Inputs {
|
||||
double left_;
|
||||
@ -3355,7 +3355,7 @@ TEST(ARMv8_vminmax_f32) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
struct Inputs {
|
||||
float left_;
|
||||
@ -3667,7 +3667,7 @@ TEST(unaligned_loads) {
|
||||
} T;
|
||||
T t;
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
__ ldrh(ip, MemOperand(r1, r2));
|
||||
__ str(ip, MemOperand(r0, offsetof(T, ldrh)));
|
||||
__ ldrsh(ip, MemOperand(r1, r2));
|
||||
@ -3714,7 +3714,7 @@ TEST(unaligned_stores) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
__ strh(r3, MemOperand(r0, r2));
|
||||
__ str(r3, MemOperand(r1, r2));
|
||||
__ bx(lr);
|
||||
@ -3768,7 +3768,7 @@ TEST(vswp) {
|
||||
CcTest::InitializeVM();
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
typedef struct {
|
||||
uint64_t vswp_d0;
|
||||
@ -3850,7 +3850,7 @@ TEST(regress4292_b) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label end;
|
||||
__ mov(r0, Operand(isolate->factory()->infinity_value()));
|
||||
for (int i = 0; i < 1020; ++i) {
|
||||
@ -3865,7 +3865,7 @@ TEST(regress4292_bl) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label end;
|
||||
__ mov(r0, Operand(isolate->factory()->infinity_value()));
|
||||
for (int i = 0; i < 1020; ++i) {
|
||||
@ -3880,7 +3880,7 @@ TEST(regress4292_blx) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label end;
|
||||
__ mov(r0, Operand(isolate->factory()->infinity_value()));
|
||||
for (int i = 0; i < 1020; ++i) {
|
||||
@ -3895,7 +3895,7 @@ TEST(regress4292_CheckConstPool) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
__ mov(r0, Operand(isolate->factory()->infinity_value()));
|
||||
__ BlockConstPoolFor(1019);
|
||||
for (int i = 0; i < 1019; ++i) __ nop();
|
||||
@ -3907,7 +3907,7 @@ TEST(use_scratch_register_scope) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
// The assembler should have ip as a scratch by default.
|
||||
CHECK_EQ(*assm.GetScratchRegisterList(), ip.bit());
|
||||
@ -3929,7 +3929,7 @@ TEST(use_scratch_vfp_register_scope) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
VfpRegList orig_scratches = *assm.GetScratchVfpRegisterList();
|
||||
|
||||
@ -4025,7 +4025,7 @@ TEST(split_add_immediate) {
|
||||
HandleScope scope(isolate);
|
||||
|
||||
{
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
__ mov(r1, r0);
|
||||
// Re-use the destination as a scratch.
|
||||
__ add(r0, r1, Operand(0x12345678));
|
||||
@ -4046,7 +4046,7 @@ TEST(split_add_immediate) {
|
||||
}
|
||||
|
||||
{
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
// Use ip as a scratch.
|
||||
__ add(r0, r0, Operand(0x12345678));
|
||||
__ blx(lr);
|
||||
@ -4066,7 +4066,7 @@ TEST(split_add_immediate) {
|
||||
}
|
||||
|
||||
{
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
UseScratchRegisterScope temps(&assm);
|
||||
Register reserved = temps.Acquire();
|
||||
USE(reserved);
|
||||
|
@ -54,7 +54,7 @@ TEST(AssemblerIa320) {
|
||||
HandleScope scope(isolate);
|
||||
|
||||
v8::internal::byte buffer[256];
|
||||
Assembler assm(isolate, buffer, sizeof buffer);
|
||||
Assembler assm(Assembler::Options{}, buffer, sizeof buffer);
|
||||
|
||||
__ mov(eax, Operand(esp, 4));
|
||||
__ add(eax, Operand(esp, 8));
|
||||
@ -81,7 +81,7 @@ TEST(AssemblerIa321) {
|
||||
HandleScope scope(isolate);
|
||||
|
||||
v8::internal::byte buffer[256];
|
||||
Assembler assm(isolate, buffer, sizeof buffer);
|
||||
Assembler assm(Assembler::Options{}, buffer, sizeof buffer);
|
||||
Label L, C;
|
||||
|
||||
__ mov(edx, Operand(esp, 4));
|
||||
@ -118,7 +118,7 @@ TEST(AssemblerIa322) {
|
||||
HandleScope scope(isolate);
|
||||
|
||||
v8::internal::byte buffer[256];
|
||||
Assembler assm(isolate, buffer, sizeof buffer);
|
||||
Assembler assm(Assembler::Options{}, buffer, sizeof buffer);
|
||||
Label L, C;
|
||||
|
||||
__ mov(edx, Operand(esp, 4));
|
||||
@ -162,7 +162,7 @@ TEST(AssemblerIa323) {
|
||||
HandleScope scope(isolate);
|
||||
|
||||
v8::internal::byte buffer[256];
|
||||
Assembler assm(isolate, buffer, sizeof buffer);
|
||||
Assembler assm(Assembler::Options{}, buffer, sizeof buffer);
|
||||
|
||||
__ cvttss2si(eax, Operand(esp, 4));
|
||||
__ ret(0);
|
||||
@ -191,7 +191,7 @@ TEST(AssemblerIa324) {
|
||||
HandleScope scope(isolate);
|
||||
|
||||
v8::internal::byte buffer[256];
|
||||
Assembler assm(isolate, buffer, sizeof buffer);
|
||||
Assembler assm(Assembler::Options{}, buffer, sizeof buffer);
|
||||
|
||||
__ cvttsd2si(eax, Operand(esp, 4));
|
||||
__ ret(0);
|
||||
@ -218,7 +218,7 @@ TEST(AssemblerIa325) {
|
||||
HandleScope scope(isolate);
|
||||
|
||||
v8::internal::byte buffer[256];
|
||||
Assembler assm(isolate, buffer, sizeof buffer);
|
||||
Assembler assm(Assembler::Options{}, buffer, sizeof buffer);
|
||||
|
||||
__ mov(eax, Operand(reinterpret_cast<intptr_t>(&baz), RelocInfo::NONE));
|
||||
__ ret(0);
|
||||
@ -241,7 +241,7 @@ TEST(AssemblerIa326) {
|
||||
Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
|
||||
HandleScope scope(isolate);
|
||||
v8::internal::byte buffer[256];
|
||||
Assembler assm(isolate, buffer, sizeof buffer);
|
||||
Assembler assm(Assembler::Options{}, buffer, sizeof buffer);
|
||||
|
||||
__ movsd(xmm0, Operand(esp, 1 * kPointerSize));
|
||||
__ movsd(xmm1, Operand(esp, 3 * kPointerSize));
|
||||
@ -279,7 +279,7 @@ TEST(AssemblerIa328) {
|
||||
Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
|
||||
HandleScope scope(isolate);
|
||||
v8::internal::byte buffer[256];
|
||||
Assembler assm(isolate, buffer, sizeof buffer);
|
||||
Assembler assm(Assembler::Options{}, buffer, sizeof buffer);
|
||||
__ mov(eax, Operand(esp, 4));
|
||||
__ cvtsi2sd(xmm0, eax);
|
||||
// Copy xmm0 to st(0) using eight bytes of stack.
|
||||
@ -308,7 +308,7 @@ TEST(AssemblerIa3210) {
|
||||
CcTest::InitializeVM();
|
||||
Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
|
||||
HandleScope scope(isolate);
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
Label target;
|
||||
__ j(equal, &target);
|
||||
@ -323,7 +323,7 @@ TEST(AssemblerMultiByteNop) {
|
||||
Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
|
||||
HandleScope scope(isolate);
|
||||
v8::internal::byte buffer[1024];
|
||||
Assembler assm(isolate, buffer, sizeof(buffer));
|
||||
Assembler assm(Assembler::Options{}, buffer, sizeof(buffer));
|
||||
__ push(ebx);
|
||||
__ push(ecx);
|
||||
__ push(edx);
|
||||
@ -395,7 +395,7 @@ void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
CHECK_EQ(ELEMENT_COUNT, vec->Length());
|
||||
|
||||
v8::internal::byte buffer[256];
|
||||
Assembler assm(isolate, buffer, sizeof buffer);
|
||||
Assembler assm(Assembler::Options{}, buffer, sizeof buffer);
|
||||
|
||||
// Remove return address from the stack for fix stack frame alignment.
|
||||
__ pop(ecx);
|
||||
@ -1384,7 +1384,7 @@ TEST(AssemblerIa32JumpTables1) {
|
||||
CcTest::InitializeVM();
|
||||
Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
|
||||
HandleScope scope(isolate);
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
const int kNumCases = 512;
|
||||
int values[kNumCases];
|
||||
@ -1431,7 +1431,7 @@ TEST(AssemblerIa32JumpTables2) {
|
||||
CcTest::InitializeVM();
|
||||
Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
|
||||
HandleScope scope(isolate);
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
const int kNumCases = 512;
|
||||
int values[kNumCases];
|
||||
@ -1480,7 +1480,7 @@ TEST(Regress621926) {
|
||||
CcTest::InitializeVM();
|
||||
Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
|
||||
HandleScope scope(isolate);
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
uint16_t a = 42;
|
||||
|
||||
|
@ -543,7 +543,7 @@ TEST(MIPS6) {
|
||||
} T;
|
||||
T t;
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label L, C;
|
||||
|
||||
// Basic word load/store.
|
||||
@ -909,7 +909,7 @@ TEST(MIPS11) {
|
||||
} T;
|
||||
T t;
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
// Test all combinations of LWL and vAddr.
|
||||
__ lw(t0, MemOperand(a0, offsetof(T, reg_init)) );
|
||||
@ -1334,7 +1334,7 @@ TEST(MIPS15) {
|
||||
CcTest::InitializeVM();
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
Label target;
|
||||
__ beq(v0, v1, &target);
|
||||
@ -3151,7 +3151,7 @@ TEST(jump_tables1) {
|
||||
CcTest::InitializeVM();
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
const int kNumCases = 512;
|
||||
int values[kNumCases];
|
||||
@ -3218,7 +3218,7 @@ TEST(jump_tables2) {
|
||||
CcTest::InitializeVM();
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
const int kNumCases = 512;
|
||||
int values[kNumCases];
|
||||
@ -3287,7 +3287,7 @@ TEST(jump_tables3) {
|
||||
CcTest::InitializeVM();
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
const int kNumCases = 256;
|
||||
Handle<Object> values[kNumCases];
|
||||
@ -3377,7 +3377,7 @@ TEST(BITSWAP) {
|
||||
} T;
|
||||
T t;
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
__ lw(a2, MemOperand(a0, offsetof(T, r1)));
|
||||
__ nop();
|
||||
|
@ -1363,7 +1363,7 @@ TEST(MIPS15) {
|
||||
CcTest::InitializeVM();
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
Label target;
|
||||
__ beq(v0, v1, &target);
|
||||
|
@ -52,7 +52,7 @@ TEST(0) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
__ function_descriptor();
|
||||
|
||||
@ -79,7 +79,7 @@ TEST(1) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label L, C;
|
||||
|
||||
__ function_descriptor();
|
||||
@ -116,7 +116,7 @@ TEST(2) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label L, C;
|
||||
|
||||
__ function_descriptor();
|
||||
@ -173,7 +173,7 @@ TEST(3) {
|
||||
} T;
|
||||
T t;
|
||||
|
||||
Assembler assm(CcTest::i_isolate(), nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label L, C;
|
||||
|
||||
__ function_descriptor();
|
||||
@ -264,7 +264,7 @@ TEST(4) {
|
||||
|
||||
// Create a function that accepts &t, and loads, manipulates, and stores
|
||||
// the doubles and floats.
|
||||
Assembler assm(CcTest::i_isolate(), nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label L, C;
|
||||
|
||||
if (CpuFeatures::IsSupported(VFP3)) {
|
||||
@ -379,7 +379,7 @@ TEST(5) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
if (CpuFeatures::IsSupported(ARMv7)) {
|
||||
CpuFeatures::Scope scope(ARMv7);
|
||||
@ -415,7 +415,7 @@ TEST(6) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
if (CpuFeatures::IsSupported(ARMv7)) {
|
||||
CpuFeatures::Scope scope(ARMv7);
|
||||
@ -457,7 +457,7 @@ static void TestRoundingMode(VCVTTypes types,
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
if (CpuFeatures::IsSupported(VFP3)) {
|
||||
CpuFeatures::Scope scope(VFP3);
|
||||
@ -661,7 +661,7 @@ TEST(8) {
|
||||
|
||||
// Create a function that uses vldm/vstm to move some double and
|
||||
// single precision values around in memory.
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
if (CpuFeatures::IsSupported(VFP2)) {
|
||||
CpuFeatures::Scope scope(VFP2);
|
||||
@ -772,7 +772,7 @@ TEST(9) {
|
||||
|
||||
// Create a function that uses vldm/vstm to move some double and
|
||||
// single precision values around in memory.
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
if (CpuFeatures::IsSupported(VFP2)) {
|
||||
CpuFeatures::Scope scope(VFP2);
|
||||
@ -887,7 +887,7 @@ TEST(10) {
|
||||
|
||||
// Create a function that uses vldm/vstm to move some double and
|
||||
// single precision values around in memory.
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
if (CpuFeatures::IsSupported(VFP2)) {
|
||||
CpuFeatures::Scope scope(VFP2);
|
||||
@ -983,7 +983,7 @@ TEST(11) {
|
||||
i.a = 0xABCD0001;
|
||||
i.b = 0xABCD0000;
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
// Test HeapObject untagging.
|
||||
__ ldr(r1, MemOperand(r0, offsetof(I, a)));
|
||||
@ -1037,7 +1037,7 @@ TEST(12) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label target;
|
||||
__ b(eq, &target);
|
||||
__ b(ne, &target);
|
||||
|
@ -52,7 +52,7 @@ TEST(0) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
__ lhi(r1, Operand(3)); // test 4-byte instr
|
||||
__ llilf(r2, Operand(4)); // test 6-byte instr
|
||||
@ -79,7 +79,7 @@ TEST(1) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label L, C;
|
||||
|
||||
#if defined(_AIX)
|
||||
@ -119,7 +119,7 @@ TEST(2) {
|
||||
|
||||
// Create a function that accepts &t, and loads, manipulates, and stores
|
||||
// the doubles and floats.
|
||||
Assembler assm(CcTest::i_isolate(), nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label L, C;
|
||||
|
||||
#if defined(_AIX)
|
||||
@ -168,7 +168,7 @@ TEST(3) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
__ ar(r14, r13);
|
||||
__ sr(r14, r13);
|
||||
@ -222,7 +222,7 @@ TEST(4) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
Label L2, L3, L4;
|
||||
|
||||
__ chi(r2, Operand(10));
|
||||
@ -424,7 +424,7 @@ TEST(10) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
Label ok, failed;
|
||||
|
||||
@ -502,7 +502,7 @@ TEST(11) {
|
||||
CcTest::InitializeVM();
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
Label ok, failed, continue1, continue2;
|
||||
// r1 - operand; r3 - inc / test val
|
||||
@ -556,7 +556,7 @@ TEST(12) {
|
||||
CcTest::InitializeVM();
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
Assembler assm(isolate, nullptr, 0);
|
||||
Assembler assm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
Label ok, failed, continue1, continue2;
|
||||
// r1 - operand; r3 - inc / test val
|
||||
|
@ -74,7 +74,7 @@ TEST(AssemblerX64ReturnOperation) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
// Assemble a simple function that copies argument 2 and returns it.
|
||||
__ movq(rax, arg2);
|
||||
@ -95,7 +95,7 @@ TEST(AssemblerX64StackOperations) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
// Assemble a simple function that copies argument 2 and returns it.
|
||||
// We compile without stack frame pointers, so the gdb debugger shows
|
||||
@ -126,7 +126,7 @@ TEST(AssemblerX64ArithmeticOperations) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
// Assemble a simple function that adds arguments returning the sum.
|
||||
__ movq(rax, arg2);
|
||||
@ -147,7 +147,7 @@ TEST(AssemblerX64CmpbOperation) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
// Assemble a function that compare argument byte returing 1 if equal else 0.
|
||||
// On Windows, it compares rcx with rdx which does not require REX prefix;
|
||||
@ -176,7 +176,7 @@ TEST(AssemblerX64ImulOperation) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
// Assemble a simple function that multiplies arguments returning the high
|
||||
// word.
|
||||
@ -203,7 +203,7 @@ TEST(AssemblerX64testbwqOperation) {
|
||||
v8::HandleScope scope(CcTest::isolate());
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
__ pushq(rbx);
|
||||
__ pushq(rdi);
|
||||
@ -369,7 +369,7 @@ TEST(AssemblerX64XchglOperations) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
__ movq(rax, Operand(arg1, 0));
|
||||
__ movq(r11, Operand(arg2, 0));
|
||||
@ -396,7 +396,7 @@ TEST(AssemblerX64OrlOperations) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
__ movq(rax, Operand(arg2, 0));
|
||||
__ orl(Operand(arg1, 0), rax);
|
||||
@ -419,7 +419,7 @@ TEST(AssemblerX64RollOperations) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
__ movq(rax, arg1);
|
||||
__ roll(rax, Immediate(1));
|
||||
@ -440,7 +440,7 @@ TEST(AssemblerX64SublOperations) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
__ movq(rax, Operand(arg2, 0));
|
||||
__ subl(Operand(arg1, 0), rax);
|
||||
@ -463,7 +463,7 @@ TEST(AssemblerX64TestlOperations) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
// Set rax with the ZF flag of the testl instruction.
|
||||
Label done;
|
||||
@ -491,7 +491,7 @@ TEST(AssemblerX64TestwOperations) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
// Set rax with the ZF flag of the testl instruction.
|
||||
Label done;
|
||||
@ -516,7 +516,7 @@ TEST(AssemblerX64XorlOperations) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
__ movq(rax, Operand(arg2, 0));
|
||||
__ xorl(Operand(arg1, 0), rax);
|
||||
@ -539,7 +539,7 @@ TEST(AssemblerX64MemoryOperands) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
// Assemble a simple function that copies argument 2 and returns it.
|
||||
__ pushq(rbp);
|
||||
@ -572,7 +572,7 @@ TEST(AssemblerX64ControlFlow) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
// Assemble a simple function that copies argument 1 and returns it.
|
||||
__ pushq(rbp);
|
||||
@ -600,7 +600,7 @@ TEST(AssemblerX64LoopImmediates) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
// Assemble two loops using rax as counter, and verify the ending counts.
|
||||
Label Fail;
|
||||
@ -693,7 +693,7 @@ TEST(AssemblerX64LabelChaining) {
|
||||
// Test chaining of label usages within instructions (issue 1644).
|
||||
CcTest::InitializeVM();
|
||||
v8::HandleScope scope(CcTest::isolate());
|
||||
Assembler masm(CcTest::i_isolate(), nullptr, 0);
|
||||
Assembler masm(Assembler::Options{}, nullptr, 0);
|
||||
|
||||
Label target;
|
||||
__ j(equal, &target);
|
||||
@ -708,7 +708,7 @@ TEST(AssemblerMultiByteNop) {
|
||||
v8::HandleScope scope(CcTest::isolate());
|
||||
byte buffer[1024];
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Assembler masm(isolate, buffer, sizeof(buffer));
|
||||
Assembler masm(Assembler::Options{}, buffer, sizeof(buffer));
|
||||
__ pushq(rbx);
|
||||
__ pushq(rcx);
|
||||
__ pushq(rdx);
|
||||
@ -779,7 +779,7 @@ void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
CHECK_EQ(ELEMENT_COUNT, vec->Length());
|
||||
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Assembler masm(isolate, buffer, sizeof(buffer));
|
||||
Assembler masm(Assembler::Options{}, buffer, sizeof(buffer));
|
||||
|
||||
// Remove return address from the stack for fix stack frame alignment.
|
||||
__ popq(rcx);
|
||||
@ -868,7 +868,7 @@ TEST(AssemblerX64Extractps) {
|
||||
v8::HandleScope scope(CcTest::isolate());
|
||||
byte buffer[256];
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Assembler masm(isolate, buffer, sizeof(buffer));
|
||||
Assembler masm(Assembler::Options{}, buffer, sizeof(buffer));
|
||||
{
|
||||
CpuFeatureScope fscope2(&masm, SSE4_1);
|
||||
__ extractps(rax, xmm0, 0x1);
|
||||
@ -1414,7 +1414,7 @@ TEST(AssemblerX64SSE_ss) {
|
||||
Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
|
||||
HandleScope scope(isolate);
|
||||
v8::internal::byte buffer[1024];
|
||||
Assembler masm(isolate, buffer, sizeof(buffer));
|
||||
Assembler masm(Assembler::Options{}, buffer, sizeof(buffer));
|
||||
{
|
||||
Label exit;
|
||||
// arguments in xmm0, xmm1 and xmm2
|
||||
@ -1492,7 +1492,7 @@ TEST(AssemblerX64AVX_ss) {
|
||||
Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
|
||||
HandleScope scope(isolate);
|
||||
v8::internal::byte buffer[1024];
|
||||
Assembler masm(isolate, buffer, sizeof(buffer));
|
||||
Assembler masm(Assembler::Options{}, buffer, sizeof(buffer));
|
||||
{
|
||||
CpuFeatureScope avx_scope(&masm, AVX);
|
||||
Label exit;
|
||||
@ -1577,7 +1577,7 @@ TEST(AssemblerX64AVX_sd) {
|
||||
Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
|
||||
HandleScope scope(isolate);
|
||||
v8::internal::byte buffer[1024];
|
||||
Assembler masm(isolate, buffer, sizeof(buffer));
|
||||
Assembler masm(Assembler::Options{}, buffer, sizeof(buffer));
|
||||
{
|
||||
CpuFeatureScope avx_scope(&masm, AVX);
|
||||
Label exit;
|
||||
@ -2482,7 +2482,7 @@ TEST(AssemblerX64PslldWithXmm15) {
|
||||
CcTest::InitializeVM();
|
||||
size_t allocated;
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
Assembler masm(CcTest::i_isolate(), buffer, static_cast<int>(allocated));
|
||||
Assembler masm(Assembler::Options{}, buffer, static_cast<int>(allocated));
|
||||
|
||||
__ movq(xmm15, arg1);
|
||||
__ pslld(xmm15, 1);
|
||||
|
@ -110,11 +110,10 @@ bool DisassembleAndCompare(byte* begin, UseRegex use_regex,
|
||||
CcTest::InitializeVM(); \
|
||||
Isolate* isolate = CcTest::i_isolate(); \
|
||||
HandleScope scope(isolate); \
|
||||
byte *buffer = reinterpret_cast<byte*>(malloc(4*1024)); \
|
||||
Assembler assm(isolate, buffer, 4*1024); \
|
||||
byte* buffer = reinterpret_cast<byte*>(malloc(4 * 1024)); \
|
||||
Assembler assm(Assembler::Options{}, buffer, 4 * 1024); \
|
||||
bool failure = false;
|
||||
|
||||
|
||||
// This macro assembles one instruction using the preallocated assembler and
|
||||
// disassembles the generated instruction, comparing the output to the expected
|
||||
// value. If the comparison fails an error message is printed, but the test
|
||||
|
@ -68,7 +68,7 @@ namespace internal {
|
||||
HandleScope scope(isolate); \
|
||||
byte* buf = static_cast<byte*>(malloc(INSTR_SIZE)); \
|
||||
uint32_t encoding = 0; \
|
||||
Assembler* assm = new Assembler(isolate, buf, INSTR_SIZE); \
|
||||
Assembler* assm = new Assembler(Assembler::Options{}, buf, INSTR_SIZE); \
|
||||
Decoder<DispatchingDecoderVisitor>* decoder = \
|
||||
new Decoder<DispatchingDecoderVisitor>(); \
|
||||
DisassemblingDecoder* disasm = new DisassemblingDecoder(); \
|
||||
@ -1872,17 +1872,28 @@ TEST_(system_nop) {
|
||||
|
||||
|
||||
TEST_(debug) {
|
||||
SET_UP_ASM();
|
||||
InitializeVM();
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
// Loop runs with and without the simulator code enabled.
|
||||
HandleScope scope(isolate);
|
||||
byte* buf = static_cast<byte*>(malloc(INSTR_SIZE));
|
||||
uint32_t encoding = 0;
|
||||
Assembler::Options options;
|
||||
options.enable_simulator_code = (i == 1);
|
||||
Assembler* assm = new Assembler(options, buf, INSTR_SIZE);
|
||||
Decoder<DispatchingDecoderVisitor>* decoder =
|
||||
new Decoder<DispatchingDecoderVisitor>();
|
||||
DisassemblingDecoder* disasm = new DisassemblingDecoder();
|
||||
decoder->AppendVisitor(disasm);
|
||||
|
||||
CHECK_EQ(kImmExceptionIsDebug, 0xdeb0);
|
||||
|
||||
// All debug codes should produce the same instruction, and the debug code
|
||||
// can be any uint32_t.
|
||||
#ifdef USE_SIMULATOR
|
||||
const char* expected_instruction = "hlt #0xdeb0";
|
||||
#else
|
||||
const char* expected_instruction = "brk #0x0";
|
||||
#endif
|
||||
const char* expected_instruction =
|
||||
options.enable_simulator_code ? "hlt #0xdeb0" : "brk #0x0";
|
||||
|
||||
COMPARE(debug("message", 0, BREAK), expected_instruction);
|
||||
COMPARE(debug("message", 1, BREAK), expected_instruction);
|
||||
@ -1893,6 +1904,7 @@ TEST_(debug) {
|
||||
COMPARE(debug("message", 0xffffffffu, BREAK), expected_instruction);
|
||||
|
||||
CLEANUP();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -51,7 +51,7 @@ TEST(DisasmIa320) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
v8::internal::byte buffer[8192];
|
||||
Assembler assm(isolate, buffer, sizeof buffer);
|
||||
Assembler assm(Assembler::Options{}, buffer, sizeof buffer);
|
||||
DummyStaticFunction(nullptr); // just bloody use it (DELETE; debugging)
|
||||
// Short immediate instructions
|
||||
__ adc(eax, 12345678);
|
||||
|
@ -74,11 +74,10 @@ bool DisassembleAndCompare(byte* pc, const char* compare_string) {
|
||||
CcTest::InitializeVM(); \
|
||||
Isolate* isolate = CcTest::i_isolate(); \
|
||||
HandleScope scope(isolate); \
|
||||
byte *buffer = reinterpret_cast<byte*>(malloc(4*1024)); \
|
||||
Assembler assm(isolate, buffer, 4*1024); \
|
||||
byte* buffer = reinterpret_cast<byte*>(malloc(4 * 1024)); \
|
||||
Assembler assm(Assembler::Options{}, buffer, 4 * 1024); \
|
||||
bool failure = false;
|
||||
|
||||
|
||||
// This macro assembles one instruction using the preallocated assembler and
|
||||
// disassembles the generated instruction, comparing the output to the expected
|
||||
// value. If the comparison fails an error message is printed, but the test
|
||||
|
@ -74,11 +74,10 @@ bool DisassembleAndCompare(byte* pc, const char* compare_string) {
|
||||
CcTest::InitializeVM(); \
|
||||
Isolate* isolate = CcTest::i_isolate(); \
|
||||
HandleScope scope(isolate); \
|
||||
byte *buffer = reinterpret_cast<byte*>(malloc(4*1024)); \
|
||||
Assembler assm(isolate, buffer, 4*1024); \
|
||||
byte* buffer = reinterpret_cast<byte*>(malloc(4 * 1024)); \
|
||||
Assembler assm(Assembler::Options{}, buffer, 4 * 1024); \
|
||||
bool failure = false;
|
||||
|
||||
|
||||
// This macro assembles one instruction using the preallocated assembler and
|
||||
// disassembles the generated instruction, comparing the output to the expected
|
||||
// value. If the comparison fails an error message is printed, but the test
|
||||
|
@ -68,10 +68,9 @@ bool DisassembleAndCompare(byte* pc, const char* compare_string) {
|
||||
Isolate* isolate = CcTest::i_isolate(); \
|
||||
HandleScope scope(isolate); \
|
||||
byte* buffer = reinterpret_cast<byte*>(malloc(4 * 1024)); \
|
||||
Assembler assm(isolate, buffer, 4 * 1024); \
|
||||
Assembler assm(Assembler::Options{}, buffer, 4 * 1024); \
|
||||
bool failure = false;
|
||||
|
||||
|
||||
// This macro assembles one instruction using the preallocated assembler and
|
||||
// disassembles the generated instruction, comparing the output to the expected
|
||||
// value. If the comparison fails an error message is printed, but the test
|
||||
|
@ -67,7 +67,7 @@ bool DisassembleAndCompare(byte* pc, const char* compare_string) {
|
||||
Isolate* isolate = CcTest::i_isolate(); \
|
||||
HandleScope scope(isolate); \
|
||||
byte* buffer = reinterpret_cast<byte*>(malloc(4 * 1024)); \
|
||||
Assembler assm(isolate, buffer, 4 * 1024); \
|
||||
Assembler assm(Assembler::Options{}, buffer, 4 * 1024); \
|
||||
bool failure = false;
|
||||
|
||||
// This macro assembles one instruction using the preallocated assembler and
|
||||
|
@ -52,7 +52,7 @@ TEST(DisasmX64) {
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
HandleScope scope(isolate);
|
||||
v8::internal::byte buffer[8192];
|
||||
Assembler assm(isolate, buffer, sizeof buffer);
|
||||
Assembler assm(Assembler::Options{}, buffer, sizeof buffer);
|
||||
DummyStaticFunction(nullptr); // just bloody use it (DELETE; debugging)
|
||||
|
||||
// Short immediate instructions
|
||||
|
@ -3672,7 +3672,7 @@ TEST(WeakReference) {
|
||||
i::Handle<i::FeedbackVector> fv = factory->NewFeedbackVector(shared_function);
|
||||
|
||||
// Create a Code.
|
||||
i::Assembler assm(i_isolate, nullptr, 0);
|
||||
i::Assembler assm(i::Assembler::Options{}, nullptr, 0);
|
||||
assm.nop(); // supported on all architectures
|
||||
i::CodeDesc desc;
|
||||
assm.GetCode(i_isolate, &desc);
|
||||
|
Loading…
Reference in New Issue
Block a user