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

Side by Side Diff: src/ast.cc

Issue 8961: Merge change list off bleeding_edge into toiger branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 12 years, 1 month 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 | « src/ast.h ('k') | src/codegen.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 140
141 141
142 ObjectLiteral::Property::Property(bool is_getter, FunctionLiteral* value) { 142 ObjectLiteral::Property::Property(bool is_getter, FunctionLiteral* value) {
143 key_ = new Literal(value->name()); 143 key_ = new Literal(value->name());
144 value_ = value; 144 value_ = value;
145 kind_ = is_getter ? GETTER : SETTER; 145 kind_ = is_getter ? GETTER : SETTER;
146 } 146 }
147 147
148 148
149 void LabelCollector::AddLabel(Label* label) { 149 void TargetCollector::AddTarget(JumpTarget* target) {
150 // Add the label to the collector, but discard duplicates. 150 // Add the label to the collector, but discard duplicates.
151 int length = labels_->length(); 151 int length = targets_->length();
152 for (int i = 0; i < length; i++) { 152 for (int i = 0; i < length; i++) {
153 if (labels_->at(i) == label) return; 153 if (targets_->at(i) == target) return;
154 } 154 }
155 labels_->Add(label); 155 targets_->Add(target);
156 } 156 }
157 157
158 158
159 // ---------------------------------------------------------------------------- 159 // ----------------------------------------------------------------------------
160 // Implementation of Visitor 160 // Implementation of Visitor
161 161
162 162
163 void Visitor::VisitStatements(ZoneList<Statement*>* statements) { 163 void Visitor::VisitStatements(ZoneList<Statement*>* statements) {
164 for (int i = 0; i < statements->length(); i++) { 164 for (int i = 0; i < statements->length(); i++) {
165 Visit(statements->at(i)); 165 Visit(statements->at(i));
166 } 166 }
167 } 167 }
168 168
169 169
170 void Visitor::VisitExpressions(ZoneList<Expression*>* expressions) { 170 void Visitor::VisitExpressions(ZoneList<Expression*>* expressions) {
171 for (int i = 0; i < expressions->length(); i++) { 171 for (int i = 0; i < expressions->length(); i++) {
172 // The variable statement visiting code may pass NULL expressions 172 // The variable statement visiting code may pass NULL expressions
173 // to this code. Maybe this should be handled by introducing an 173 // to this code. Maybe this should be handled by introducing an
174 // undefined expression or literal? Revisit this code if this 174 // undefined expression or literal? Revisit this code if this
175 // changes 175 // changes
176 Expression* expression = expressions->at(i); 176 Expression* expression = expressions->at(i);
177 if (expression != NULL) Visit(expression); 177 if (expression != NULL) Visit(expression);
178 } 178 }
179 } 179 }
180 180
181 181
182 } } // namespace v8::internal 182 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698