Chromium Code Reviews

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: Fix against ToT Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« 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..bd9142a0963f9b23d17c451fff9a9b6931b133c2 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -4250,6 +4250,21 @@ 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(0),
mvstanton 2016/05/02 12:40:08 It would be better if the interface descriptor has
danno 2016/05/02 15:26:21 Done.
+ 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(1) : 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