Commit b0fc9db5 authored by jgruber's avatar jgruber Committed by Commit Bot

[builtins] Remove duplicate elements store

Elements is already set by CSA::AllocateJSArray.

Bug: v8:7871
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I89b87f9f33eca4a92216f248606fb746f0de5412
Reviewed-on: https://chromium-review.googlesource.com/1168487
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55004}
parent 5a389395
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
template <class T>
using TNode = compiler::TNode<T>;
class IntlBuiltinsAssembler : public CodeStubAssembler { class IntlBuiltinsAssembler : public CodeStubAssembler {
public: public:
explicit IntlBuiltinsAssembler(compiler::CodeAssemblerState* state) explicit IntlBuiltinsAssembler(compiler::CodeAssemblerState* state)
...@@ -26,7 +29,7 @@ class IntlBuiltinsAssembler : public CodeStubAssembler { ...@@ -26,7 +29,7 @@ class IntlBuiltinsAssembler : public CodeStubAssembler {
Runtime::FunctionId format_func_id, Runtime::FunctionId format_func_id,
const char* method_name); const char* method_name);
Node* AllocateEmptyJSArray(TNode<Context> context); TNode<JSArray> AllocateEmptyJSArray(TNode<Context> context);
}; };
TF_BUILTIN(StringToLowerCaseIntl, IntlBuiltinsAssembler) { TF_BUILTIN(StringToLowerCaseIntl, IntlBuiltinsAssembler) {
...@@ -184,14 +187,12 @@ void IntlBuiltinsAssembler::ListFormatCommon(TNode<Context> context, ...@@ -184,14 +187,12 @@ void IntlBuiltinsAssembler::ListFormatCommon(TNode<Context> context,
} }
} }
Node* IntlBuiltinsAssembler::AllocateEmptyJSArray(TNode<Context> context) { TNode<JSArray> IntlBuiltinsAssembler::AllocateEmptyJSArray(
Node* array = CodeStubAssembler::AllocateJSArray( TNode<Context> context) {
return CAST(CodeStubAssembler::AllocateJSArray(
PACKED_ELEMENTS, PACKED_ELEMENTS,
LoadJSArrayElementsMap(PACKED_ELEMENTS, LoadNativeContext(context)), LoadJSArrayElementsMap(PACKED_ELEMENTS, LoadNativeContext(context)),
SmiConstant(0), SmiConstant(0)); SmiConstant(0), SmiConstant(0)));
StoreObjectFieldNoWriteBarrier(array, JSArray::kElementsOffset,
EmptyFixedArrayConstant());
return array;
} }
TF_BUILTIN(ListFormatPrototypeFormat, IntlBuiltinsAssembler) { TF_BUILTIN(ListFormatPrototypeFormat, IntlBuiltinsAssembler) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment