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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) { | 166 void BreakableStatementChecker::VisitForOfStatement(ForOfStatement* stmt) { |
167 // Mark for in statements breakable if the iterable expression is. | 167 // For-of is breakable because of the next() call. |
168 Visit(stmt->iterable()); | 168 is_breakable_ = true; |
169 } | 169 } |
170 | 170 |
171 | 171 |
172 void BreakableStatementChecker::VisitTryCatchStatement( | 172 void BreakableStatementChecker::VisitTryCatchStatement( |
173 TryCatchStatement* stmt) { | 173 TryCatchStatement* stmt) { |
174 // 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. |
175 is_breakable_ = true; | 175 is_breakable_ = true; |
176 } | 176 } |
177 | 177 |
178 | 178 |
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1382 } else { | 1382 } else { |
1383 __ jmp(&body); | 1383 __ jmp(&body); |
1384 } | 1384 } |
1385 | 1385 |
1386 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); | 1386 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
1387 __ bind(loop_statement.break_label()); | 1387 __ bind(loop_statement.break_label()); |
1388 decrement_loop_depth(); | 1388 decrement_loop_depth(); |
1389 } | 1389 } |
1390 | 1390 |
1391 | 1391 |
1392 void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) { | |
1393 // TODO(wingo): Implement. | |
1394 } | |
1395 | |
1396 | |
1397 void FullCodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) { | 1392 void FullCodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) { |
1398 Comment cmnt(masm_, "[ TryCatchStatement"); | 1393 Comment cmnt(masm_, "[ TryCatchStatement"); |
1399 SetStatementPosition(stmt); | 1394 SetStatementPosition(stmt); |
1400 // The try block adds a handler to the exception handler chain before | 1395 // The try block adds a handler to the exception handler chain before |
1401 // entering, and removes it again when exiting normally. If an exception | 1396 // entering, and removes it again when exiting normally. If an exception |
1402 // is thrown during execution of the try block, the handler is consumed | 1397 // is thrown during execution of the try block, the handler is consumed |
1403 // and control is passed to the catch block with the exception in the | 1398 // and control is passed to the catch block with the exception in the |
1404 // result register. | 1399 // result register. |
1405 | 1400 |
1406 Label try_entry, handler_entry, exit; | 1401 Label try_entry, handler_entry, exit; |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1611 } | 1606 } |
1612 | 1607 |
1613 return false; | 1608 return false; |
1614 } | 1609 } |
1615 | 1610 |
1616 | 1611 |
1617 #undef __ | 1612 #undef __ |
1618 | 1613 |
1619 | 1614 |
1620 } } // namespace v8::internal | 1615 } } // namespace v8::internal |
OLD | NEW |