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

Unified Diff: src/jump-target.h

Issue 397010: A start on allowing non-local control flow, for exceptions, try-finally, and ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 1 month 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/fast-codegen.h ('k') | src/x64/fast-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/jump-target.h
===================================================================
--- src/jump-target.h (revision 3310)
+++ src/jump-target.h (working copy)
@@ -184,7 +184,15 @@
// and will drop state from nested statements as part of merging.
//
// Break targets are used for return, break, and continue targets.
+//
+// The fast compiler needs a similar object, containing a Label and
+// the stack height. Since the parser already creates break targets
+// at all the appropriate sites, and creates the necessary links from
+// the AST to the break targets, we add an interface to break targets that
+// simply exposes the stack height and their underlying label, for use
+// in the fast compiler.
+
class BreakTarget : public JumpTarget {
public:
// Construct a break target.
@@ -222,6 +230,9 @@
// Setter for expected height.
void set_expected_height(int expected) { expected_height_ = expected; }
+ // Added interface for the fast compiler:
+ int expected_height() { return expected_height_; }
+ // Label* entry_label() is already declared public in JumpTarget.
private:
// The expected height of the expression stack where the target will
// be bound, statically known at initialization time.
« no previous file with comments | « src/fast-codegen.h ('k') | src/x64/fast-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698