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

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: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/bailout-reason.h » ('j') | src/bailout-reason.h » ('J')
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..605fedd5905dc75870c663751a3f4c94de77d919 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.
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.
+ 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') | src/bailout-reason.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698