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

Unified Diff: src/full-codegen.h

Issue 7792100: Simplfy handling of exits from scoped blocks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 4 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 | « no previous file | src/full-codegen.cc » ('j') | src/parser.cc » ('J')
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 28be00855ec28a8053c2356d512abd4f7f26478b..0e70eb79ef87b7e71570922fc4550c4a5ddfac6a 100644
--- a/src/full-codegen.h
+++ b/src/full-codegen.h
@@ -191,6 +191,24 @@ class FullCodeGenerator: public AstVisitor {
Label continue_label_;
};
+ // A nested block statement.
+ class NestedBlock : public Breakable {
+ public:
+ explicit NestedBlock(FullCodeGenerator* codegen, Block* block)
Kevin Millikin (Chromium) 2011/09/02 15:17:44 No need for explicit for two argument constructors
Steven 2011/09/05 08:54:50 Done.
+ : Breakable(codegen, block), block_(block) {
+ }
+ virtual ~NestedBlock() {}
+
+ virtual NestedStatement* Exit(int* stack_depth, int* context_length) {
+ if (block_->block_scope() != NULL) {
+ ++(*context_length);
+ }
+ return previous_;
+ };
+ private:
+ Block* block_;
Kevin Millikin (Chromium) 2011/09/02 15:17:44 This class doesn't need to store the block since t
Steven 2011/09/05 08:54:50 Done.
+ };
+
// The try block of a try/catch statement.
class TryCatch : public NestedStatement {
public:
« no previous file with comments | « no previous file | src/full-codegen.cc » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698