From 3b233c9f25791277d3f6a6f2f9f7b20f67d28d8d Mon Sep 17 00:00:00 2001 From: Liu Yu Date: Thu, 27 Jan 2022 16:31:47 +0800 Subject: [PATCH] [loong64][mips]Remove ClassConstructor check from CallFunction Port commit 99a5bb7484149fa75299f4fd91d5e32be97bf3e2 Change-Id: I39c6bc91b487a2c8ec8ae4e226e4db57c018d222 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3419797 Auto-Submit: Yu Liu Reviewed-by: Zhao Jiazhong Commit-Queue: Zhao Jiazhong Cr-Commit-Position: refs/heads/main@{#78803} --- src/builtins/loong64/builtins-loong64.cc | 13 ------------- src/builtins/mips/builtins-mips.cc | 13 ------------- src/builtins/mips64/builtins-mips64.cc | 13 ------------- 3 files changed, 39 deletions(-) diff --git a/src/builtins/loong64/builtins-loong64.cc b/src/builtins/loong64/builtins-loong64.cc index 2c725cbe7b..1c1a404311 100644 --- a/src/builtins/loong64/builtins-loong64.cc +++ b/src/builtins/loong64/builtins-loong64.cc @@ -2263,12 +2263,7 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm, // ----------------------------------- __ AssertCallableFunction(a1); - Label class_constructor; __ Ld_d(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); - __ Ld_wu(a3, FieldMemOperand(a2, SharedFunctionInfo::kFlagsOffset)); - __ And(kScratchReg, a3, - Operand(SharedFunctionInfo::IsClassConstructorBit::kMask)); - __ Branch(&class_constructor, ne, kScratchReg, Operand(zero_reg)); // Enter the context of the function; ToObject has to run in the function // context, and we also need to take the global proxy from the function @@ -2344,14 +2339,6 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm, __ Ld_hu( a2, FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset)); __ InvokeFunctionCode(a1, no_reg, a2, a0, InvokeType::kJump); - - // The function is a "classConstructor", need to raise an exception. - __ bind(&class_constructor); - { - FrameScope frame(masm, StackFrame::INTERNAL); - __ Push(a1); - __ CallRuntime(Runtime::kThrowConstructorNonCallableError); - } } // static diff --git a/src/builtins/mips/builtins-mips.cc b/src/builtins/mips/builtins-mips.cc index cab3900034..b838e0aa45 100644 --- a/src/builtins/mips/builtins-mips.cc +++ b/src/builtins/mips/builtins-mips.cc @@ -2198,12 +2198,7 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm, // ----------------------------------- __ AssertCallableFunction(a1); - Label class_constructor; __ lw(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); - __ lw(a3, FieldMemOperand(a2, SharedFunctionInfo::kFlagsOffset)); - __ And(kScratchReg, a3, - Operand(SharedFunctionInfo::IsClassConstructorBit::kMask)); - __ Branch(&class_constructor, ne, kScratchReg, Operand(zero_reg)); // Enter the context of the function; ToObject has to run in the function // context, and we also need to take the global proxy from the function @@ -2279,14 +2274,6 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm, __ lhu(a2, FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset)); __ InvokeFunctionCode(a1, no_reg, a2, a0, InvokeType::kJump); - - // The function is a "classConstructor", need to raise an exception. - __ bind(&class_constructor); - { - FrameScope frame(masm, StackFrame::INTERNAL); - __ Push(a1); - __ CallRuntime(Runtime::kThrowConstructorNonCallableError); - } } // static diff --git a/src/builtins/mips64/builtins-mips64.cc b/src/builtins/mips64/builtins-mips64.cc index 3e33068be0..fc122ba543 100644 --- a/src/builtins/mips64/builtins-mips64.cc +++ b/src/builtins/mips64/builtins-mips64.cc @@ -2251,12 +2251,7 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm, // ----------------------------------- __ AssertCallableFunction(a1); - Label class_constructor; __ Ld(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); - __ Lwu(a3, FieldMemOperand(a2, SharedFunctionInfo::kFlagsOffset)); - __ And(kScratchReg, a3, - Operand(SharedFunctionInfo::IsClassConstructorBit::kMask)); - __ Branch(&class_constructor, ne, kScratchReg, Operand(zero_reg)); // Enter the context of the function; ToObject has to run in the function // context, and we also need to take the global proxy from the function @@ -2332,14 +2327,6 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm, __ Lhu(a2, FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset)); __ InvokeFunctionCode(a1, no_reg, a2, a0, InvokeType::kJump); - - // The function is a "classConstructor", need to raise an exception. - __ bind(&class_constructor); - { - FrameScope frame(masm, StackFrame::INTERNAL); - __ Push(a1); - __ CallRuntime(Runtime::kThrowConstructorNonCallableError); - } } // static