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

Unified Diff: src/runtime/runtime-function.cc

Issue 1906823002: Move of the type feedback vector to the closure. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 4 years, 7 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 | « src/runtime-profiler.cc ('k') | src/runtime/runtime-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-function.cc
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc
index 5d08577f20cdb4ab4f608194de51be7472aadfe3..9272ef6e069d35c2abc747e0806072907092b5f1 100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -188,7 +188,7 @@ RUNTIME_FUNCTION(Runtime_SetCode) {
target_shared->set_scope_info(source_shared->scope_info());
target_shared->set_length(source_shared->length());
target_shared->set_num_literals(source_shared->num_literals());
- target_shared->set_feedback_vector(source_shared->feedback_vector());
+ target_shared->set_feedback_metadata(source_shared->feedback_metadata());
target_shared->set_internal_formal_parameter_count(
source_shared->internal_formal_parameter_count());
target_shared->set_start_position_and_type(
@@ -207,15 +207,13 @@ RUNTIME_FUNCTION(Runtime_SetCode) {
target->ReplaceCode(source_shared->code());
DCHECK(target->next_function_link()->IsUndefined());
- // Make sure we get a fresh copy of the literal vector to avoid cross
- // context contamination.
Handle<Context> context(source->context());
target->set_context(*context);
- Handle<LiteralsArray> literals =
- LiteralsArray::New(isolate, handle(target_shared->feedback_vector()),
- target_shared->num_literals(), TENURED);
- target->set_literals(*literals);
+ // Make sure we get a fresh copy of the literal vector to avoid cross
+ // context contamination, and that the literal vector makes it's way into
+ // the target_shared optimized code map.
+ JSFunction::EnsureLiterals(target);
if (isolate->logger()->is_logging_code_events() ||
isolate->cpu_profiler()->is_profiling()) {
« no previous file with comments | « src/runtime-profiler.cc ('k') | src/runtime/runtime-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698