diff options
Diffstat (limited to 'deps/v8/test/cctest/test-macro-assembler-x64.cc')
-rw-r--r-- | deps/v8/test/cctest/test-macro-assembler-x64.cc | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/deps/v8/test/cctest/test-macro-assembler-x64.cc b/deps/v8/test/cctest/test-macro-assembler-x64.cc index 86f81c39f1..c5001f5b91 100644 --- a/deps/v8/test/cctest/test-macro-assembler-x64.cc +++ b/deps/v8/test/cctest/test-macro-assembler-x64.cc @@ -27,13 +27,13 @@ #include <stdlib.h> -#include "src/init/v8.h" - #include "src/base/platform/platform.h" #include "src/codegen/macro-assembler.h" #include "src/codegen/x64/assembler-x64-inl.h" +#include "src/deoptimizer/deoptimizer.h" #include "src/execution/simulator.h" #include "src/heap/factory.h" +#include "src/init/v8.h" #include "src/objects/objects-inl.h" #include "src/objects/smi.h" #include "src/utils/ostreams.h" @@ -450,7 +450,7 @@ TEST(EmbeddedObj) { CodeDesc desc; masm->GetCode(isolate, &desc); Handle<Code> code = - Factory::CodeBuilder(isolate, desc, CodeKind::STUB).Build(); + Factory::CodeBuilder(isolate, desc, CodeKind::FOR_TESTING).Build(); #ifdef OBJECT_PRINT StdoutStream os; code->Print(os); @@ -1033,6 +1033,29 @@ TEST(AreAliased) { DCHECK(AreAliased(rax, no_reg, rbx, no_reg, rcx, no_reg, rdx, rax, no_reg)); } +TEST(DeoptExitSizeIsFixed) { + CHECK(Deoptimizer::kSupportsFixedDeoptExitSizes); + + Isolate* isolate = CcTest::i_isolate(); + HandleScope handles(isolate); + auto buffer = AllocateAssemblerBuffer(); + MacroAssembler masm(isolate, v8::internal::CodeObjectRequired::kYes, + buffer->CreateView()); + + STATIC_ASSERT(static_cast<int>(kFirstDeoptimizeKind) == 0); + for (int i = 0; i < kDeoptimizeKindCount; i++) { + DeoptimizeKind kind = static_cast<DeoptimizeKind>(i); + Builtins::Name target = Deoptimizer::GetDeoptimizationEntry(isolate, kind); + Label before_exit; + masm.bind(&before_exit); + masm.CallForDeoptimization(target, 42, &before_exit, kind, nullptr); + CHECK_EQ(masm.SizeOfCodeGeneratedSince(&before_exit), + kind == DeoptimizeKind::kLazy + ? Deoptimizer::kLazyDeoptExitSize + : Deoptimizer::kNonLazyDeoptExitSize); + } +} + #undef __ } // namespace test_macro_assembler_x64 |