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

Unified Diff: src/compiler.cc

Issue 1210523002: Make sure bound functions never make it into optimized code map. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | src/objects.cc » ('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 083bd798fd24f13415b03440368c37ee52b9f579..1544c715a25a8d4cbc5f9313772faa50aacded78 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -690,8 +690,6 @@ MUST_USE_RESULT static MaybeHandle<Code> GetCodeFromOptimizedCodeMap(
Handle<JSFunction> function, 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);
@@ -723,12 +721,13 @@ static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
// Context specialization folds-in the context, so no sharing can occur.
if (code->is_turbofanned() && info->is_context_specializing()) return;
+ // Do not cache bound functions.
+ if (info->closure()->shared()->bound()) return;
+
// Cache optimized code.
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(shared, native_context, code,
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698