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

Side by Side Diff: src/ast.cc

Issue 23441018: Make VisitStatements() consistent among all AstVisitor implementations (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 701
702 void AstVisitor::VisitDeclarations(ZoneList<Declaration*>* declarations) { 702 void AstVisitor::VisitDeclarations(ZoneList<Declaration*>* declarations) {
703 for (int i = 0; i < declarations->length(); i++) { 703 for (int i = 0; i < declarations->length(); i++) {
704 Visit(declarations->at(i)); 704 Visit(declarations->at(i));
705 } 705 }
706 } 706 }
707 707
708 708
709 void AstVisitor::VisitStatements(ZoneList<Statement*>* statements) { 709 void AstVisitor::VisitStatements(ZoneList<Statement*>* statements) {
710 for (int i = 0; i < statements->length(); i++) { 710 for (int i = 0; i < statements->length(); i++) {
711 Visit(statements->at(i)); 711 Statement* stmt = statements->at(i);
712 Visit(stmt);
713 if (stmt->IsJump()) break;
712 } 714 }
713 } 715 }
714 716
715 717
716 void AstVisitor::VisitExpressions(ZoneList<Expression*>* expressions) { 718 void AstVisitor::VisitExpressions(ZoneList<Expression*>* expressions) {
717 for (int i = 0; i < expressions->length(); i++) { 719 for (int i = 0; i < expressions->length(); i++) {
718 // The variable statement visiting code may pass NULL expressions 720 // The variable statement visiting code may pass NULL expressions
719 // to this code. Maybe this should be handled by introducing an 721 // to this code. Maybe this should be handled by introducing an
720 // undefined expression or literal? Revisit this code if this 722 // undefined expression or literal? Revisit this code if this
721 // changes 723 // changes
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value()); 1193 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value());
1192 str = arr; 1194 str = arr;
1193 } else { 1195 } else {
1194 str = DoubleToCString(value_->Number(), buffer); 1196 str = DoubleToCString(value_->Number(), buffer);
1195 } 1197 }
1196 return factory->NewStringFromAscii(CStrVector(str)); 1198 return factory->NewStringFromAscii(CStrVector(str));
1197 } 1199 }
1198 1200
1199 1201
1200 } } // namespace v8::internal 1202 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698