Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1062)

Unified Diff: src/ppc/builtins-ppc.cc

Issue 1510283002: PPC: Refine "[runtime] [proxy] implement [[Construct]]" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/builtins-ppc.cc
diff --git a/src/ppc/builtins-ppc.cc b/src/ppc/builtins-ppc.cc
index bce0b633346a8b022318d85c59956d53401970fc..2d695ae6f9ab649483f78dd1c1666b2eeeb8af9f 100644
--- a/src/ppc/builtins-ppc.cc
+++ b/src/ppc/builtins-ppc.cc
@@ -1765,8 +1765,7 @@ void Builtins::Generate_ConstructProxy(MacroAssembler* masm) {
// -----------------------------------
// Call into the Runtime for Proxy [[Construct]].
- __ Push(r4);
- __ Push(r6);
+ __ Push(r4, r6);
// Include the pushed new_target, constructor and the receiver.
__ addi(r3, r3, Operand(3));
// Tail-call to the runtime.
@@ -1792,15 +1791,17 @@ void Builtins::Generate_Construct(MacroAssembler* masm) {
__ CompareObjectType(r4, r7, r8, JS_FUNCTION_TYPE);
__ Jump(masm->isolate()->builtins()->ConstructFunction(),
RelocInfo::CODE_TARGET, eq);
- __ cmpi(r8, Operand(JS_PROXY_TYPE));
- __ Jump(masm->isolate()->builtins()->ConstructProxy(), RelocInfo::CODE_TARGET,
- eq);
// Check if target has a [[Construct]] internal method.
__ lbz(r5, FieldMemOperand(r7, Map::kBitFieldOffset));
__ TestBit(r5, Map::kIsConstructor, r0);
__ beq(&non_constructor, cr0);
+ // Only dispatch to proxies after checking whether they are constructors.
+ __ cmpi(r8, Operand(JS_PROXY_TYPE));
+ __ Jump(masm->isolate()->builtins()->ConstructProxy(), RelocInfo::CODE_TARGET,
+ eq);
+
// Called Construct on an exotic Object with a [[Construct]] internal method.
{
// Overwrite the original receiver with the (original) target.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698