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

Unified Diff: src/feedback-vector.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/feedback-vector.h ('k') | src/feedback-vector-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/feedback-vector.cc
diff --git a/src/feedback-vector.cc b/src/feedback-vector.cc
index 895ffe2c7d84f8e132bfbe7835fe65211dc356f1..a61d7a13f99bf2528af6c5eb2fcca27d0a6655bb 100644
--- a/src/feedback-vector.cc
+++ b/src/feedback-vector.cc
@@ -161,18 +161,15 @@ FeedbackSlotKind FeedbackVector::GetKind(FeedbackSlot slot) const {
// static
Handle<FeedbackVector> FeedbackVector::New(Isolate* isolate,
- Handle<FeedbackMetadata> metadata) {
+ Handle<SharedFunctionInfo> shared) {
Factory* factory = isolate->factory();
- const int slot_count = metadata->slot_count();
+ const int slot_count = shared->feedback_metadata()->slot_count();
const int length = slot_count + kReservedIndexCount;
- if (length == kReservedIndexCount) {
- return Handle<FeedbackVector>::cast(factory->empty_feedback_vector());
- }
Handle<FixedArray> array = factory->NewFixedArray(length, TENURED);
array->set_map_no_write_barrier(isolate->heap()->feedback_vector_map());
- array->set(kMetadataIndex, *metadata);
+ array->set(kSharedFunctionInfoIndex, *shared);
array->set(kInvocationCountIndex, Smi::kZero);
// Ensure we can skip the write barrier
@@ -181,7 +178,7 @@ Handle<FeedbackVector> FeedbackVector::New(Isolate* isolate,
Handle<Oddball> undefined_value = factory->undefined_value();
for (int i = 0; i < slot_count;) {
FeedbackSlot slot(i);
- FeedbackSlotKind kind = metadata->GetKind(slot);
+ FeedbackSlotKind kind = shared->feedback_metadata()->GetKind(slot);
int index = FeedbackVector::GetIndex(slot);
int entry_size = FeedbackMetadata::GetSlotSize(kind);
@@ -253,8 +250,6 @@ void FeedbackVector::ClearSlotsImpl(SharedFunctionInfo* shared,
Isolate* isolate = GetIsolate();
if (!force_clear && !ClearLogic(isolate)) return;
- if (this == isolate->heap()->empty_feedback_vector()) return;
-
Object* uninitialized_sentinel =
FeedbackVector::RawUninitializedSentinel(isolate);
Oddball* undefined_value = isolate->heap()->undefined_value();
« no previous file with comments | « src/feedback-vector.h ('k') | src/feedback-vector-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698