OLD | NEW |
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 Loading... |
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 | |
150 void LabelCollector::AddLabel(Label* label) { | 149 void LabelCollector::AddLabel(Label* label) { |
151 // Add the label to the collector, but discard duplicates. | 150 // Add the label to the collector, but discard duplicates. |
152 int length = labels_->length(); | 151 int length = labels_->length(); |
153 for (int i = 0; i < length; i++) { | 152 for (int i = 0; i < length; i++) { |
154 if (labels_->at(i) == label) return; | 153 if (labels_->at(i) == label) return; |
155 } | 154 } |
156 labels_->Add(label); | 155 labels_->Add(label); |
157 } | 156 } |
158 | 157 |
159 | 158 |
(...skipping 14 matching lines...) Expand all Loading... |
174 // to this code. Maybe this should be handled by introducing an | 173 // to this code. Maybe this should be handled by introducing an |
175 // undefined expression or literal? Revisit this code if this | 174 // undefined expression or literal? Revisit this code if this |
176 // changes | 175 // changes |
177 Expression* expression = expressions->at(i); | 176 Expression* expression = expressions->at(i); |
178 if (expression != NULL) Visit(expression); | 177 if (expression != NULL) Visit(expression); |
179 } | 178 } |
180 } | 179 } |
181 | 180 |
182 | 181 |
183 } } // namespace v8::internal | 182 } } // namespace v8::internal |
OLD | NEW |