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

Unified Diff: src/ast.h

Issue 7134014: Stop using with explicitly to implement try/catch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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/ast.cc » ('j') | src/parser.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 6c9ac8bcc05595a3f0c5721f4b1ef5799b9b0e52..7ed3579edd74f2660b1be4b89c0bf40ad1bc636c 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -80,7 +80,6 @@ namespace internal {
V(RegExpLiteral) \
V(ObjectLiteral) \
V(ArrayLiteral) \
- V(CatchExtensionObject) \
V(Assignment) \
V(Throw) \
V(Property) \
@@ -614,19 +613,17 @@ class ReturnStatement: public Statement {
class WithEnterStatement: public Statement {
public:
- explicit WithEnterStatement(Expression* expression, bool is_catch_block)
- : expression_(expression), is_catch_block_(is_catch_block) { }
+ explicit WithEnterStatement(Expression* expression)
+ : expression_(expression) { }
DECLARE_NODE_TYPE(WithEnterStatement)
Expression* expression() const { return expression_; }
- bool is_catch_block() const { return is_catch_block_; }
virtual bool IsInlineable() const;
private:
Expression* expression_;
- bool is_catch_block_;
};
@@ -743,9 +740,7 @@ class IfStatement: public Statement {
// stack in the compiler; this should probably be reworked.
class TargetCollector: public AstNode {
public:
- explicit TargetCollector(ZoneList<Label*>* targets)
- : targets_(targets) {
- }
+ TargetCollector(): targets_(0) { }
// Adds a jump target to the collector. The collector stores a pointer not
// a copy of the target to make binding work, so make sure not to pass in
@@ -756,11 +751,11 @@ class TargetCollector: public AstNode {
virtual void Accept(AstVisitor* v) { UNREACHABLE(); }
virtual TargetCollector* AsTargetCollector() { return this; }
- ZoneList<Label*>* targets() { return targets_; }
+ ZoneList<Label*>* targets() { return &targets_; }
virtual bool IsInlineable() const;
private:
- ZoneList<Label*>* targets_;
+ ZoneList<Label*> targets_;
};
@@ -785,22 +780,20 @@ class TryStatement: public Statement {
class TryCatchStatement: public TryStatement {
public:
- TryCatchStatement(Block* try_block,
- VariableProxy* catch_var,
- Block* catch_block)
+ TryCatchStatement(Block* try_block, Handle<String> name, Block* catch_block)
: TryStatement(try_block),
- catch_var_(catch_var),
+ name_(name),
catch_block_(catch_block) {
}
DECLARE_NODE_TYPE(TryCatchStatement)
- VariableProxy* catch_var() const { return catch_var_; }
Block* catch_block() const { return catch_block_; }
+ Handle<String> name() const { return name_; }
virtual bool IsInlineable() const;
private:
- VariableProxy* catch_var_;
+ Handle<String> name_;
Block* catch_block_;
};
@@ -1040,27 +1033,6 @@ class ArrayLiteral: public MaterializedLiteral {
};
-// Node for constructing a context extension object for a catch block.
-// The catch context extension object has one property, the catch
-// variable, which should be DontDelete.
-class CatchExtensionObject: public Expression {
- public:
- CatchExtensionObject(Literal* key, VariableProxy* value)
- : key_(key), value_(value) {
- }
-
- DECLARE_NODE_TYPE(CatchExtensionObject)
-
- Literal* key() const { return key_; }
- VariableProxy* value() const { return value_; }
- virtual bool IsInlineable() const;
-
- private:
- Literal* key_;
- VariableProxy* value_;
-};
-
-
class VariableProxy: public Expression {
public:
explicit VariableProxy(Variable* var);
« no previous file with comments | « no previous file | src/ast.cc » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698