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

Side by Side Diff: src/ast-numbering.cc

Issue 791603003: WIP context-allocation for “this” in arrow functions Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: WIP v3 Created 5 years, 11 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 | « no previous file | src/bailout-reason.h » ('j') | src/bailout-reason.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/ast-numbering.h" 8 #include "src/ast-numbering.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/scopes.h" 10 #include "src/scopes.h"
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 if (scope->HasIllegalRedeclaration()) { 552 if (scope->HasIllegalRedeclaration()) {
553 scope->VisitIllegalRedeclaration(this); 553 scope->VisitIllegalRedeclaration(this);
554 DisableCrankshaft(kFunctionWithIllegalRedeclaration); 554 DisableCrankshaft(kFunctionWithIllegalRedeclaration);
555 return Finish(node); 555 return Finish(node);
556 } 556 }
557 if (scope->calls_eval()) DisableCrankshaft(kFunctionCallsEval); 557 if (scope->calls_eval()) DisableCrankshaft(kFunctionCallsEval);
558 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { 558 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) {
559 DisableCrankshaft(kContextAllocatedArguments); 559 DisableCrankshaft(kContextAllocatedArguments);
560 } 560 }
561 561
562 // TODO(aperez): Add support in Crankshaft for arrow functions.
wingo 2015/01/15 10:09:05 Let's file a bug for the tasks needed in Crankshaf
aperez 2015/01/15 16:58:03 Done.
563 if (scope->is_arrow_scope() && scope->uses_this()) {
564 DisableCrankshaft(kCapturedThis);
565 }
566 if (scope->is_function_scope() && scope->inner_uses_this()) {
567 DisableCrankshaft(kCapturedThis);
568 }
569
562 VisitDeclarations(scope->declarations()); 570 VisitDeclarations(scope->declarations());
563 if (scope->is_function_scope() && scope->function() != NULL) { 571 if (scope->is_function_scope() && scope->function() != NULL) {
564 // Visit the name of the named function expression. 572 // Visit the name of the named function expression.
565 Visit(scope->function()); 573 Visit(scope->function());
566 } 574 }
567 VisitStatements(node->body()); 575 VisitStatements(node->body());
568 576
569 return Finish(node); 577 return Finish(node);
570 } 578 }
571 579
572 580
573 bool AstNumbering::Renumber(FunctionLiteral* function, Zone* zone) { 581 bool AstNumbering::Renumber(FunctionLiteral* function, Zone* zone) {
574 AstNumberingVisitor visitor(zone); 582 AstNumberingVisitor visitor(zone);
575 return visitor.Renumber(function); 583 return visitor.Renumber(function);
576 } 584 }
577 } 585 }
578 } // namespace v8::internal 586 } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/bailout-reason.h » ('j') | src/bailout-reason.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698