From 340627ea26b19f46ae7fa0f1936268c5911d2f6c Mon Sep 17 00:00:00 2001 From: mbrandy Date: Tue, 24 Nov 2015 13:30:23 -0800 Subject: [PATCH] PPC: Install ConstructNonConstructable as construct stub for non-constructables. Port 8e28e851ee8aa60f7102433454e77934b4702715 R=verwaest@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com BUG= Review URL: https://codereview.chromium.org/1471383002 Cr-Commit-Position: refs/heads/master@{#32232} --- src/ppc/builtins-ppc.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/ppc/builtins-ppc.cc b/src/ppc/builtins-ppc.cc index 55671cdea7..dba44d2540 100644 --- a/src/ppc/builtins-ppc.cc +++ b/src/ppc/builtins-ppc.cc @@ -650,6 +650,13 @@ void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { } +void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { + FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); + __ push(r4); + __ CallRuntime(Runtime::kThrowConstructedNonConstructable, 1); +} + + enum IsTagged { kArgcIsSmiTagged, kArgcIsUntaggedInt }; @@ -1708,7 +1715,8 @@ void Builtins::Generate_CallFunction(MacroAssembler* masm, __ bind(&class_constructor); { FrameAndConstantPoolScope frame(masm, StackFrame::INTERNAL); - __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 0); + __ push(r4); + __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 1); } } @@ -1839,11 +1847,8 @@ void Builtins::Generate_Construct(MacroAssembler* masm) { // Called Construct on an Object that doesn't have a [[Construct]] internal // method. __ bind(&non_constructor); - { - FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); - __ Push(r4); - __ CallRuntime(Runtime::kThrowCalledNonCallable, 1); - } + __ Jump(masm->isolate()->builtins()->ConstructedNonConstructable(), + RelocInfo::CODE_TARGET); }