Index: src/arm64/builtins-arm64.cc |
diff --git a/src/arm64/builtins-arm64.cc b/src/arm64/builtins-arm64.cc |
index f7646588626411f2ceab1c927d055536d9e592ce..f3871f40d4d90c8fb84057f97935a68d717f792e 100644 |
--- a/src/arm64/builtins-arm64.cc |
+++ b/src/arm64/builtins-arm64.cc |
@@ -661,6 +661,13 @@ void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { |
} |
+void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
+ __ Push(x1); |
+ __ CallRuntime(Runtime::kThrowConstructedNonConstructable, 1); |
+} |
+ |
+ |
enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; |
@@ -1680,7 +1687,8 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm, |
__ bind(&class_constructor); |
{ |
FrameScope frame(masm, StackFrame::INTERNAL); |
- __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 0); |
+ __ Push(x1); |
+ __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 1); |
} |
} |
@@ -1807,11 +1815,8 @@ void Builtins::Generate_Construct(MacroAssembler* masm) { |
// Called Construct on an Object that doesn't have a [[Construct]] internal |
// method. |
__ bind(&non_constructor); |
- { |
- FrameScope scope(masm, StackFrame::INTERNAL); |
- __ Push(x1); |
- __ CallRuntime(Runtime::kThrowCalledNonCallable, 1); |
- } |
+ __ Jump(masm->isolate()->builtins()->ConstructedNonConstructable(), |
+ RelocInfo::CODE_TARGET); |
} |