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

Unified Diff: src/code-stubs.cc

Issue 1903723003: [stubs]: Implement ArrayNoArgumentConstructor as a TF stub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback Created 4 years, 8 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-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 2a3a101818c2387c12bc37407d271463da1d834e..e60e5610224eb2554ba1db02ddb8351750e8ad78 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -4250,6 +4250,26 @@ void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function,
entry_hook(function, stack_pointer);
}
+void ArrayNoArgumentConstructorStub::GenerateAssembly(
+ CodeStubAssembler* assembler) const {
+ typedef compiler::Node Node;
+ Node* native_context = assembler->LoadObjectField(
+ assembler->Parameter(
+ ArrayNoArgumentConstructorDescriptor::kFunctionIndex),
+ JSFunction::kContextOffset);
+ bool track_allocation_site =
+ AllocationSite::GetMode(elements_kind()) == TRACK_ALLOCATION_SITE &&
+ override_mode() != DISABLE_ALLOCATION_SITES;
+ Node* allocation_site =
+ track_allocation_site
+ ? assembler->Parameter(
+ ArrayNoArgumentConstructorDescriptor::kAllocationSiteIndex)
+ : nullptr;
+ Node* array = assembler->AllocateJSArray(elements_kind(), native_context,
+ JSArray::kPreallocatedArrayElements,
+ 0, allocation_site);
+ assembler->Return(array);
+}
ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate)
: PlatformCodeStub(isolate) {
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698