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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1484163003: [crankshaft] Prevent inlining of new.target functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | test/mjsunit/es6/regress/regress-inlined-new-target.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index 0ddd78815378c2d7535bd6983553ce557ae900c0..0fc2f211389ca323782422b981e2bbac0df3232a 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -8381,6 +8381,13 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
}
}
+ // Unsupported variable references present.
+ if (function->scope()->this_function_var() != nullptr ||
+ function->scope()->new_target_var() != nullptr) {
+ TraceInline(target, caller, "target uses new target or this function");
+ return false;
+ }
+
// All declarations must be inlineable.
ZoneList<Declaration*>* decls = target_info.scope()->declarations();
int decl_count = decls->length();
« no previous file with comments | « no previous file | test/mjsunit/es6/regress/regress-inlined-new-target.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698