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

Unified Diff: src/code-stub-assembler.cc

Issue 2342533002: [ignition] inline allocation site creation to call/constructor handlers. (Closed)
Patch Set: Quick fix. Created 4 years, 3 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/code-stub-assembler.h ('k') | src/code-stubs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index 2d6fa59b3be0f550613ef629956f8dc2b354715d..e204185be1a38e78daa52ff22876edc6f7ce6510 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -4949,6 +4949,52 @@ void CodeStubAssembler::CheckEnumCache(Node* receiver, Label* use_cache,
}
}
+Node* CodeStubAssembler::CreateAllocationSiteInFeedbackVector(
+ Node* feedback_vector, Node* slot) {
+ Node* size = IntPtrConstant(AllocationSite::kSize);
+ Node* site = Allocate(size, CodeStubAssembler::kPretenured);
+
+ // Store the map
+ StoreObjectFieldRoot(site, AllocationSite::kMapOffset,
+ Heap::kAllocationSiteMapRootIndex);
+ Node* kind = SmiConstant(Smi::FromInt(GetInitialFastElementsKind()));
+ StoreObjectFieldNoWriteBarrier(site, AllocationSite::kTransitionInfoOffset,
+ kind);
+
+ // Unlike literals, constructed arrays don't have nested sites
+ Node* zero = IntPtrConstant(0);
+ StoreObjectFieldNoWriteBarrier(site, AllocationSite::kNestedSiteOffset, zero);
+
+ // Pretenuring calculation field.
+ StoreObjectFieldNoWriteBarrier(site, AllocationSite::kPretenureDataOffset,
+ zero);
+
+ // Pretenuring memento creation count field.
+ StoreObjectFieldNoWriteBarrier(
+ site, AllocationSite::kPretenureCreateCountOffset, zero);
+
+ // Store an empty fixed array for the code dependency.
+ StoreObjectFieldRoot(site, AllocationSite::kDependentCodeOffset,
+ Heap::kEmptyFixedArrayRootIndex);
+
+ // Link the object to the allocation site list
+ Node* site_list = ExternalConstant(
+ ExternalReference::allocation_sites_list_address(isolate()));
+ Node* next_site = LoadBufferObject(site_list, 0);
+
+ // TODO(mvstanton): This is a store to a weak pointer, which we may want to
+ // mark as such in order to skip the write barrier, once we have a unified
+ // system for weakness. For now we decided to keep it like this because having
+ // an initial write barrier backed store makes this pointer strong until the
+ // next GC, and allocation sites are designed to survive several GCs anyway.
+ StoreObjectField(site, AllocationSite::kWeakNextOffset, next_site);
+ StoreNoWriteBarrier(MachineRepresentation::kTagged, site_list, site);
+
+ StoreFixedArrayElement(feedback_vector, slot, site, UPDATE_WRITE_BARRIER,
+ CodeStubAssembler::SMI_PARAMETERS);
+ return site;
+}
+
Node* CodeStubAssembler::CreateWeakCellInFeedbackVector(Node* feedback_vector,
Node* slot,
Node* value) {
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698