From b80e76841eb9bcdefb1d8ef7c08fc390d6c39f76 Mon Sep 17 00:00:00 2001 From: "jarin@chromium.org" Date: Wed, 13 Aug 2014 11:46:05 +0000 Subject: [PATCH] Remove a brittle assertion from Turbofan lazy deoptimization handling. As discussed in person with Benedikt, it is better to remove the assertion because it is too brittle. The assertion says that the continuation block should immediately follow the call. However, there are exceptions - such as nop or constant pool in-between being fine - that make the assertion brittle. BUG= R=mstarzinger@chromium.org Review URL: https://codereview.chromium.org/471523002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23102 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/compiler/arm/code-generator-arm.cc | 10 ---------- src/compiler/arm64/code-generator-arm64.cc | 17 ----------------- src/compiler/code-generator.cc | 12 ------------ src/compiler/code-generator.h | 4 ---- src/compiler/ia32/code-generator-ia32.cc | 13 ------------- src/compiler/x64/code-generator-x64.cc | 14 -------------- test/cctest/cctest.status | 5 ----- 7 files changed, 75 deletions(-) diff --git a/src/compiler/arm/code-generator-arm.cc b/src/compiler/arm/code-generator-arm.cc index 90eb7cd..a7c227f 100644 --- a/src/compiler/arm/code-generator-arm.cc +++ b/src/compiler/arm/code-generator-arm.cc @@ -832,16 +832,6 @@ void CodeGenerator::AddNopForSmiCodeInlining() { UNREACHABLE(); } -#ifdef DEBUG - -// Checks whether the code between start_pc and end_pc is a no-op. -bool CodeGenerator::IsNopForSmiCodeInlining(Handle code, int start_pc, - int end_pc) { - return false; -} - -#endif // DEBUG - #undef __ } } diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc index 065889c..43b1c7e 100644 --- a/src/compiler/arm64/code-generator-arm64.cc +++ b/src/compiler/arm64/code-generator-arm64.cc @@ -832,23 +832,6 @@ void CodeGenerator::AddNopForSmiCodeInlining() { __ movz(xzr, 0); } #undef __ -#if DEBUG - -// Checks whether the code between start_pc and end_pc is a no-op. -bool CodeGenerator::IsNopForSmiCodeInlining(Handle code, int start_pc, - int end_pc) { - if (start_pc + 4 != end_pc) { - return false; - } - Address instr_address = code->instruction_start() + start_pc; - - v8::internal::Instruction* instr = - reinterpret_cast(instr_address); - return instr->IsMovz() && instr->Rd() == xzr.code() && instr->SixtyFourBits(); -} - -#endif // DEBUG - } // namespace compiler } // namespace internal } // namespace v8 diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc index 878ace3..75ca96d 100644 --- a/src/compiler/code-generator.cc +++ b/src/compiler/code-generator.cc @@ -225,9 +225,6 @@ void CodeGenerator::PopulateDeoptimizationData(Handle code_object) { // Populate the return address patcher entries. for (int i = 0; i < patch_count; ++i) { LazyDeoptimizationEntry entry = lazy_deoptimization_entries_[i]; - DCHECK(entry.position_after_call() == entry.continuation()->pos() || - IsNopForSmiCodeInlining(code_object, entry.position_after_call(), - entry.continuation()->pos())); data->SetReturnAddressPc(i, Smi::FromInt(entry.position_after_call())); data->SetPatchedAddressPc(i, Smi::FromInt(entry.deoptimization()->pos())); } @@ -365,15 +362,6 @@ void CodeGenerator::AssembleSwap(InstructionOperand* source, void CodeGenerator::AddNopForSmiCodeInlining() { UNIMPLEMENTED(); } - -#ifdef DEBUG -bool CodeGenerator::IsNopForSmiCodeInlining(Handle code, int start_pc, - int end_pc) { - UNIMPLEMENTED(); - return false; -} -#endif - #endif // !V8_TURBOFAN_BACKEND } // namespace compiler diff --git a/src/compiler/code-generator.h b/src/compiler/code-generator.h index b603c55..c6069b6 100644 --- a/src/compiler/code-generator.h +++ b/src/compiler/code-generator.h @@ -88,10 +88,6 @@ class CodeGenerator V8_FINAL : public GapResolver::Assembler { void AddTranslationForOperand(Translation* translation, Instruction* instr, InstructionOperand* op); void AddNopForSmiCodeInlining(); -#if DEBUG - static bool IsNopForSmiCodeInlining(Handle code, int start_pc, - int end_pc); -#endif // DEBUG // =========================================================================== class LazyDeoptimizationEntry V8_FINAL { diff --git a/src/compiler/ia32/code-generator-ia32.cc b/src/compiler/ia32/code-generator-ia32.cc index 31a0179..9fef740 100644 --- a/src/compiler/ia32/code-generator-ia32.cc +++ b/src/compiler/ia32/code-generator-ia32.cc @@ -938,19 +938,6 @@ void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } #undef __ -#ifdef DEBUG - -// Checks whether the code between start_pc and end_pc is a no-op. -bool CodeGenerator::IsNopForSmiCodeInlining(Handle code, int start_pc, - int end_pc) { - if (start_pc + 1 != end_pc) { - return false; - } - return *(code->instruction_start() + start_pc) == - v8::internal::Assembler::kNopByte; -} - -#endif // DEBUG } } } // namespace v8::internal::compiler diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc index 9f278ad..f407fa5 100644 --- a/src/compiler/x64/code-generator-x64.cc +++ b/src/compiler/x64/code-generator-x64.cc @@ -982,20 +982,6 @@ void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } #undef __ -#ifdef DEBUG - -// Checks whether the code between start_pc and end_pc is a no-op. -bool CodeGenerator::IsNopForSmiCodeInlining(Handle code, int start_pc, - int end_pc) { - if (start_pc + 1 != end_pc) { - return false; - } - return *(code->instruction_start() + start_pc) == - v8::internal::Assembler::kNopByte; -} - -#endif - } // namespace internal } // namespace compiler } // namespace v8 diff --git a/test/cctest/cctest.status b/test/cctest/cctest.status index cfe5fa0..60baaca 100644 --- a/test/cctest/cctest.status +++ b/test/cctest/cctest.status @@ -179,11 +179,6 @@ 'test-api/Bug618': [PASS], - # TODO(turbofan): Deoptimization support buggy with snapshot=off. - 'test-run-deopt/*': [PASS, ['no_snap == True', NO_VARIANTS]], - 'test-deoptimization/*': [PASS, ['no_snap == True', NO_VARIANTS]], - 'test-scheduler/BuildScheduleTrivialLazyDeoptCall': [PASS, ['no_snap == True', NO_VARIANTS]], - # BUG(v8:3385). 'test-serialize/DeserializeFromSecondSerialization': [PASS, FAIL], 'test-serialize/DeserializeFromSecondSerializationAndRunScript2': [PASS, FAIL], -- 2.7.4