Skip to content

Commit cd9ae44

Browse files
hashseedCommit bot
authored andcommitted
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}
1 parent 3e40b64 commit cd9ae44

5 files changed

Lines changed: 7 additions & 38 deletions

File tree

src/compiler.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -969,13 +969,6 @@ bool Compiler::EnsureDeoptimizationSupport(CompilationInfo* info) {
969969
MaybeHandle<Code> CompileForDebugging(CompilationInfo* info) {
970970
info->MarkAsDebug();
971971
VMState<COMPILER> state(info->isolate());
972-
if (info->shared_info()->is_compiled()) {
973-
if (info->shared_info()->code()->is_compiled_optimizable()) {
974-
info->EnableDeoptimizationSupport();
975-
} else {
976-
info->MarkNonOptimizable();
977-
}
978-
}
979972
MaybeHandle<Code> maybe_new_code = GetUnoptimizedCodeCommon(info);
980973
Handle<Code> new_code;
981974
if (!maybe_new_code.ToHandle(&new_code)) {

src/compiler.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,11 @@ class CompilationInfo {
208208

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

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

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

274-
void MarkNonOptimizable() {
275-
SetMode(CompilationInfo::NONOPT);
276-
}
277-
278278
bool ShouldTrapOnDeopt() const {
279279
return (FLAG_trap_on_deopt && IsOptimizing()) ||
280280
(FLAG_trap_on_stub_deopt && IsStub());
@@ -425,12 +425,9 @@ class CompilationInfo {
425425
// Compilation mode.
426426
// BASE is generated by the full codegen, optionally prepared for bailouts.
427427
// OPTIMIZE is optimized code generated by the Hydrogen-based backend.
428-
// NONOPT is generated by the full codegen and is not prepared for
429-
// recompilation/bailouts. These functions are never recompiled.
430428
enum Mode {
431429
BASE,
432430
OPTIMIZE,
433-
NONOPT,
434431
STUB
435432
};
436433

src/full-codegen/full-codegen.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ bool FullCodeGenerator::MakeCode(CompilationInfo* info) {
5959
cgen.PopulateHandlerTable(code);
6060
code->set_has_deoptimization_support(info->HasDeoptimizationSupport());
6161
code->set_has_reloc_info_for_serialization(info->will_serialize());
62-
code->set_compiled_optimizable(info->IsOptimizable());
6362
code->set_allow_osr_at_loop_nesting_level(0);
6463
code->set_profiler_ticks(0);
6564
code->set_back_edge_table_offset(table_offset);

src/objects-inl.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4567,21 +4567,6 @@ void Code::set_has_debug_break_slots(bool value) {
45674567
}
45684568

45694569

4570-
bool Code::is_compiled_optimizable() {
4571-
DCHECK_EQ(FUNCTION, kind());
4572-
unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags);
4573-
return FullCodeFlagsIsCompiledOptimizable::decode(flags);
4574-
}
4575-
4576-
4577-
void Code::set_compiled_optimizable(bool value) {
4578-
DCHECK_EQ(FUNCTION, kind());
4579-
unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags);
4580-
flags = FullCodeFlagsIsCompiledOptimizable::update(flags, value);
4581-
WRITE_UINT32_FIELD(this, kFullCodeFlags, flags);
4582-
}
4583-
4584-
45854570
bool Code::has_reloc_info_for_serialization() {
45864571
DCHECK_EQ(FUNCTION, kind());
45874572
unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags);

src/objects.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5060,11 +5060,6 @@ class Code: public HeapObject {
50605060
inline bool has_debug_break_slots();
50615061
inline void set_has_debug_break_slots(bool value);
50625062

5063-
// [compiled_with_optimizing]: For FUNCTION kind, tells if it has
5064-
// been compiled with IsOptimizing set to true.
5065-
inline bool is_compiled_optimizable();
5066-
inline void set_compiled_optimizable(bool value);
5067-
50685063
// [has_reloc_info_for_serialization]: For FUNCTION kind, tells if its
50695064
// reloc info includes runtime and external references to support
50705065
// serialization/deserialization.
@@ -5359,9 +5354,9 @@ class Code: public HeapObject {
53595354
class FullCodeFlagsHasDeoptimizationSupportField:
53605355
public BitField<bool, 0, 1> {}; // NOLINT
53615356
class FullCodeFlagsHasDebugBreakSlotsField: public BitField<bool, 1, 1> {};
5362-
class FullCodeFlagsIsCompiledOptimizable: public BitField<bool, 2, 1> {};
53635357
class FullCodeFlagsHasRelocInfoForSerialization
5364-
: public BitField<bool, 3, 1> {};
5358+
: public BitField<bool, 2, 1> {};
5359+
// Bit 3 in this bitfield is unused.
53655360
class ProfilerTicksField : public BitField<int, 4, 28> {};
53665361

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

0 commit comments

Comments
 (0)