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

Side by Side Diff: runtime/vm/parser.cc

Issue 9373025: Optimizing code generator expects that every AST node is traversed once, i.e., the nodes are not ... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/parser.h" 5 #include "vm/parser.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/compiler_stats.h" 10 #include "vm/compiler_stats.h"
(...skipping 5458 matching lines...) Expand 10 before | Expand all | Expand 10 after
5469 if (node->IsLoadIndexedNode()) { 5469 if (node->IsLoadIndexedNode()) {
5470 LoadIndexedNode* load_indexed = node->AsLoadIndexedNode(); 5470 LoadIndexedNode* load_indexed = node->AsLoadIndexedNode();
5471 intptr_t token_id = node->id(); 5471 intptr_t token_id = node->id();
5472 intptr_t token_index = node->token_index(); 5472 intptr_t token_index = node->token_index();
5473 node = NULL; // Do not use it. 5473 node = NULL; // Do not use it.
5474 // The array object access may not have side effects. 5474 // The array object access may not have side effects.
5475 // First, evaluate the array object expression if it might have side 5475 // First, evaluate the array object expression if it might have side
5476 // effects. 5476 // effects.
5477 if (!IsLocalOrLiteralNode(load_indexed->array())) { 5477 if (!IsLocalOrLiteralNode(load_indexed->array())) {
5478 LocalVariable* temp = 5478 LocalVariable* temp =
5479 CreateTempConstVariable(token_index, token_id, "lia"); 5479 CreateTempConstVariable(token_index, token_id, "lia");
5480 AstNode* save = 5480 AstNode* save =
5481 new StoreLocalNode(token_index, *temp, load_indexed->array()); 5481 new StoreLocalNode(token_index, *temp, load_indexed->array());
5482 current_block_->statements->Add(save); 5482 current_block_->statements->Add(save);
5483 AstNode* load = new LoadLocalNode(token_index, *temp); 5483 AstNode* load = new LoadLocalNode(token_index, *temp);
5484 load_indexed = new LoadIndexedNode(token_index, 5484 load_indexed = new LoadIndexedNode(token_index,
5485 load, 5485 load,
5486 load_indexed->index_expr()); 5486 load_indexed->index_expr());
5487 } 5487 }
5488 // Second, evaluate the index expression and store in a temporary 5488 // Second, evaluate the index expression and store in a temporary
5489 // variable if it might have side effects. 5489 // variable if it might have side effects.
5490 if (!IsLocalOrLiteralNode(load_indexed->index_expr())) { 5490 if (!IsLocalOrLiteralNode(load_indexed->index_expr())) {
5491 LocalVariable* temp = 5491 LocalVariable* temp =
(...skipping 2268 matching lines...) Expand 10 before | Expand all | Expand 10 after
7760 void Parser::SkipQualIdent() { 7760 void Parser::SkipQualIdent() {
7761 ASSERT(IsIdentifier()); 7761 ASSERT(IsIdentifier());
7762 ConsumeToken(); 7762 ConsumeToken();
7763 if (CurrentToken() == Token::kPERIOD) { 7763 if (CurrentToken() == Token::kPERIOD) {
7764 ConsumeToken(); // Consume the kPERIOD token. 7764 ConsumeToken(); // Consume the kPERIOD token.
7765 ExpectIdentifier("identifier expected after '.'"); 7765 ExpectIdentifier("identifier expected after '.'");
7766 } 7766 }
7767 } 7767 }
7768 7768
7769 } // namespace dart 7769 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698