[loong64][mips]Remove ClassConstructor check from CallFunction
Port commit 99a5bb7484
Change-Id: I39c6bc91b487a2c8ec8ae4e226e4db57c018d222
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3419797
Auto-Submit: Yu Liu <liuyu@loongson.cn>
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#78803}
This commit is contained in:
parent
e62a3f038d
commit
3b233c9f25
@ -2263,12 +2263,7 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm,
|
|||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
__ AssertCallableFunction(a1);
|
__ AssertCallableFunction(a1);
|
||||||
|
|
||||||
Label class_constructor;
|
|
||||||
__ Ld_d(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
|
__ 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
|
// 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
|
// 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(
|
__ Ld_hu(
|
||||||
a2, FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset));
|
a2, FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset));
|
||||||
__ InvokeFunctionCode(a1, no_reg, a2, a0, InvokeType::kJump);
|
__ 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
|
// static
|
||||||
|
@ -2198,12 +2198,7 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm,
|
|||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
__ AssertCallableFunction(a1);
|
__ AssertCallableFunction(a1);
|
||||||
|
|
||||||
Label class_constructor;
|
|
||||||
__ lw(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
|
__ 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
|
// 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
|
// 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,
|
__ lhu(a2,
|
||||||
FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset));
|
FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset));
|
||||||
__ InvokeFunctionCode(a1, no_reg, a2, a0, InvokeType::kJump);
|
__ 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
|
// static
|
||||||
|
@ -2251,12 +2251,7 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm,
|
|||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
__ AssertCallableFunction(a1);
|
__ AssertCallableFunction(a1);
|
||||||
|
|
||||||
Label class_constructor;
|
|
||||||
__ Ld(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
|
__ 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
|
// 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
|
// 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,
|
__ Lhu(a2,
|
||||||
FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset));
|
FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset));
|
||||||
__ InvokeFunctionCode(a1, no_reg, a2, a0, InvokeType::kJump);
|
__ 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
|
// static
|
||||||
|
Loading…
Reference in New Issue
Block a user