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

Side by Side Diff: src/rewriter.cc

Issue 39973003: Merge bleeding_edge. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: again Created 7 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/regexp.js ('k') | src/runtime.h » ('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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 ZoneList<CaseClause*>* clauses = node->cases(); 200 ZoneList<CaseClause*>* clauses = node->cases();
201 bool set_after_switch = is_set_; 201 bool set_after_switch = is_set_;
202 for (int i = clauses->length() - 1; i >= 0; --i) { 202 for (int i = clauses->length() - 1; i >= 0; --i) {
203 CaseClause* clause = clauses->at(i); 203 CaseClause* clause = clauses->at(i);
204 Process(clause->statements()); 204 Process(clause->statements());
205 } 205 }
206 is_set_ = is_set_ && set_after_switch; 206 is_set_ = is_set_ && set_after_switch;
207 } 207 }
208 208
209 209
210 void Processor::VisitCaseClause(CaseClause* clause) {
211 UNREACHABLE();
212 }
213
214
210 void Processor::VisitContinueStatement(ContinueStatement* node) { 215 void Processor::VisitContinueStatement(ContinueStatement* node) {
211 is_set_ = false; 216 is_set_ = false;
212 } 217 }
213 218
214 219
215 void Processor::VisitBreakStatement(BreakStatement* node) { 220 void Processor::VisitBreakStatement(BreakStatement* node) {
216 is_set_ = false; 221 is_set_ = false;
217 } 222 }
218 223
219 224
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 if (processor.HasStackOverflow()) return false; 269 if (processor.HasStackOverflow()) return false;
265 270
266 if (processor.result_assigned()) { 271 if (processor.result_assigned()) {
267 ASSERT(function->end_position() != RelocInfo::kNoPosition); 272 ASSERT(function->end_position() != RelocInfo::kNoPosition);
268 // Set the position of the assignment statement one character past the 273 // Set the position of the assignment statement one character past the
269 // source code, such that it definitely is not in the source code range 274 // source code, such that it definitely is not in the source code range
270 // of an immediate inner scope. For example in 275 // of an immediate inner scope. For example in
271 // eval('with ({x:1}) x = 1'); 276 // eval('with ({x:1}) x = 1');
272 // the end position of the function generated for executing the eval code 277 // the end position of the function generated for executing the eval code
273 // coincides with the end of the with scope which is the position of '1'. 278 // coincides with the end of the with scope which is the position of '1'.
274 int position = function->end_position(); 279 int pos = function->end_position();
275 VariableProxy* result_proxy = processor.factory()->NewVariableProxy( 280 VariableProxy* result_proxy = processor.factory()->NewVariableProxy(
276 result->name(), false, result->interface(), position); 281 result->name(), false, result->interface(), pos);
277 result_proxy->BindTo(result); 282 result_proxy->BindTo(result);
278 Statement* result_statement = 283 Statement* result_statement =
279 processor.factory()->NewReturnStatement(result_proxy); 284 processor.factory()->NewReturnStatement(result_proxy, pos);
280 result_statement->set_statement_pos(position);
281 body->Add(result_statement, info->zone()); 285 body->Add(result_statement, info->zone());
282 } 286 }
283 } 287 }
284 288
285 return true; 289 return true;
286 } 290 }
287 291
288 292
289 } } // namespace v8::internal 293 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/regexp.js ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698