| Index: src/mips64/builtins-mips64.cc
|
| diff --git a/src/mips64/builtins-mips64.cc b/src/mips64/builtins-mips64.cc
|
| index 389d39be6c824ae1659a696ab04eaa58a13e21cb..0c29d0becda7c42a29d3ce3e9e695cddea229d5b 100644
|
| --- a/src/mips64/builtins-mips64.cc
|
| +++ b/src/mips64/builtins-mips64.cc
|
| @@ -1560,8 +1560,24 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm) {
|
|
|
| Label convert, convert_global_proxy, convert_to_object, done_convert;
|
| __ AssertFunction(a1);
|
| - // TODO(bmeurer): Throw a TypeError if function's [[FunctionKind]] internal
|
| - // slot is "classConstructor".
|
| + __ ld(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
|
| +
|
| + {
|
| + Label non_class_constructor;
|
| + // Check whether the current function is a classConstructor
|
| + __ lbu(a3, FieldMemOperand(a2, SharedFunctionInfo::kCompilerHintsOffset));
|
| + __ And(at, a3, Operand((1 << SharedFunctionInfo::kIsDefaultConstructor) |
|
| + (1 << SharedFunctionInfo::kIsSubclassConstructor) |
|
| + (1 << SharedFunctionInfo::kIsBaseConstructor)));
|
| + __ Branch(&non_class_constructor, eq, at, Operand(zero_reg));
|
| + // Step: 2, If we call a classConstructor Function throw a TypeError.
|
| + {
|
| + FrameScope frame(masm, StackFrame::INTERNAL);
|
| + __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 0);
|
| + }
|
| + __ bind(&non_class_constructor);
|
| + }
|
| +
|
| // 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 in case of conversion.
|
| @@ -1569,7 +1585,6 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm) {
|
| STATIC_ASSERT(SharedFunctionInfo::kNativeByteOffset ==
|
| SharedFunctionInfo::kStrictModeByteOffset);
|
| __ ld(cp, FieldMemOperand(a1, JSFunction::kContextOffset));
|
| - __ ld(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
|
| // We need to convert the receiver for non-native sloppy mode functions.
|
| __ lbu(a3, FieldMemOperand(a2, SharedFunctionInfo::kNativeByteOffset));
|
| __ And(at, a3, Operand((1 << SharedFunctionInfo::kNativeBitWithinByte) |
|
|
|