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

Unified Diff: runtime/vm/ast.cc

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 | « runtime/vm/ast.h ('k') | runtime/vm/ast_printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.cc
===================================================================
--- runtime/vm/ast.cc (revision 7300)
+++ runtime/vm/ast.cc (working copy)
@@ -298,37 +298,11 @@
}
-const char* IncrOpInstanceFieldNode::Name() const {
- switch (kind_) {
- case Token::kINCR:
- return prefix_ ? "instance_field_pre_++" : "instance_field_post_++";
- case Token::kDECR:
- return prefix_ ? "instance_field_pre_--" : "instance_field_post_--";
- default:
- UNREACHABLE();
- return NULL;
- }
-}
-
-
const char* JumpNode::Name() const {
return Token::Str(kind_);
}
-const char* IncrOpIndexedNode::Name() const {
- switch (kind_) {
- case Token::kINCR:
- return prefix_ ? "indexed_pre_++" : "indexed_post_++";
- case Token::kDECR:
- return prefix_ ? "indexed_pre_--" : "indexed_post_--";
- default:
- UNREACHABLE();
- return NULL;
- }
-}
-
-
AstNode* LoadLocalNode::MakeAssignmentNode(AstNode* rhs) {
if (local().is_final()) {
return NULL;
@@ -340,71 +314,21 @@
}
-AstNode* LoadLocalNode::MakeIncrOpNode(intptr_t token_index,
- Token::Kind kind,
- bool is_prefix) {
- if (local().is_final()) {
- return NULL;
- }
- if (is_prefix) {
- const Instance& literal = Instance::ZoneHandle(Smi::New(1));
- AstNode* lhs = this;
- LiteralNode* rhs = new LiteralNode(token_index, literal);
- Token::Kind binop_kind = (kind == Token::kINCR) ? Token::kADD : Token::kSUB;
- BinaryOpNode* result = new BinaryOpNode(token_index, binop_kind, lhs, rhs);
- StoreLocalNode* store = new StoreLocalNode(token_index, local(), result);
- return store;
- }
- UNIMPLEMENTED();
- return NULL;
-}
-
-
AstNode* LoadStaticFieldNode::MakeAssignmentNode(AstNode* rhs) {
return new StoreStaticFieldNode(token_index(), field(), rhs);
}
-AstNode* LoadStaticFieldNode::MakeIncrOpNode(intptr_t token_index,
- Token::Kind kind,
- bool is_prefix) {
- UNIMPLEMENTED();
- return NULL;
-}
-
-
AstNode* InstanceGetterNode::MakeAssignmentNode(AstNode* rhs) {
return new InstanceSetterNode(token_index(), receiver(), field_name(), rhs);
}
-AstNode* InstanceGetterNode::MakeIncrOpNode(intptr_t token_index,
- Token::Kind kind,
- bool is_prefix) {
- return new IncrOpInstanceFieldNode(token_index,
- kind,
- is_prefix,
- receiver(),
- field_name());
-}
-
-
AstNode* LoadIndexedNode::MakeAssignmentNode(AstNode* rhs) {
return new StoreIndexedNode(token_index(), array(), index_expr(), rhs);
}
-AstNode* LoadIndexedNode::MakeIncrOpNode(intptr_t token_index,
- Token::Kind kind,
- bool is_prefix) {
- return new IncrOpIndexedNode(token_index,
- kind,
- is_prefix,
- array(),
- index_expr());
-}
-
-
AstNode* StaticGetterNode::MakeAssignmentNode(AstNode* rhs) {
// If no setter exist, set the field directly.
const String& setter_name = String::Handle(Field::SetterName(field_name()));
@@ -431,14 +355,6 @@
}
-AstNode* StaticGetterNode::MakeIncrOpNode(intptr_t token_index,
- Token::Kind kind,
- bool is_prefix) {
- UNIMPLEMENTED();
- return NULL;
-}
-
-
const Instance* StaticGetterNode::EvalConstExpr() const {
const String& getter_name =
String::Handle(Field::GetterName(this->field_name()));
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/ast_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698