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

Unified Diff: src/code-stubs.cc

Issue 1948433002: [stubs] Convert InternalArrayNoArgumentsConstructor to a TurboFan stub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 e60e5610224eb2554ba1db02ddb8351750e8ad78..72e99263f19c3e61b533a33102849c586280183f 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -4265,12 +4265,27 @@ void ArrayNoArgumentConstructorStub::GenerateAssembly(
? assembler->Parameter(
ArrayNoArgumentConstructorDescriptor::kAllocationSiteIndex)
: nullptr;
- Node* array = assembler->AllocateJSArray(elements_kind(), native_context,
+ Node* array_map =
+ assembler->LoadJSArrayElementsMap(elements_kind(), native_context);
+ Node* array = assembler->AllocateJSArray(elements_kind(), array_map,
JSArray::kPreallocatedArrayElements,
0, allocation_site);
assembler->Return(array);
}
+void InternalArrayNoArgumentConstructorStub::GenerateAssembly(
+ CodeStubAssembler* assembler) const {
+ typedef compiler::Node Node;
+ Node* array_map = assembler->LoadObjectField(
+ assembler->Parameter(
+ ArrayNoArgumentConstructorDescriptor::kFunctionIndex),
+ JSFunction::kPrototypeOrInitialMapOffset);
+ Node* array = assembler->AllocateJSArray(elements_kind(), array_map,
+ JSArray::kPreallocatedArrayElements,
+ 0, nullptr);
+ assembler->Return(array);
+}
+
ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate)
: PlatformCodeStub(isolate) {
minor_key_ = ArgumentCountBits::encode(ANY);
« 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