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

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

Issue 15288011: Baseline for-of implementation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use more subexpressions 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
« no previous file with comments | « src/ast.h ('k') | src/heap.h » ('j') | src/parser.h » ('J')
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1385 } else { 1385 } else {
1386 __ jmp(&body); 1386 __ jmp(&body);
1387 } 1387 }
1388 1388
1389 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); 1389 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
1390 __ bind(loop_statement.break_label()); 1390 __ bind(loop_statement.break_label());
1391 decrement_loop_depth(); 1391 decrement_loop_depth();
1392 } 1392 }
1393 1393
1394 1394
1395 void FullCodeGenerator::VisitForOfStatement(ForOfStatement* stmt) {
1396 }
1397
1398
1399 void FullCodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) { 1395 void FullCodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) {
1400 Comment cmnt(masm_, "[ TryCatchStatement"); 1396 Comment cmnt(masm_, "[ TryCatchStatement");
1401 SetStatementPosition(stmt); 1397 SetStatementPosition(stmt);
1402 // The try block adds a handler to the exception handler chain before 1398 // The try block adds a handler to the exception handler chain before
1403 // entering, and removes it again when exiting normally. If an exception 1399 // entering, and removes it again when exiting normally. If an exception
1404 // is thrown during execution of the try block, the handler is consumed 1400 // is thrown during execution of the try block, the handler is consumed
1405 // and control is passed to the catch block with the exception in the 1401 // and control is passed to the catch block with the exception in the
1406 // result register. 1402 // result register.
1407 1403
1408 Label try_entry, handler_entry, exit; 1404 Label try_entry, handler_entry, exit;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1613 } 1609 }
1614 1610
1615 return false; 1611 return false;
1616 } 1612 }
1617 1613
1618 1614
1619 #undef __ 1615 #undef __
1620 1616
1621 1617
1622 } } // namespace v8::internal 1618 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/heap.h » ('j') | src/parser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698