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

Unified Diff: runtime/vm/ast.h

Issue 10354019: Removing all incr-op nodes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | runtime/vm/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.h
===================================================================
--- runtime/vm/ast.h (revision 7300)
+++ runtime/vm/ast.h (working copy)
@@ -24,8 +24,6 @@
V(StringConcatNode, "concat") \
V(ComparisonNode, "compare") \
V(UnaryOpNode, "unaryop") \
- V(IncrOpInstanceFieldNode, "incr instance field") \
- V(IncrOpIndexedNode, "incr indexed") \
V(ConditionalExprNode, "?:") \
V(IfNode, "if") \
V(SwitchNode, "switch") \
@@ -154,14 +152,6 @@
return NULL;
}
- // Creates a an IncrOpXXXNode that corresponds to this node type, e.g.,
- // LoadLocalNode creates the appropriate IncrOpLocalNode
- virtual AstNode* MakeIncrOpNode(intptr_t token_index,
- Token::Kind kind,
- bool is_prefix) {
- return NULL;
- }
-
// Analyzes an expression to determine whether it is a compile time
// constant or not. Returns NULL if the expression is not a compile time
// constant. Otherwise, the return value is an approximation of the
@@ -661,169 +651,6 @@
};
-class IncrOpInstanceFieldNode : public AstNode {
- public:
- IncrOpInstanceFieldNode(intptr_t token_index,
- Token::Kind kind,
- bool prefix,
- AstNode* receiver,
- const String& field_name)
- : AstNode(token_index),
- kind_(kind),
- prefix_(prefix),
- receiver_(receiver),
- field_name_(field_name),
- operator_id_(AstNode::GetNextId()),
- setter_id_(AstNode::GetNextId()),
- operator_ic_data_(ICData::ZoneHandle()),
- setter_ic_data_(ICData::ZoneHandle()) {
- ASSERT(receiver_ != NULL);
- ASSERT(field_name_.IsZoneHandle());
- ASSERT(kind_ == Token::kINCR || kind_ == Token::kDECR);
- }
-
- Token::Kind kind() const { return kind_; }
- bool prefix() const { return prefix_; }
- AstNode* receiver() const { return receiver_; }
- const String& field_name() const { return field_name_; }
-
- intptr_t getter_id() const { return id(); }
- intptr_t operator_id() const { return operator_id_; }
- intptr_t setter_id() const { return setter_id_; }
-
- virtual bool HasId(intptr_t value) const {
- return (getter_id() == value) ||
- (operator_id() == value) ||
- (setter_id() == value);
- }
-
- virtual void SetIcDataAtId(intptr_t node_id, const ICData& value) {
- ASSERT(HasId(node_id));
- if (node_id == getter_id()) {
- set_ic_data(value);
- } else if (node_id == operator_id()) {
- operator_ic_data_ = value.raw();
- } else {
- ASSERT(node_id == setter_id());
- setter_ic_data_ = value.raw();
- }
- }
-
- virtual const ICData& ICDataAtId(intptr_t node_id) const {
- ASSERT(HasId(node_id));
- if (node_id == getter_id()) {
- return ic_data();
- } else if (node_id == operator_id()) {
- return operator_ic_data_;
- } else {
- ASSERT(node_id == setter_id());
- return setter_ic_data_;
- }
- }
-
- virtual void VisitChildren(AstNodeVisitor* visitor) const {
- receiver()->Visit(visitor);
- }
-
- virtual const char* Name() const;
-
- DECLARE_COMMON_NODE_FUNCTIONS(IncrOpInstanceFieldNode);
-
- private:
- const Token::Kind kind_;
- const bool prefix_;
- AstNode* receiver_;
- const String& field_name_;
- const intptr_t operator_id_;
- const intptr_t setter_id_;
- ICData& operator_ic_data_;
- ICData& setter_ic_data_;
-
- DISALLOW_IMPLICIT_CONSTRUCTORS(IncrOpInstanceFieldNode);
-};
-
-
-class IncrOpIndexedNode : public AstNode {
- public:
- IncrOpIndexedNode(intptr_t token_index,
- Token::Kind kind,
- bool prefix,
- AstNode* array,
- AstNode* index)
- : AstNode(token_index),
- kind_(kind),
- prefix_(prefix),
- array_(array),
- index_(index),
- operator_id_(AstNode::GetNextId()),
- store_id_(AstNode::GetNextId()),
- operator_ic_data_(ICData::ZoneHandle()),
- store_ic_data_(ICData::ZoneHandle()) {
- ASSERT(kind_ == Token::kINCR || kind_ == Token::kDECR);
- ASSERT(array_ != NULL);
- ASSERT(index_ != NULL);
- }
-
- Token::Kind kind() const { return kind_; }
- bool prefix() const { return prefix_; }
- AstNode* array() const { return array_; }
- AstNode* index() const { return index_; }
-
- intptr_t load_id() const { return id(); }
- intptr_t operator_id() const { return operator_id_; }
- intptr_t store_id() const { return store_id_; }
-
- virtual bool HasId(intptr_t value) const {
- return (load_id() == value) ||
- (operator_id() == value) ||
- (store_id() == value);
- }
-
- virtual const ICData& ICDataAtId(intptr_t node_id) const {
- ASSERT(HasId(node_id));
- if (node_id == load_id()) {
- return ic_data();
- } else if (node_id == operator_id()) {
- return operator_ic_data_;
- } else {
- ASSERT(node_id == store_id());
- return store_ic_data_;
- }
- }
-
- virtual void SetIcDataAtId(intptr_t node_id, const ICData& value) {
- ASSERT(HasId(node_id));
- if (node_id == load_id()) {
- set_ic_data(value);
- } else if (node_id == operator_id()) {
- operator_ic_data_ = value.raw();
- } else {
- ASSERT(node_id == store_id());
- store_ic_data_ = value.raw();
- }
- }
-
- virtual void VisitChildren(AstNodeVisitor* visitor) const {
- array()->Visit(visitor);
- index()->Visit(visitor);
- }
-
- virtual const char* Name() const;
-
- DECLARE_COMMON_NODE_FUNCTIONS(IncrOpIndexedNode);
-
- private:
- const Token::Kind kind_;
- const bool prefix_;
- AstNode* array_;
- AstNode* index_;
- const intptr_t operator_id_;
- const intptr_t store_id_;
- ICData& operator_ic_data_;
- ICData& store_ic_data_;
-};
-
-
class ConditionalExprNode : public AstNode {
public:
ConditionalExprNode(intptr_t token_index,
@@ -1154,10 +981,6 @@
virtual AstNode* MakeAssignmentNode(AstNode* rhs);
- virtual AstNode* MakeIncrOpNode(intptr_t token_index,
- Token::Kind kind,
- bool is_prefix);
-
DECLARE_COMMON_NODE_FUNCTIONS(LoadLocalNode);
private:
@@ -1270,10 +1093,6 @@
virtual AstNode* MakeAssignmentNode(AstNode* rhs);
- virtual AstNode* MakeIncrOpNode(intptr_t token_index,
- Token::Kind kind,
- bool is_prefix);
-
virtual const Instance* EvalConstExpr() const {
ASSERT(field_.is_static());
return field_.is_final() ? &Instance::ZoneHandle(field_.value()) : NULL;
@@ -1331,10 +1150,6 @@
virtual AstNode* MakeAssignmentNode(AstNode* rhs);
- virtual AstNode* MakeIncrOpNode(intptr_t token_index,
- Token::Kind kind,
- bool is_prefix);
-
DECLARE_COMMON_NODE_FUNCTIONS(LoadIndexedNode);
private:
@@ -1432,10 +1247,6 @@
virtual AstNode* MakeAssignmentNode(AstNode* rhs);
- virtual AstNode* MakeIncrOpNode(intptr_t token_index,
- Token::Kind kind,
- bool is_prefix);
-
DECLARE_COMMON_NODE_FUNCTIONS(InstanceGetterNode);
private:
@@ -1502,10 +1313,6 @@
virtual AstNode* MakeAssignmentNode(AstNode* rhs);
- virtual AstNode* MakeIncrOpNode(intptr_t token_index,
- Token::Kind kind,
- bool is_prefix);
-
virtual const Instance* EvalConstExpr() const;
DECLARE_COMMON_NODE_FUNCTIONS(StaticGetterNode);
« no previous file with comments | « no previous file | runtime/vm/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698