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

Side by Side Diff: src/full-codegen.cc

Issue 15300018: Add initial parser support for harmony iteration (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use subtyping instead of enumerated value Created 7 years, 7 months 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
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 } else { 1385 } else {
1380 __ jmp(&body); 1386 __ jmp(&body);
1381 } 1387 }
1382 1388
1383 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); 1389 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
1384 __ bind(loop_statement.break_label()); 1390 __ bind(loop_statement.break_label());
1385 decrement_loop_depth(); 1391 decrement_loop_depth();
1386 } 1392 }
1387 1393
1388 1394
1395 void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) {
rossberg 2013/06/06 10:32:33 Normally I'd want a TODO here, but since that's in
wingo 2013/06/06 14:09:51 Well, why not :) Done.
1396 }
1397
1398
1389 void FullCodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) { 1399 void FullCodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) {
1390 Comment cmnt(masm_, "[ TryCatchStatement"); 1400 Comment cmnt(masm_, "[ TryCatchStatement");
1391 SetStatementPosition(stmt); 1401 SetStatementPosition(stmt);
1392 // The try block adds a handler to the exception handler chain before 1402 // The try block adds a handler to the exception handler chain before
1393 // entering, and removes it again when exiting normally. If an exception 1403 // entering, and removes it again when exiting normally. If an exception
1394 // is thrown during execution of the try block, the handler is consumed 1404 // is thrown during execution of the try block, the handler is consumed
1395 // and control is passed to the catch block with the exception in the 1405 // and control is passed to the catch block with the exception in the
1396 // result register. 1406 // result register.
1397 1407
1398 Label try_entry, handler_entry, exit; 1408 Label try_entry, handler_entry, exit;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1603 } 1613 }
1604 1614
1605 return false; 1615 return false;
1606 } 1616 }
1607 1617
1608 1618
1609 #undef __ 1619 #undef __
1610 1620
1611 1621
1612 } } // namespace v8::internal 1622 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698