| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |