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

Unified Diff: src/compiler.cc

Issue 345463005: Harden %FunctionBindArguments wrt optimized code cache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: test case Created 6 years, 6 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 | test/mjsunit/regress/regress-crbug-387627.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index a03bbf1ad9f34048bb9c4ca3fc036048e9c0592f..1d6fb1ff1c95ad81ac91dd68ef53970e2711fa2f 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1041,6 +1041,8 @@ MUST_USE_RESULT static MaybeHandle<Code> GetCodeFromOptimizedCodeMap(
BailoutId osr_ast_id) {
if (FLAG_cache_optimized_code) {
Handle<SharedFunctionInfo> shared(function->shared());
+ // Bound functions are not cached.
+ if (shared->bound()) return MaybeHandle<Code>();
DisallowHeapAllocation no_gc;
int index = shared->SearchOptimizedCodeMap(
function->context()->native_context(), osr_ast_id);
@@ -1070,6 +1072,8 @@ static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
if (FLAG_cache_optimized_code) {
Handle<JSFunction> function = info->closure();
Handle<SharedFunctionInfo> shared(function->shared());
+ // Do not cache bound functions.
+ if (shared->bound()) return;
Handle<FixedArray> literals(function->literals());
Handle<Context> native_context(function->context()->native_context());
SharedFunctionInfo::AddToOptimizedCodeMap(
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-387627.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698