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

Side by Side Diff: src/hydrogen.cc

Issue 13179002: Add parser support for generators. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: added additional syntax tests Created 7 years, 8 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
« no previous file with comments | « src/full-codegen.cc ('k') | src/objects.h » ('j') | no next file with comments »
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 4104 matching lines...) Expand 10 before | Expand all | Expand 10 after
4115 4115
4116 void HOptimizedGraphBuilder::VisitExpressions( 4116 void HOptimizedGraphBuilder::VisitExpressions(
4117 ZoneList<Expression*>* exprs) { 4117 ZoneList<Expression*>* exprs) {
4118 for (int i = 0; i < exprs->length(); ++i) { 4118 for (int i = 0; i < exprs->length(); ++i) {
4119 CHECK_ALIVE(VisitForValue(exprs->at(i))); 4119 CHECK_ALIVE(VisitForValue(exprs->at(i)));
4120 } 4120 }
4121 } 4121 }
4122 4122
4123 4123
4124 bool HOptimizedGraphBuilder::BuildGraph() { 4124 bool HOptimizedGraphBuilder::BuildGraph() {
4125 if (info()->function()->is_generator()) {
4126 Bailout("function is a generator");
4127 return false;
4128 }
4125 Scope* scope = info()->scope(); 4129 Scope* scope = info()->scope();
4126 if (scope->HasIllegalRedeclaration()) { 4130 if (scope->HasIllegalRedeclaration()) {
4127 Bailout("function with illegal redeclaration"); 4131 Bailout("function with illegal redeclaration");
4128 return false; 4132 return false;
4129 } 4133 }
4130 if (scope->calls_eval()) { 4134 if (scope->calls_eval()) {
4131 Bailout("function calls eval"); 4135 Bailout("function calls eval");
4132 return false; 4136 return false;
4133 } 4137 }
4134 SetUpScope(scope); 4138 SetUpScope(scope);
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
5118 } else { 5122 } else {
5119 ASSERT(context->IsValue()); 5123 ASSERT(context->IsValue());
5120 CHECK_ALIVE(VisitForValue(stmt->expression())); 5124 CHECK_ALIVE(VisitForValue(stmt->expression()));
5121 current_block()->AddLeaveInlined(Pop(), state); 5125 current_block()->AddLeaveInlined(Pop(), state);
5122 } 5126 }
5123 } 5127 }
5124 set_current_block(NULL); 5128 set_current_block(NULL);
5125 } 5129 }
5126 5130
5127 5131
5132 void HOptimizedGraphBuilder::VisitYield(Yield* expr) {
5133 // Generators are not optimized, so we should never get here.
5134 UNREACHABLE();
5135 }
5136
5137
5128 void HOptimizedGraphBuilder::VisitWithStatement(WithStatement* stmt) { 5138 void HOptimizedGraphBuilder::VisitWithStatement(WithStatement* stmt) {
5129 ASSERT(!HasStackOverflow()); 5139 ASSERT(!HasStackOverflow());
5130 ASSERT(current_block() != NULL); 5140 ASSERT(current_block() != NULL);
5131 ASSERT(current_block()->HasPredecessor()); 5141 ASSERT(current_block()->HasPredecessor());
5132 return Bailout("WithStatement"); 5142 return Bailout("WithStatement");
5133 } 5143 }
5134 5144
5135 5145
5136 void HOptimizedGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) { 5146 void HOptimizedGraphBuilder::VisitSwitchStatement(SwitchStatement* stmt) {
5137 ASSERT(!HasStackOverflow()); 5147 ASSERT(!HasStackOverflow());
(...skipping 6141 matching lines...) Expand 10 before | Expand all | Expand 10 after
11279 } 11289 }
11280 } 11290 }
11281 11291
11282 #ifdef DEBUG 11292 #ifdef DEBUG
11283 if (graph_ != NULL) graph_->Verify(false); // No full verify. 11293 if (graph_ != NULL) graph_->Verify(false); // No full verify.
11284 if (allocator_ != NULL) allocator_->Verify(); 11294 if (allocator_ != NULL) allocator_->Verify();
11285 #endif 11295 #endif
11286 } 11296 }
11287 11297
11288 } } // namespace v8::internal 11298 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/full-codegen.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698