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

Unified Diff: src/debug/liveedit.cc

Issue 2672363002: Link type feedback vectors to the shared function info. (Closed)
Patch Set: rebase Created 3 years, 10 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/compiler.cc ('k') | src/feedback-vector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/liveedit.cc
diff --git a/src/debug/liveedit.cc b/src/debug/liveedit.cc
index a52f881472042aaa6e65ec6f68b7fa339da8434a..481197f91ecbeb99b96181fe3bae0abe6b2ded28 100644
--- a/src/debug/liveedit.cc
+++ b/src/debug/liveedit.cc
@@ -758,17 +758,15 @@ class FeedbackVectorFixer {
// collect all functions and fix their literal arrays.
Handle<FixedArray> function_instances =
CollectJSFunctions(shared_info, isolate);
- Handle<FeedbackMetadata> feedback_metadata(
- shared_info->feedback_metadata());
for (int i = 0; i < function_instances->length(); i++) {
Handle<JSFunction> fun(JSFunction::cast(function_instances->get(i)));
- Handle<FeedbackVector> vector =
- FeedbackVector::New(isolate, feedback_metadata);
- fun->feedback_vector_cell()->set_value(*vector);
- }
+ fun->set_feedback_vector_cell(isolate->heap()->undefined_cell());
+ // Only create feedback vectors if we already have the metadata.
+ if (shared_info->is_compiled()) JSFunction::EnsureLiterals(fun);
+ }
- shared_info->set_num_literals(new_literal_count);
+ shared_info->set_num_literals(new_literal_count);
}
private:
@@ -925,6 +923,9 @@ void LiveEdit::ReplaceFunctionCode(
Handle<FeedbackMetadata> new_feedback_metadata(
new_shared_info->feedback_metadata());
shared_info->set_feedback_metadata(*new_feedback_metadata);
+ } else {
+ shared_info->set_feedback_metadata(
+ FeedbackMetadata::cast(isolate->heap()->empty_fixed_array()));
}
int start_position = compile_info_wrapper.GetStartPosition();
« no previous file with comments | « src/compiler.cc ('k') | src/feedback-vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698