Remove a brittle assertion from Turbofan lazy deoptimization handling.
authorjarin@chromium.org <jarin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 13 Aug 2014 11:46:05 +0000 (11:46 +0000)
committerjarin@chromium.org <jarin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 13 Aug 2014 11:46:05 +0000 (11:46 +0000)
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
src/compiler/arm64/code-generator-arm64.cc
src/compiler/code-generator.cc
src/compiler/code-generator.h
src/compiler/ia32/code-generator-ia32.cc
src/compiler/x64/code-generator-x64.cc
test/cctest/cctest.status

index 90eb7cd..a7c227f 100644 (file)
@@ -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> code, int start_pc,
-                                            int end_pc) {
-  return false;
-}
-
-#endif  // DEBUG
-
 #undef __
 }
 }
index 065889c..43b1c7e 100644 (file)
@@ -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> 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<v8::internal::Instruction*>(instr_address);
-  return instr->IsMovz() && instr->Rd() == xzr.code() && instr->SixtyFourBits();
-}
-
-#endif  // DEBUG
-
 }  // namespace compiler
 }  // namespace internal
 }  // namespace v8
index 878ace3..75ca96d 100644 (file)
@@ -225,9 +225,6 @@ void CodeGenerator::PopulateDeoptimizationData(Handle<Code> 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> code, int start_pc,
-                                            int end_pc) {
-  UNIMPLEMENTED();
-  return false;
-}
-#endif
-
 #endif  // !V8_TURBOFAN_BACKEND
 
 }  // namespace compiler
index b603c55..c6069b6 100644 (file)
@@ -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> code, int start_pc,
-                                      int end_pc);
-#endif  // DEBUG
   // ===========================================================================
 
   class LazyDeoptimizationEntry V8_FINAL {
index 31a0179..9fef740 100644 (file)
@@ -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> 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
index 9f278ad..f407fa5 100644 (file)
@@ -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> 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
index cfe5fa0..60baaca 100644 (file)
 
   '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],