debug.h 21.1 KB
Newer Older
1
// Copyright 2012 the V8 project authors. All rights reserved.
2 3
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
4

5 6
#ifndef V8_DEBUG_DEBUG_H_
#define V8_DEBUG_DEBUG_H_
7

8
#include <memory>
9 10
#include <vector>

11
#include "src/codegen/source-position-table.h"
12
#include "src/common/globals.h"
13
#include "src/debug/debug-interface.h"
14
#include "src/debug/interface-types.h"
15
#include "src/execution/interrupts-scope.h"
16
#include "src/execution/isolate.h"
17
#include "src/handles/handles.h"
18
#include "src/objects/debug-objects.h"
19

20 21
namespace v8 {
namespace internal {
22

23
// Forward declarations.
Marja Hölttä's avatar
Marja Hölttä committed
24
class AbstractCode;
25
class DebugScope;
26 27
class InterpretedFrame;
class JavaScriptFrame;
28
class JSGeneratorObject;
29
class StackFrame;
30

31
// Step actions. NOTE: These values are in macros.py as well.
32
enum StepAction : int8_t {
33
  StepNone = -1,  // Stepping not prepared.
34 35 36 37
  StepOut = 0,    // Step out of the current function.
  StepNext = 1,   // Step to the next statement in the current function.
  StepIn = 2,     // Step into new functions invoked or the next statement
                  // in the current function.
38
  LastStepAction = StepIn
39
};
40 41 42 43 44 45 46

// Type of exception break. NOTE: These values are in macros.py as well.
enum ExceptionBreakType {
  BreakException = 0,
  BreakUncaughtException = 1
};

47 48 49 50 51 52
enum DebugBreakType {
  NOT_DEBUG_BREAK,
  DEBUGGER_STATEMENT,
  DEBUG_BREAK_SLOT,
  DEBUG_BREAK_SLOT_AT_CALL,
  DEBUG_BREAK_SLOT_AT_RETURN,
53
  DEBUG_BREAK_SLOT_AT_SUSPEND,
54
  DEBUG_BREAK_AT_ENTRY,
55
};
56

57 58 59 60 61
enum IgnoreBreakMode {
  kIgnoreIfAllFramesBlackboxed,
  kIgnoreIfTopFrameBlackboxed
};

62
class BreakLocation {
63
 public:
64
  static BreakLocation Invalid() { return BreakLocation(-1, NOT_DEBUG_BREAK); }
65 66
  static BreakLocation FromFrame(Handle<DebugInfo> debug_info,
                                 JavaScriptFrame* frame);
67

68 69
  static void AllAtCurrentStatement(Handle<DebugInfo> debug_info,
                                    JavaScriptFrame* frame,
70
                                    std::vector<BreakLocation>* result_out);
71

72
  inline bool IsSuspend() const { return type_ == DEBUG_BREAK_SLOT_AT_SUSPEND; }
73
  inline bool IsReturn() const { return type_ == DEBUG_BREAK_SLOT_AT_RETURN; }
74 75 76
  inline bool IsReturnOrSuspend() const {
    return type_ >= DEBUG_BREAK_SLOT_AT_RETURN;
  }
77
  inline bool IsCall() const { return type_ == DEBUG_BREAK_SLOT_AT_CALL; }
78 79 80 81
  inline bool IsDebugBreakSlot() const { return type_ >= DEBUG_BREAK_SLOT; }
  inline bool IsDebuggerStatement() const {
    return type_ == DEBUGGER_STATEMENT;
  }
82 83 84 85
  inline bool IsDebugBreakAtEntry() const {
    bool result = type_ == DEBUG_BREAK_AT_ENTRY;
    return result;
  }
86

87
  bool HasBreakPoint(Isolate* isolate, Handle<DebugInfo> debug_info) const;
88

89
  inline int position() const { return position_; }
90

91 92
  debug::BreakLocationType type() const;

93
  JSGeneratorObject GetGeneratorObjectForSuspendedFrame(
94 95
      JavaScriptFrame* frame) const;

96 97
 private:
  BreakLocation(Handle<AbstractCode> abstract_code, DebugBreakType type,
98
                int code_offset, int position, int generator_obj_reg_index)
99 100 101
      : abstract_code_(abstract_code),
        code_offset_(code_offset),
        type_(type),
102 103
        position_(position),
        generator_obj_reg_index_(generator_obj_reg_index) {
104 105
    DCHECK_NE(NOT_DEBUG_BREAK, type_);
  }
106

107 108 109 110 111 112
  BreakLocation(int position, DebugBreakType type)
      : code_offset_(0),
        type_(type),
        position_(position),
        generator_obj_reg_index_(0) {}

113 114 115
  static int BreakIndexFromCodeOffset(Handle<DebugInfo> debug_info,
                                      Handle<AbstractCode> abstract_code,
                                      int offset);
116

117 118 119 120 121 122 123
  void SetDebugBreak();
  void ClearDebugBreak();

  Handle<AbstractCode> abstract_code_;
  int code_offset_;
  DebugBreakType type_;
  int position_;
124
  int generator_obj_reg_index_;
125

126
  friend class BreakIterator;
127
};
128

129
class V8_EXPORT_PRIVATE BreakIterator {
130
 public:
131
  explicit BreakIterator(Handle<DebugInfo> debug_info);
132

133 134 135
  BreakLocation GetBreakLocation();
  bool Done() const { return source_position_iterator_.done(); }
  void Next();
136

137
  void SkipToPosition(int position);
138 139
  void SkipTo(int count) {
    while (count-- > 0) Next();
140
  }
141

142
  int code_offset() { return source_position_iterator_.code_offset(); }
143 144 145
  int break_index() const { return break_index_; }
  inline int position() const { return position_; }
  inline int statement_position() const { return statement_position_; }
146

147 148
  void ClearDebugBreak();
  void SetDebugBreak();
149

150
 private:
151
  int BreakIndexFromPosition(int position);
152

153
  Isolate* isolate();
154

155 156
  DebugBreakType GetDebugBreakType();

157 158 159 160 161
  Handle<DebugInfo> debug_info_;
  int break_index_;
  int position_;
  int statement_position_;
  SourcePositionTableIterator source_position_iterator_;
162
  DisallowHeapAllocation no_gc_;
163

164
  DISALLOW_COPY_AND_ASSIGN(BreakIterator);
165
};
166 167 168 169 170

// Linked list holding debug info objects. The debug info objects are kept as
// weak handles to avoid a debug info object to keep a function alive.
class DebugInfoListNode {
 public:
171
  DebugInfoListNode(Isolate* isolate, DebugInfo debug_info);
172
  ~DebugInfoListNode();
173 174 175

  DebugInfoListNode* next() { return next_; }
  void set_next(DebugInfoListNode* next) { next_ = next; }
dcarney's avatar
dcarney committed
176 177
  Handle<DebugInfo> debug_info() { return Handle<DebugInfo>(debug_info_); }

178 179
 private:
  // Global (weak) handle to the debug info object.
180
  Address* debug_info_;
181 182 183 184 185

  // Next pointer for linked list.
  DebugInfoListNode* next_;
};

186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
class DebugFeatureTracker {
 public:
  enum Feature {
    kActive = 1,
    kBreakPoint = 2,
    kStepping = 3,
    kHeapSnapshot = 4,
    kAllocationTracking = 5,
    kProfiler = 6,
    kLiveEdit = 7,
  };

  explicit DebugFeatureTracker(Isolate* isolate)
      : isolate_(isolate), bitfield_(0) {}
  void Track(Feature feature);

 private:
  Isolate* isolate_;
  uint32_t bitfield_;
};


208 209 210 211 212 213 214
// This class contains the debugger support. The main purpose is to handle
// setting break points in the code.
//
// This class controls the debug info for all functions which currently have
// active breakpoints in them. This debug info is held in the heap root object
// debug_info which is a FixedArray. Each entry in this list is of class
// DebugInfo.
215
class V8_EXPORT_PRIVATE Debug {
216
 public:
217
  // Debug event triggers.
218
  void OnDebugBreak(Handle<FixedArray> break_points_hit, StepAction stepAction);
219

220 221
  base::Optional<Object> OnThrow(Handle<Object> exception)
      V8_WARN_UNUSED_RESULT;
222
  void OnPromiseReject(Handle<Object> promise, Handle<Object> value);
223
  void OnCompileError(Handle<Script> script);
224
  void OnAfterCompile(Handle<Script> script);
225

226
  void HandleDebugBreak(IgnoreBreakMode ignore_break_mode);
227

228 229 230
  // The break target may not be the top-most frame, since we may be
  // breaking before entering a function that cannot contain break points.
  void Break(JavaScriptFrame* frame, Handle<JSFunction> break_target);
231

232 233 234 235
  // Scripts handling.
  Handle<FixedArray> GetLoadedScripts();

  // Break point handling.
236
  bool SetBreakpoint(Handle<SharedFunctionInfo> shared,
237 238
                     Handle<BreakPoint> break_point, int* source_position);
  void ClearBreakPoint(Handle<BreakPoint> break_point);
239 240
  void ChangeBreakOnException(ExceptionBreakType type, bool enable);
  bool IsBreakOnException(ExceptionBreakType type);
241

242 243
  void SetTerminateOnResume();

244 245
  bool SetBreakPointForScript(Handle<Script> script, Handle<String> condition,
                              int* source_position, int* id);
246
  bool SetBreakpointForFunction(Handle<SharedFunctionInfo> shared,
247
                                Handle<String> condition, int* id);
248
  void RemoveBreakpoint(int id);
249
  void RemoveBreakpointForWasmScript(Handle<Script> script, int id);
250

251 252
  void RecordWasmScriptWithBreakpoints(Handle<Script> script);

253 254
  // Find breakpoints from the debug info and the break location and check
  // whether they are hit. Return an empty handle if not, or a FixedArray with
255
  // hit BreakPoint objects.
256 257
  MaybeHandle<FixedArray> GetHitBreakPoints(Handle<DebugInfo> debug_info,
                                            int position);
258

259
  // Stepping handling.
260
  void PrepareStep(StepAction step_action);
261
  void PrepareStepIn(Handle<JSFunction> function);
262
  void PrepareStepInSuspendedGenerator();
263
  void PrepareStepOnThrow();
264
  void ClearStepping();
265

266 267 268
  void SetBreakOnNextFunctionCall();
  void ClearBreakOnNextFunctionCall();

269
  void DeoptimizeFunction(Handle<SharedFunctionInfo> shared);
270
  void PrepareFunctionForDebugExecution(Handle<SharedFunctionInfo> shared);
271
  void InstallDebugBreakTrampoline();
272
  bool GetPossibleBreakpoints(Handle<Script> script, int start_position,
273
                              int end_position, bool restrict_to_function,
274
                              std::vector<BreakLocation>* locations);
275

276
  bool IsBlackboxed(Handle<SharedFunctionInfo> shared);
277
  bool ShouldBeSkipped();
278

279 280
  bool CanBreakAtEntry(Handle<SharedFunctionInfo> shared);

281
  void SetDebugDelegate(debug::DebugDelegate* delegate);
282

283
  // Returns whether the operation succeeded.
284 285 286
  bool EnsureBreakInfo(Handle<SharedFunctionInfo> shared);
  void CreateBreakInfo(Handle<SharedFunctionInfo> shared);
  Handle<DebugInfo> GetOrCreateDebugInfo(Handle<SharedFunctionInfo> shared);
287

288 289 290 291
  void InstallCoverageInfo(Handle<SharedFunctionInfo> shared,
                           Handle<CoverageInfo> coverage_info);
  void RemoveAllCoverageInfos();

292
  // This function is used in FunctionNameUsing* tests.
293 294
  Handle<Object> FindSharedFunctionInfoInScript(Handle<Script> script,
                                                int position);
295

296
  static Handle<Object> GetSourceBreakLocations(
297
      Isolate* isolate, Handle<SharedFunctionInfo> shared);
298

299
  // Check whether this frame is just about to return.
300
  bool IsBreakAtReturn(JavaScriptFrame* frame);
301

302
  // Support for LiveEdit
303
  void ScheduleFrameRestart(StackFrame* frame);
304

305
  bool AllFramesOnStackAreBlackboxed();
306

307 308 309 310 311
  // Set new script source, throw an exception if error occurred. When preview
  // is true: try to set source, throw exception if any without actual script
  // change. stack_changed is true if after editing script on pause stack is
  // changed and client should request stack trace again.
  bool SetScriptSource(Handle<Script> script, Handle<String> source,
312
                       bool preview, debug::LiveEditResult* result);
313

314 315
  int GetFunctionDebuggingId(Handle<JSFunction> function);

316
  // Threading support.
317 318
  char* ArchiveDebug(char* to);
  char* RestoreDebug(char* from);
319
  static int ArchiveSpacePerThread();
320
  void FreeThreadResources() { }
321
  void Iterate(RootVisitor* v);
322
  void InitThread(const ExecutionAccess& lock) { ThreadInit(); }
323

Yang Guo's avatar
Yang Guo committed
324
  bool CheckExecutionState() { return is_active(); }
325

326 327 328 329 330 331
  void StartSideEffectCheckMode();
  void StopSideEffectCheckMode();

  void ApplySideEffectChecks(Handle<DebugInfo> debug_info);
  void ClearSideEffectChecks(Handle<DebugInfo> debug_info);

332 333
  bool PerformSideEffectCheck(Handle<JSFunction> function,
                              Handle<Object> receiver);
334 335 336 337 338

  enum AccessorKind { kNotAccessor, kGetter, kSetter };
  bool PerformSideEffectCheckForCallback(Handle<Object> callback_info,
                                         Handle<Object> receiver,
                                         AccessorKind accessor_kind);
339
  bool PerformSideEffectCheckAtBytecode(InterpretedFrame* frame);
340
  bool PerformSideEffectCheckForObject(Handle<Object> object);
341

342 343
  // Flags and states.
  inline bool is_active() const { return is_active_; }
344
  inline bool in_debug_scope() const {
345
    return !!base::Relaxed_Load(&thread_local_.current_debug_scope_);
346
  }
347 348 349 350
  inline bool needs_check_on_function_call() const {
    return hook_on_function_call_;
  }

351
  void set_break_points_active(bool v) { break_points_active_ = v; }
352
  bool break_points_active() const { return break_points_active_; }
353

354
  StackFrameId break_frame_id() { return thread_local_.break_frame_id_; }
355

356
  Handle<Object> return_value_handle();
357 358
  Object return_value() { return thread_local_.return_value_; }
  void set_return_value(Object value) { thread_local_.return_value_ = value; }
359

360
  // Support for embedding into generated code.
361 362 363 364
  Address is_active_address() {
    return reinterpret_cast<Address>(&is_active_);
  }

365 366 367 368
  Address hook_on_function_call_address() {
    return reinterpret_cast<Address>(&hook_on_function_call_);
  }

369 370 371 372
  Address suspended_generator_address() {
    return reinterpret_cast<Address>(&thread_local_.suspended_generator_);
  }

373 374 375
  Address restart_fp_address() {
    return reinterpret_cast<Address>(&thread_local_.restart_fp_);
  }
376 377 378
  bool will_restart() const {
    return thread_local_.restart_fp_ != kNullAddress;
  }
379

380
  StepAction last_step_action() { return thread_local_.last_step_action_; }
381 382 383
  bool break_on_next_function_call() const {
    return thread_local_.break_on_next_function_call_;
  }
384

385 386
  inline bool break_disabled() const { return break_disabled_; }

387 388
  DebugFeatureTracker* feature_tracker() { return &feature_tracker_; }

389 390 391 392
  // For functions in which we cannot set a break point, use a canonical
  // source position for break points.
  static const int kBreakAtEntryPosition = 0;

393 394
  void RemoveBreakInfoAndMaybeFree(Handle<DebugInfo> debug_info);

395
 private:
396
  explicit Debug(Isolate* isolate);
397
  ~Debug();
398

399
  void UpdateDebugInfosForExecutionMode();
400
  void UpdateState();
401
  void UpdateHookOnFunctionCall();
402 403
  void Unload();

404 405 406
  // Return the number of virtual frames below debugger entry.
  int CurrentFrameCount();

407
  inline bool ignore_events() const {
408 409
    return is_suppressed_ || !is_active_ ||
           isolate_->debug_execution_mode() == DebugInfo::kSideEffects;
410
  }
411

412
  void clear_suspended_generator() {
413
    thread_local_.suspended_generator_ = Smi::zero();
414 415 416
  }

  bool has_suspended_generator() const {
417
    return thread_local_.suspended_generator_ != Smi::zero();
418 419
  }

420
  bool IsExceptionBlackboxed(bool uncaught);
421

422 423
  void OnException(Handle<Object> exception, Handle<Object> promise,
                   v8::debug::ExceptionType exception_type);
424

425
  void ProcessCompileEvent(bool has_compile_error, Handle<Script> script);
426

427
  // Find the closest source position for a break point for a given position.
428
  int FindBreakablePosition(Handle<DebugInfo> debug_info, int source_position);
429 430 431 432 433 434 435
  // Instrument code to break at break points.
  void ApplyBreakPoints(Handle<DebugInfo> debug_info);
  // Clear code from instrumentation.
  void ClearBreakPoints(Handle<DebugInfo> debug_info);
  // Clear all code from instrumentation.
  void ClearAllBreakPoints();
  // Instrument a function with one-shots.
436 437
  void FloodWithOneShot(Handle<SharedFunctionInfo> function,
                        bool returns_only = false);
438
  // Clear all one-shot instrumentations, but restore break points.
439
  void ClearOneShot();
440

441 442
  bool IsFrameBlackboxed(JavaScriptFrame* frame);

443
  void ActivateStepOut(StackFrame* frame);
444 445 446
  MaybeHandle<FixedArray> CheckBreakPoints(Handle<DebugInfo> debug_info,
                                           BreakLocation* location,
                                           bool* has_break_points = nullptr);
447
  bool IsMutedAtCurrentLocation(JavaScriptFrame* frame);
448 449 450
  // Check whether a BreakPoint object is hit. Evaluate condition depending
  // on whether this is a regular break location or a break at function entry.
  bool CheckBreakPoint(Handle<BreakPoint> break_point, bool is_break_at_entry);
451

452
  inline void AssertDebugContext() {
453
    DCHECK(in_debug_scope());
454 455
  }

456
  void ThreadInit();
457

458 459
  void PrintBreakLocation();

460 461
  void ClearAllDebuggerHints();

462
  // Wraps logic for clearing and maybe freeing all debug infos.
463
  using DebugInfoClearFunction = std::function<void(Handle<DebugInfo>)>;
464
  void ClearAllDebugInfos(const DebugInfoClearFunction& clear_function);
465

466 467 468 469
  void FindDebugInfo(Handle<DebugInfo> debug_info, DebugInfoListNode** prev,
                     DebugInfoListNode** curr);
  void FreeDebugInfoListNode(DebugInfoListNode* prev, DebugInfoListNode* node);

470
  debug::DebugDelegate* debug_delegate_ = nullptr;
471

472
  // Debugger is active, i.e. there is a debug event listener attached.
473
  bool is_active_;
474 475 476 477
  // Debugger needs to be notified on every new function call.
  // Used for stepping and read-only checks
  bool hook_on_function_call_;
  // Suppress debug events.
478
  bool is_suppressed_;
479 480
  // Running liveedit.
  bool running_live_edit_ = false;
481
  // Do not trigger debug break events.
482
  bool break_disabled_;
483
  // Do not break on break points.
484
  bool break_points_active_;
485
  // Trigger debug break events for all exceptions.
486
  bool break_on_exception_;
487
  // Trigger debug break events for uncaught exceptions.
488
  bool break_on_uncaught_exception_;
489 490
  // Termination exception because side effect check has failed.
  bool side_effect_check_failed_;
491

492 493
  // List of active debug info objects.
  DebugInfoListNode* debug_info_list_;
494

495 496 497 498
  // Used for side effect check to mark temporary objects.
  class TemporaryObjectsTracker;
  std::unique_ptr<TemporaryObjectsTracker> temporary_objects_;

499 500
  Handle<RegExpMatchInfo> regexp_match_info_;

501 502 503
  // Used to collect histogram data on debugger feature usage.
  DebugFeatureTracker feature_tracker_;

504
  // Per-thread data.
505 506
  class ThreadLocal {
   public:
507
    // Top debugger entry.
508
    base::AtomicWord current_debug_scope_;
509

510
    // Frame id for the frame of the current break.
511
    StackFrameId break_frame_id_;
512

513 514 515
    // Step action for last step performed.
    StepAction last_step_action_;

516 517
    // If set, next PrepareStepIn will ignore this function until stepped into
    // another function, at which point this will be cleared.
518
    Object ignore_step_into_function_;
519 520 521 522

    // If set then we need to repeat StepOut action at return.
    bool fast_forward_to_return_;

523 524 525
    // Source statement position from last step next action.
    int last_statement_position_;

526
    // Frame pointer from last step next or step frame action.
527
    int last_frame_count_;
528

529
    // Frame pointer of the target frame we want to arrive at.
530
    int target_frame_count_;
531

532
    // Value of the accumulator at the point of entering the debugger.
533
    Object return_value_;
534

535
    // The suspended generator object to track when stepping.
536
    Object suspended_generator_;
537

538 539 540
    // The new frame pointer to drop to when restarting a frame.
    Address restart_fp_;

541 542
    // Last used inspector breakpoint id.
    int last_breakpoint_id_;
543 544 545 546

    // This flag is true when SetBreakOnNextFunctionCall is called and it forces
    // debugger to break on next function call.
    bool break_on_next_function_call_;
547 548 549
  };

  // Storage location for registers when handling debug break calls
550
  ThreadLocal thread_local_;
551

552 553 554
  // This is a global handle, lazily initialized.
  Handle<WeakArrayList> wasm_scripts_with_breakpoints_;

555 556 557
  Isolate* isolate_;

  friend class Isolate;
558
  friend class DebugScope;
559
  friend class DisableBreak;
560
  friend class LiveEdit;
561
  friend class SuppressDebug;
562

563
  friend Handle<FixedArray> GetDebuggedFunctions();  // In test-debug.cc
564
  friend void CheckDebuggerUnloaded();               // In test-debug.cc
565

566
  DISALLOW_COPY_AND_ASSIGN(Debug);
567 568
};

569 570
// This scope is used to load and enter the debug context and create a new
// break state.  Leaving the scope will restore the previous state.
571
class DebugScope {
572
 public:
573 574
  explicit DebugScope(Debug* debug);
  ~DebugScope();
575

576 577
  void set_terminate_on_resume();

578
 private:
579 580 581 582
  Isolate* isolate() { return debug_->isolate_; }

  Debug* debug_;
  DebugScope* prev_;               // Previous scope if entered recursively.
583
  StackFrameId break_frame_id_;    // Previous break frame id.
584
  PostponeInterruptsScope no_interrupts_;
585 586
  // This is used as a boolean.
  bool terminate_on_resume_ = false;
587 588
};

589 590 591 592 593 594 595 596 597 598 599 600 601
// This scope is used to handle return values in nested debug break points.
// When there are nested debug breaks, we use this to restore the return
// value to the previous state. This is not merged with DebugScope because
// return_value_ will not be cleared when we use DebugScope.
class ReturnValueScope {
 public:
  explicit ReturnValueScope(Debug* debug);
  ~ReturnValueScope();

 private:
  Debug* debug_;
  Handle<Object> return_value_;  // Previous result.
};
602

603
// Stack allocated class for disabling break.
604
class DisableBreak {
605
 public:
606
  explicit DisableBreak(Debug* debug, bool disable = true)
607
      : debug_(debug), previous_break_disabled_(debug->break_disabled_) {
608
    debug_->break_disabled_ = disable;
609 610 611
  }
  ~DisableBreak() {
    debug_->break_disabled_ = previous_break_disabled_;
612
  }
613 614 615

 private:
  Debug* debug_;
616
  bool previous_break_disabled_;
617 618 619
  DISALLOW_COPY_AND_ASSIGN(DisableBreak);
};

620
class SuppressDebug {
621 622 623 624
 public:
  explicit SuppressDebug(Debug* debug)
      : debug_(debug), old_state_(debug->is_suppressed_) {
    debug_->is_suppressed_ = true;
625
  }
626
  ~SuppressDebug() { debug_->is_suppressed_ = old_state_; }
627 628

 private:
629 630 631
  Debug* debug_;
  bool old_state_;
  DISALLOW_COPY_AND_ASSIGN(SuppressDebug);
632 633
};

634 635 636
// Code generator routines.
class DebugCodegen : public AllStatic {
 public:
637 638 639
  enum DebugBreakCallHelperMode {
    SAVE_RESULT_REGISTER,
    IGNORE_RESULT_REGISTER
640 641
  };

642 643
  // Builtin to drop frames to restart function.
  static void GenerateFrameDropperTrampoline(MacroAssembler* masm);
644

645 646 647
  // Builtin to atomically (wrt deopts) handle debugger statement and
  // drop frames to restart function if necessary.
  static void GenerateHandleDebuggerStatement(MacroAssembler* masm);
648 649 650

  // Builtin to trigger a debug break before entering the function.
  static void GenerateDebugBreakTrampoline(MacroAssembler* masm);
651 652
};

653

654 655
}  // namespace internal
}  // namespace v8
656

657
#endif  // V8_DEBUG_DEBUG_H_