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

Unified 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: Clean up a couple of comments, otherwise same as previous patch set 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/bailout-reason.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast-numbering.cc
diff --git a/src/ast-numbering.cc b/src/ast-numbering.cc
index c2dd70e1bbe75086a0de3e9097aac6d2b3dc49c1..60f41016030af4b27aa4571c87554d27c6514716 100644
--- a/src/ast-numbering.cc
+++ b/src/ast-numbering.cc
@@ -559,6 +559,14 @@ bool AstNumberingVisitor::Renumber(FunctionLiteral* node) {
DisableCrankshaft(kContextAllocatedArguments);
}
+ // TODO(aperez): Add support in Crankshaft for arrow functions (issue #3814).
+ if (scope->is_arrow_scope() && scope->uses_this()) {
+ DisableCrankshaft(kCapturedThis);
+ }
+ if (scope->is_function_scope() && scope->inner_uses_this()) {
+ DisableCrankshaft(kCapturedThis);
+ }
+
VisitDeclarations(scope->declarations());
if (scope->is_function_scope() && scope->function() != NULL) {
// Visit the name of the named function expression.
« no previous file with comments | « no previous file | src/bailout-reason.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698