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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 } | 157 } |
158 | 158 |
159 | 159 |
160 void BreakableStatementChecker::VisitForInStatement(ForInStatement* stmt) { | 160 void BreakableStatementChecker::VisitForInStatement(ForInStatement* stmt) { |
161 // Mark for in statements breakable if the enumerable expression is. | 161 // Mark for in statements breakable if the enumerable expression is. |
162 Visit(stmt->enumerable()); | 162 Visit(stmt->enumerable()); |
163 } | 163 } |
164 | 164 |
165 | 165 |
| 166 void BreakableStatementChecker::VisitForOfStatement(ForOfStatement* stmt) { |
| 167 // Mark for in statements breakable if the iterable expression is. |
| 168 Visit(stmt->iterable()); |
| 169 } |
| 170 |
| 171 |
166 void BreakableStatementChecker::VisitTryCatchStatement( | 172 void BreakableStatementChecker::VisitTryCatchStatement( |
167 TryCatchStatement* stmt) { | 173 TryCatchStatement* stmt) { |
168 // Mark try catch as breakable to avoid adding a break slot in front of it. | 174 // Mark try catch as breakable to avoid adding a break slot in front of it. |
169 is_breakable_ = true; | 175 is_breakable_ = true; |
170 } | 176 } |
171 | 177 |
172 | 178 |
173 void BreakableStatementChecker::VisitTryFinallyStatement( | 179 void BreakableStatementChecker::VisitTryFinallyStatement( |
174 TryFinallyStatement* stmt) { | 180 TryFinallyStatement* stmt) { |
175 // Mark try finally as breakable to avoid adding a break slot in front of it. | 181 // Mark try finally as breakable to avoid adding a break slot in front of it. |
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1376 } else { | 1382 } else { |
1377 __ jmp(&body); | 1383 __ jmp(&body); |
1378 } | 1384 } |
1379 | 1385 |
1380 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); | 1386 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
1381 __ bind(loop_statement.break_label()); | 1387 __ bind(loop_statement.break_label()); |
1382 decrement_loop_depth(); | 1388 decrement_loop_depth(); |
1383 } | 1389 } |
1384 | 1390 |
1385 | 1391 |
| 1392 void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { |
| 1393 // TODO(wingo): Implement. |
| 1394 } |
| 1395 |
| 1396 |
1386 void FullCodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) { | 1397 void FullCodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) { |
1387 Comment cmnt(masm_, "[ TryCatchStatement"); | 1398 Comment cmnt(masm_, "[ TryCatchStatement"); |
1388 SetStatementPosition(stmt); | 1399 SetStatementPosition(stmt); |
1389 // The try block adds a handler to the exception handler chain before | 1400 // The try block adds a handler to the exception handler chain before |
1390 // entering, and removes it again when exiting normally. If an exception | 1401 // entering, and removes it again when exiting normally. If an exception |
1391 // is thrown during execution of the try block, the handler is consumed | 1402 // is thrown during execution of the try block, the handler is consumed |
1392 // and control is passed to the catch block with the exception in the | 1403 // and control is passed to the catch block with the exception in the |
1393 // result register. | 1404 // result register. |
1394 | 1405 |
1395 Label try_entry, handler_entry, exit; | 1406 Label try_entry, handler_entry, exit; |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1600 } | 1611 } |
1601 | 1612 |
1602 return false; | 1613 return false; |
1603 } | 1614 } |
1604 | 1615 |
1605 | 1616 |
1606 #undef __ | 1617 #undef __ |
1607 | 1618 |
1608 | 1619 |
1609 } } // namespace v8::internal | 1620 } } // namespace v8::internal |
OLD | NEW |