| Index: src/runtime/runtime-function.cc
|
| diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc
|
| index 88cf69b52df490a62ead1c33c6cf52ef4c232f55..befd3370984b7b753c21f6bb6c19c3b58b63d4b0 100644
|
| --- a/src/runtime/runtime-function.cc
|
| +++ b/src/runtime/runtime-function.cc
|
| @@ -168,8 +168,7 @@
|
| target_shared->ReplaceCode(source_shared->code());
|
| target_shared->set_scope_info(source_shared->scope_info());
|
| target_shared->set_length(source_shared->length());
|
| - target_shared->set_feedback_metadata(source_shared->feedback_metadata());
|
| - target_shared->set_num_literals(source_shared->num_literals());
|
| + target_shared->set_feedback_vector(source_shared->feedback_vector());
|
| target_shared->set_internal_formal_parameter_count(
|
| source_shared->internal_formal_parameter_count());
|
| target_shared->set_start_position_and_type(
|
| @@ -188,13 +187,16 @@
|
| 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);
|
|
|
| - // 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);
|
| + int number_of_literals = source->NumberOfLiterals();
|
| + Handle<LiteralsArray> literals =
|
| + LiteralsArray::New(isolate, handle(target_shared->feedback_vector()),
|
| + number_of_literals, TENURED);
|
| + target->set_literals(*literals);
|
|
|
| if (isolate->logger()->is_logging_code_events() ||
|
| isolate->cpu_profiler()->is_profiling()) {
|
|
|