diff --git a/src/arm/assembler-arm.h b/src/arm/assembler-arm.h index 459c10a184..7a095a9c6f 100644 --- a/src/arm/assembler-arm.h +++ b/src/arm/assembler-arm.h @@ -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(); diff --git a/src/arm64/assembler-arm64.h b/src/arm64/assembler-arm64.h index 7f11864ef2..c21018c0ba 100644 --- a/src/arm64/assembler-arm64.h +++ b/src/arm64/assembler-arm64.h @@ -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(); diff --git a/src/ia32/assembler-ia32.h b/src/ia32/assembler-ia32.h index f282825125..a004a9fc2b 100644 --- a/src/ia32/assembler-ia32.h +++ b/src/ia32/assembler-ia32.h @@ -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() {} diff --git a/src/mips/assembler-mips.h b/src/mips/assembler-mips.h index 278404986c..cc76724f1b 100644 --- a/src/mips/assembler-mips.h +++ b/src/mips/assembler-mips.h @@ -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() { } diff --git a/src/mips64/assembler-mips64.h b/src/mips64/assembler-mips64.h index 50b10fa7b3..114586f4df 100644 --- a/src/mips64/assembler-mips64.h +++ b/src/mips64/assembler-mips64.h @@ -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() { } diff --git a/src/ppc/assembler-ppc.h b/src/ppc/assembler-ppc.h index 5a7c47a55b..b5f7598e98 100644 --- a/src/ppc/assembler-ppc.h +++ b/src/ppc/assembler-ppc.h @@ -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() {} diff --git a/src/s390/assembler-s390.h b/src/s390/assembler-s390.h index e29fb25945..5e5a99be56 100644 --- a/src/s390/assembler-s390.h +++ b/src/s390/assembler-s390.h @@ -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() {} diff --git a/src/wasm/baseline/ia32/liftoff-assembler-ia32.h b/src/wasm/baseline/ia32/liftoff-assembler-ia32.h index b2fa2fc993..733e6073f0 100644 --- a/src/wasm/baseline/ia32/liftoff-assembler-ia32.h +++ b/src/wasm/baseline/ia32/liftoff-assembler-ia32.h @@ -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); } diff --git a/src/wasm/baseline/x64/liftoff-assembler-x64.h b/src/wasm/baseline/x64/liftoff-assembler-x64.h index 36c3985c1d..b28d44870e 100644 --- a/src/wasm/baseline/x64/liftoff-assembler-x64.h +++ b/src/wasm/baseline/x64/liftoff-assembler-x64.h @@ -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); } diff --git a/src/x64/assembler-x64.h b/src/x64/assembler-x64.h index 709c244d66..bf92aa6e18 100644 --- a/src/x64/assembler-x64.h +++ b/src/x64/assembler-x64.h @@ -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() {} diff --git a/test/cctest/assembler-helper-arm.cc b/test/cctest/assembler-helper-arm.cc index 3ba5f6018e..412749476d 100644 --- a/test/cctest/assembler-helper-arm.cc +++ b/test/cctest/assembler-helper-arm.cc @@ -14,7 +14,7 @@ namespace internal { Handle AssembleCodeImpl(std::function assemble) { Isolate* isolate = CcTest::i_isolate(); - Assembler assm(isolate, nullptr, 0); + Assembler assm(Assembler::Options{}, nullptr, 0); assemble(assm); assm.bx(lr); diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc index 3948d5263c..856c317219 100644 --- a/test/cctest/heap/test-heap.cc +++ b/test/cctest/heap/test-heap.cc @@ -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 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++) { diff --git a/test/cctest/heap/test-weak-references.cc b/test/cctest/heap/test-weak-references.cc index 6ad9caaae5..f0b590c5f8 100644 --- a/test/cctest/heap/test-weak-references.cc +++ b/test/cctest/heap/test-weak-references.cc @@ -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); diff --git a/test/cctest/test-assembler-arm.cc b/test/cctest/test-assembler-arm.cc index 9eb080e047..99f5313db4 100644 --- a/test/cctest/test-assembler-arm.cc +++ b/test/cctest/test-assembler-arm.cc @@ -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 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); diff --git a/test/cctest/test-assembler-ia32.cc b/test/cctest/test-assembler-ia32.cc index 2e0630963c..5854488558 100644 --- a/test/cctest/test-assembler-ia32.cc +++ b/test/cctest/test-assembler-ia32.cc @@ -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(&baz), RelocInfo::NONE)); __ ret(0); @@ -241,7 +241,7 @@ TEST(AssemblerIa326) { Isolate* isolate = reinterpret_cast(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(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(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(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& 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(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(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(CcTest::isolate()); HandleScope scope(isolate); - Assembler assm(isolate, nullptr, 0); + Assembler assm(Assembler::Options{}, nullptr, 0); uint16_t a = 42; diff --git a/test/cctest/test-assembler-mips.cc b/test/cctest/test-assembler-mips.cc index 3825d5e8ce..87c7de08a2 100644 --- a/test/cctest/test-assembler-mips.cc +++ b/test/cctest/test-assembler-mips.cc @@ -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 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(); diff --git a/test/cctest/test-assembler-mips64.cc b/test/cctest/test-assembler-mips64.cc index 42910ee664..24c9d2230c 100644 --- a/test/cctest/test-assembler-mips64.cc +++ b/test/cctest/test-assembler-mips64.cc @@ -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); diff --git a/test/cctest/test-assembler-ppc.cc b/test/cctest/test-assembler-ppc.cc index caca6eb692..c9f41715b5 100644 --- a/test/cctest/test-assembler-ppc.cc +++ b/test/cctest/test-assembler-ppc.cc @@ -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); diff --git a/test/cctest/test-assembler-s390.cc b/test/cctest/test-assembler-s390.cc index 4f89d137ab..95adc2be8c 100644 --- a/test/cctest/test-assembler-s390.cc +++ b/test/cctest/test-assembler-s390.cc @@ -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 diff --git a/test/cctest/test-assembler-x64.cc b/test/cctest/test-assembler-x64.cc index 89d5c94da9..b868171ed9 100644 --- a/test/cctest/test-assembler-x64.cc +++ b/test/cctest/test-assembler-x64.cc @@ -74,7 +74,7 @@ TEST(AssemblerX64ReturnOperation) { CcTest::InitializeVM(); size_t allocated; byte* buffer = AllocateAssemblerBuffer(&allocated); - Assembler masm(CcTest::i_isolate(), buffer, static_cast(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(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& 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(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(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(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(allocated)); + Assembler masm(Assembler::Options{}, buffer, static_cast(allocated)); __ movq(xmm15, arg1); __ pslld(xmm15, 1); diff --git a/test/cctest/test-disasm-arm.cc b/test/cctest/test-disasm-arm.cc index 8e6db2c4d6..6da49a4ed3 100644 --- a/test/cctest/test-disasm-arm.cc +++ b/test/cctest/test-disasm-arm.cc @@ -106,15 +106,14 @@ bool DisassembleAndCompare(byte* begin, UseRegex use_regex, // Set up V8 to a state where we can at least run the assembler and // disassembler. Declare the variables and allocate the data structures used // in the rest of the macros. -#define SET_UP() \ - CcTest::InitializeVM(); \ - Isolate* isolate = CcTest::i_isolate(); \ - HandleScope scope(isolate); \ - byte *buffer = reinterpret_cast(malloc(4*1024)); \ - Assembler assm(isolate, buffer, 4*1024); \ +#define SET_UP() \ + CcTest::InitializeVM(); \ + Isolate* isolate = CcTest::i_isolate(); \ + HandleScope scope(isolate); \ + byte* buffer = reinterpret_cast(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 diff --git a/test/cctest/test-disasm-arm64.cc b/test/cctest/test-disasm-arm64.cc index 3813408a2b..14b02c27a4 100644 --- a/test/cctest/test-disasm-arm64.cc +++ b/test/cctest/test-disasm-arm64.cc @@ -62,16 +62,16 @@ namespace internal { DisassemblingDecoder* disasm = new DisassemblingDecoder(); \ decoder->AppendVisitor(disasm) -#define SET_UP_ASM() \ - InitializeVM(); \ - Isolate* isolate = CcTest::i_isolate(); \ - HandleScope scope(isolate); \ - byte* buf = static_cast(malloc(INSTR_SIZE)); \ - uint32_t encoding = 0; \ - Assembler* assm = new Assembler(isolate, buf, INSTR_SIZE); \ - Decoder* decoder = \ - new Decoder(); \ - DisassemblingDecoder* disasm = new DisassemblingDecoder(); \ +#define SET_UP_ASM() \ + InitializeVM(); \ + Isolate* isolate = CcTest::i_isolate(); \ + HandleScope scope(isolate); \ + byte* buf = static_cast(malloc(INSTR_SIZE)); \ + uint32_t encoding = 0; \ + Assembler* assm = new Assembler(Assembler::Options{}, buf, INSTR_SIZE); \ + Decoder* decoder = \ + new Decoder(); \ + DisassemblingDecoder* disasm = new DisassemblingDecoder(); \ decoder->AppendVisitor(disasm) #define COMPARE(ASM, EXP) \ @@ -1872,27 +1872,39 @@ TEST_(system_nop) { TEST_(debug) { - SET_UP_ASM(); + InitializeVM(); + Isolate* isolate = CcTest::i_isolate(); - CHECK_EQ(kImmExceptionIsDebug, 0xdeb0); + for (int i = 0; i < 2; i++) { + // Loop runs with and without the simulator code enabled. + HandleScope scope(isolate); + byte* buf = static_cast(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* decoder = + new Decoder(); + DisassemblingDecoder* disasm = new DisassemblingDecoder(); + decoder->AppendVisitor(disasm); - // 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 + CHECK_EQ(kImmExceptionIsDebug, 0xdeb0); - COMPARE(debug("message", 0, BREAK), expected_instruction); - COMPARE(debug("message", 1, BREAK), expected_instruction); - COMPARE(debug("message", 0xffff, BREAK), expected_instruction); - COMPARE(debug("message", 0x10000, BREAK), expected_instruction); - COMPARE(debug("message", 0x7fffffff, BREAK), expected_instruction); - COMPARE(debug("message", 0x80000000u, BREAK), expected_instruction); - COMPARE(debug("message", 0xffffffffu, BREAK), expected_instruction); + // All debug codes should produce the same instruction, and the debug code + // can be any uint32_t. + const char* expected_instruction = + options.enable_simulator_code ? "hlt #0xdeb0" : "brk #0x0"; - CLEANUP(); + COMPARE(debug("message", 0, BREAK), expected_instruction); + COMPARE(debug("message", 1, BREAK), expected_instruction); + COMPARE(debug("message", 0xffff, BREAK), expected_instruction); + COMPARE(debug("message", 0x10000, BREAK), expected_instruction); + COMPARE(debug("message", 0x7fffffff, BREAK), expected_instruction); + COMPARE(debug("message", 0x80000000u, BREAK), expected_instruction); + COMPARE(debug("message", 0xffffffffu, BREAK), expected_instruction); + + CLEANUP(); + } } diff --git a/test/cctest/test-disasm-ia32.cc b/test/cctest/test-disasm-ia32.cc index aa51615eab..b76b562375 100644 --- a/test/cctest/test-disasm-ia32.cc +++ b/test/cctest/test-disasm-ia32.cc @@ -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); diff --git a/test/cctest/test-disasm-mips.cc b/test/cctest/test-disasm-mips.cc index e394f9428a..f76e118937 100644 --- a/test/cctest/test-disasm-mips.cc +++ b/test/cctest/test-disasm-mips.cc @@ -70,15 +70,14 @@ bool DisassembleAndCompare(byte* pc, const char* compare_string) { // Set up V8 to a state where we can at least run the assembler and // disassembler. Declare the variables and allocate the data structures used // in the rest of the macros. -#define SET_UP() \ - CcTest::InitializeVM(); \ - Isolate* isolate = CcTest::i_isolate(); \ - HandleScope scope(isolate); \ - byte *buffer = reinterpret_cast(malloc(4*1024)); \ - Assembler assm(isolate, buffer, 4*1024); \ +#define SET_UP() \ + CcTest::InitializeVM(); \ + Isolate* isolate = CcTest::i_isolate(); \ + HandleScope scope(isolate); \ + byte* buffer = reinterpret_cast(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 diff --git a/test/cctest/test-disasm-mips64.cc b/test/cctest/test-disasm-mips64.cc index 0a16e860b3..e0e1994d0a 100644 --- a/test/cctest/test-disasm-mips64.cc +++ b/test/cctest/test-disasm-mips64.cc @@ -70,15 +70,14 @@ bool DisassembleAndCompare(byte* pc, const char* compare_string) { // Set up V8 to a state where we can at least run the assembler and // disassembler. Declare the variables and allocate the data structures used // in the rest of the macros. -#define SET_UP() \ - CcTest::InitializeVM(); \ - Isolate* isolate = CcTest::i_isolate(); \ - HandleScope scope(isolate); \ - byte *buffer = reinterpret_cast(malloc(4*1024)); \ - Assembler assm(isolate, buffer, 4*1024); \ +#define SET_UP() \ + CcTest::InitializeVM(); \ + Isolate* isolate = CcTest::i_isolate(); \ + HandleScope scope(isolate); \ + byte* buffer = reinterpret_cast(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 diff --git a/test/cctest/test-disasm-ppc.cc b/test/cctest/test-disasm-ppc.cc index 9650fee7a6..859e64bf40 100644 --- a/test/cctest/test-disasm-ppc.cc +++ b/test/cctest/test-disasm-ppc.cc @@ -68,10 +68,9 @@ bool DisassembleAndCompare(byte* pc, const char* compare_string) { Isolate* isolate = CcTest::i_isolate(); \ HandleScope scope(isolate); \ byte* buffer = reinterpret_cast(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 diff --git a/test/cctest/test-disasm-s390.cc b/test/cctest/test-disasm-s390.cc index 2306a541aa..9aa21760ec 100644 --- a/test/cctest/test-disasm-s390.cc +++ b/test/cctest/test-disasm-s390.cc @@ -67,7 +67,7 @@ bool DisassembleAndCompare(byte* pc, const char* compare_string) { Isolate* isolate = CcTest::i_isolate(); \ HandleScope scope(isolate); \ byte* buffer = reinterpret_cast(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 diff --git a/test/cctest/test-disasm-x64.cc b/test/cctest/test-disasm-x64.cc index 3d0b129046..ac3056f8e8 100644 --- a/test/cctest/test-disasm-x64.cc +++ b/test/cctest/test-disasm-x64.cc @@ -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 diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc index aa1462ac7e..2810be5887 100644 --- a/test/cctest/test-heap-profiler.cc +++ b/test/cctest/test-heap-profiler.cc @@ -3672,7 +3672,7 @@ TEST(WeakReference) { i::Handle 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);