Reviewers: Michael Starzinger,

Description:
Debugger: always include deoptimization support for debug code.


[email protected]
BUG=chromium:513496
LOG=N

Please review this at https://codereview.chromium.org/1252323002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+7, -36 lines):
  M src/compiler.h
  M src/compiler.cc
  M src/full-codegen/full-codegen.cc
  M src/objects.h
  M src/objects-inl.h


Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 9ed494378a1177bcd4cf369a6ddd27276665c27c..861a34a2ce4522360310a6023daf65b4ad5797b3 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -969,13 +969,6 @@ bool Compiler::EnsureDeoptimizationSupport(CompilationInfo* info) {
 MaybeHandle<Code> CompileForDebugging(CompilationInfo* info) {
   info->MarkAsDebug();
   VMState<COMPILER> state(info->isolate());
-  if (info->shared_info()->is_compiled()) {
-    if (info->shared_info()->code()->is_compiled_optimizable()) {
-      info->EnableDeoptimizationSupport();
-    } else {
-      info->MarkNonOptimizable();
-    }
-  }
   MaybeHandle<Code> maybe_new_code = GetUnoptimizedCodeCommon(info);
   Handle<Code> new_code;
   if (!maybe_new_code.ToHandle(&new_code)) {
Index: src/compiler.h
diff --git a/src/compiler.h b/src/compiler.h
index e50b42dd29b936c343f8f76b7dea0427a2bc619b..184cd502e6699fc9364d05e4db79988860ec5049 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -208,7 +208,11 @@ class CompilationInfo {

// Compiles marked as debug produce unoptimized code with debug break slots. // Inner functions that cannot be compiled w/o context are compiled eagerly.
-  void MarkAsDebug() { SetFlag(kDebug); }
+ // Always include deoptimization support to avoid having to recompile again.
+  void MarkAsDebug() {
+    SetFlag(kDebug);
+    SetFlag(kDeoptimizationSupport);
+  }

   bool is_debug() const { return GetFlag(kDebug); }

@@ -271,10 +275,6 @@ class CompilationInfo {
   }
   void SetCode(Handle<Code> code) { code_ = code; }

-  void MarkNonOptimizable() {
-    SetMode(CompilationInfo::NONOPT);
-  }
-
   bool ShouldTrapOnDeopt() const {
     return (FLAG_trap_on_deopt && IsOptimizing()) ||
         (FLAG_trap_on_stub_deopt && IsStub());
@@ -430,7 +430,6 @@ class CompilationInfo {
   enum Mode {
     BASE,
     OPTIMIZE,
-    NONOPT,
     STUB
   };

Index: src/full-codegen/full-codegen.cc
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc index 4b32e96582dbe419ce1c3c2600295866792c9b8c..c1512ac3bc2a929890c7b02757dc1abfb208b523 100644
--- a/src/full-codegen/full-codegen.cc
+++ b/src/full-codegen/full-codegen.cc
@@ -59,7 +59,6 @@ bool FullCodeGenerator::MakeCode(CompilationInfo* info) {
   cgen.PopulateHandlerTable(code);
   code->set_has_deoptimization_support(info->HasDeoptimizationSupport());
   code->set_has_reloc_info_for_serialization(info->will_serialize());
-  code->set_compiled_optimizable(info->IsOptimizable());
   code->set_allow_osr_at_loop_nesting_level(0);
   code->set_profiler_ticks(0);
   code->set_back_edge_table_offset(table_offset);
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index a4ca8c34e29eeec8737c7f0b3025952c319b54cd..2e752bf0bfd2d3f769f5202377ad48151a0b7522 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4541,21 +4541,6 @@ void Code::set_has_debug_break_slots(bool value) {
 }


-bool Code::is_compiled_optimizable() {
-  DCHECK_EQ(FUNCTION, kind());
-  unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags);
-  return FullCodeFlagsIsCompiledOptimizable::decode(flags);
-}
-
-
-void Code::set_compiled_optimizable(bool value) {
-  DCHECK_EQ(FUNCTION, kind());
-  unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags);
-  flags = FullCodeFlagsIsCompiledOptimizable::update(flags, value);
-  WRITE_UINT32_FIELD(this, kFullCodeFlags, flags);
-}
-
-
 bool Code::has_reloc_info_for_serialization() {
   DCHECK_EQ(FUNCTION, kind());
   unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags);
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index d8852427613ce939b7542b209bb5f39b0a522d63..98e437fbaa8272f3bc71994c4bb8129abc314ea0 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5009,11 +5009,6 @@ class Code: public HeapObject {
   inline bool has_debug_break_slots();
   inline void set_has_debug_break_slots(bool value);

-  // [compiled_with_optimizing]: For FUNCTION kind, tells if it has
-  // been compiled with IsOptimizing set to true.
-  inline bool is_compiled_optimizable();
-  inline void set_compiled_optimizable(bool value);
-
   // [has_reloc_info_for_serialization]: For FUNCTION kind, tells if its
   // reloc info includes runtime and external references to support
   // serialization/deserialization.
@@ -5308,9 +5303,9 @@ class Code: public HeapObject {
   class FullCodeFlagsHasDeoptimizationSupportField:
       public BitField<bool, 0, 1> {};  // NOLINT
class FullCodeFlagsHasDebugBreakSlotsField: public BitField<bool, 1, 1> {};
-  class FullCodeFlagsIsCompiledOptimizable: public BitField<bool, 2, 1> {};
   class FullCodeFlagsHasRelocInfoForSerialization
-      : public BitField<bool, 3, 1> {};
+      : public BitField<bool, 2, 1> {};
+  // Bit 3 in this bitfield is unused.
   class ProfilerTicksField : public BitField<int, 4, 28> {};

   // Flags layout.  BitField<type, shift, size>.


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to