Commit cd9ae446 authored by yangguo's avatar yangguo Committed by Commit bot

Debugger: always include deoptimization support for debug code.

R=mstarzinger@chromium.org
BUG=chromium:513496
LOG=N

Review URL: https://codereview.chromium.org/1252323002

Cr-Commit-Position: refs/heads/master@{#29846}
parent 3e40b64a
......@@ -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)) {
......
......@@ -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());
......@@ -425,12 +425,9 @@ class CompilationInfo {
// Compilation mode.
// BASE is generated by the full codegen, optionally prepared for bailouts.
// OPTIMIZE is optimized code generated by the Hydrogen-based backend.
// NONOPT is generated by the full codegen and is not prepared for
// recompilation/bailouts. These functions are never recompiled.
enum Mode {
BASE,
OPTIMIZE,
NONOPT,
STUB
};
......
......@@ -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);
......
......@@ -4567,21 +4567,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);
......
......@@ -5060,11 +5060,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.
......@@ -5359,9 +5354,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>.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment