Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2357)

Unified Diff: src/full-codegen.h

Issue 1218493005: Debugger: use debug break slots instead of ICs (except for calls). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug.cc ('k') | src/full-codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen.h
diff --git a/src/full-codegen.h b/src/full-codegen.h
index ac74407e3f71fc80910eb8c30ae5c4dfb6884be1..a2d23f069dafe1b8f1a3834a1d22cac71e307369 100644
--- a/src/full-codegen.h
+++ b/src/full-codegen.h
@@ -24,35 +24,6 @@ namespace internal {
// Forward declarations.
class JumpPatchSite;
-// AST node visitor which can tell whether a given statement will be breakable
-// when the code is compiled by the full compiler in the debugger. This means
-// that there will be an IC (load/store/call) in the code generated for the
-// debugger to piggybag on.
-class BreakableStatementChecker: public AstVisitor {
- public:
- BreakableStatementChecker(Isolate* isolate, Zone* zone)
- : is_breakable_(false) {
- InitializeAstVisitor(isolate, zone);
- }
-
- void Check(Statement* stmt);
- void Check(Expression* stmt);
-
- bool is_breakable() { return is_breakable_; }
-
- private:
- // AST node visit functions.
-#define DECLARE_VISIT(type) virtual void Visit##type(type* node) override;
- AST_NODE_LIST(DECLARE_VISIT)
-#undef DECLARE_VISIT
-
- bool is_breakable_;
-
- DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
- DISALLOW_COPY_AND_ASSIGN(BreakableStatementChecker);
-};
-
-
// -----------------------------------------------------------------------------
// Full code generator.
@@ -688,9 +659,21 @@ class FullCodeGenerator: public AstVisitor {
void SetFunctionPosition(FunctionLiteral* fun);
void SetReturnPosition(FunctionLiteral* fun);
- void SetStatementPosition(Statement* stmt);
- void SetExpressionPosition(Expression* expr);
- void SetSourcePosition(int pos);
+
+ enum InsertBreak { INSERT_BREAK, SKIP_BREAK };
+
+ // During stepping we want to be able to break at each statement, but not at
+ // every (sub-)expression. That is why by default we insert breaks at every
+ // statement position, but not at every expression position, unless stated
+ // otherwise.
+ void SetStatementPosition(Statement* stmt,
+ InsertBreak insert_break = INSERT_BREAK);
+ void SetExpressionPosition(Expression* expr,
+ InsertBreak insert_break = SKIP_BREAK);
+
+ // Consider an expression a statement. As such, we also insert a break.
+ // This is used in loop headers where we want to break for each iteration.
+ void SetExpressionAsStatementPosition(Expression* expr);
// Non-local control flow support.
void EnterTryBlock(int handler_index, Label* handler);
« no previous file with comments | « src/debug.cc ('k') | src/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698