From d4b6f4756baaf64aead0e3696268c223c8881f96 Mon Sep 17 00:00:00 2001 From: Igor Sheludko Date: Fri, 15 Nov 2019 01:03:06 +0100 Subject: [PATCH] [csa] Remove ParameterMode from src/builtins/builtins-proxy-gen.* Bug: v8:9708 Change-Id: I874a04b817cc7b38011f7db9226540aa92608ac0 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1917143 Commit-Queue: Igor Sheludko Reviewed-by: Leszek Swirski Cr-Commit-Position: refs/heads/master@{#64975} --- src/builtins/builtins-proxy-gen.cc | 24 +++++++++++++----------- src/builtins/builtins-proxy-gen.h | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/builtins/builtins-proxy-gen.cc b/src/builtins/builtins-proxy-gen.cc index 3ccee9d2e3..3c4f5163ea 100644 --- a/src/builtins/builtins-proxy-gen.cc +++ b/src/builtins/builtins-proxy-gen.cc @@ -59,28 +59,29 @@ TNode ProxiesCodeStubAssembler::AllocateProxy( } TNode ProxiesCodeStubAssembler::AllocateJSArrayForCodeStubArguments( - TNode context, const CodeStubArguments& args, TNode argc, - ParameterMode mode) { + TNode context, const CodeStubArguments& args, + TNode argc) { Comment("AllocateJSArrayForCodeStubArguments"); + CSA_ASSERT(this, IsValidPositiveSmi(argc)); Label if_empty_array(this), allocate_js_array(this); // Do not use AllocateJSArray since {elements} might end up in LOS. TVARIABLE(FixedArrayBase, elements); - TNode length = ParameterToTagged(argc, mode); - GotoIf(SmiEqual(length, SmiConstant(0)), &if_empty_array); + GotoIf(WordEqual(argc, IntPtrConstant(0)), &if_empty_array); { Label if_large_object(this, Label::kDeferred); TNode allocated_elements = AllocateFixedArray( - PACKED_ELEMENTS, argc, mode, kAllowLargeObjectAllocation); + PACKED_ELEMENTS, argc, INTPTR_PARAMETERS, kAllowLargeObjectAllocation); elements = allocated_elements; TVARIABLE(IntPtrT, offset, IntPtrConstant(FixedArrayBase::kHeaderSize - kHeapObjectTag)); VariableList list({&offset}, zone()); - GotoIf(SmiGreaterThan(length, SmiConstant(FixedArray::kMaxRegularLength)), - &if_large_object); + GotoIf( + UintPtrGreaterThan(argc, IntPtrConstant(FixedArray::kMaxRegularLength)), + &if_large_object); args.ForEach(list, [&](TNode arg) { StoreNoWriteBarrier(MachineRepresentation::kTagged, allocated_elements, offset.value(), arg); @@ -109,6 +110,7 @@ TNode ProxiesCodeStubAssembler::AllocateJSArrayForCodeStubArguments( TNode native_context = LoadNativeContext(context); TNode array_map = LoadJSArrayElementsMap(PACKED_ELEMENTS, native_context); + TNode length = SmiTag(argc); TNode array = AllocateJSArray(array_map, elements.value(), length); return array; @@ -174,8 +176,8 @@ TF_BUILTIN(CallProxy, ProxiesCodeStubAssembler) { TNode receiver = args.GetReceiver(); // 7. Let argArray be CreateArrayFromList(argumentsList). - TNode array = AllocateJSArrayForCodeStubArguments( - context, args, argc_ptr, INTPTR_PARAMETERS); + TNode array = + AllocateJSArrayForCodeStubArguments(context, args, argc_ptr); // 8. Return Call(trap, handler, «target, thisArgument, argArray»). TNode result = CallJS(CodeFactory::Call(isolate()), context, trap, @@ -227,8 +229,8 @@ TF_BUILTIN(ConstructProxy, ProxiesCodeStubAssembler) { CodeStubArguments args(this, argc_ptr); // 7. Let argArray be CreateArrayFromList(argumentsList). - TNode array = AllocateJSArrayForCodeStubArguments( - context, args, argc_ptr, INTPTR_PARAMETERS); + TNode array = + AllocateJSArrayForCodeStubArguments(context, args, argc_ptr); // 8. Let newObj be ? Call(trap, handler, « target, argArray, newTarget »). TNode new_obj = CallJS(CodeFactory::Call(isolate()), context, trap, diff --git a/src/builtins/builtins-proxy-gen.h b/src/builtins/builtins-proxy-gen.h index 3bd7426603..a2ec3d1ec9 100644 --- a/src/builtins/builtins-proxy-gen.h +++ b/src/builtins/builtins-proxy-gen.h @@ -41,7 +41,7 @@ class ProxiesCodeStubAssembler : public CodeStubAssembler { TNode AllocateJSArrayForCodeStubArguments( TNode context, const CodeStubArguments& args, - TNode argc, ParameterMode mode); + TNode argc); private: TNode CreateProxyRevokeFunctionContext(