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

Side by Side Diff: src/ppc/builtins-ppc.cc

Issue 1499593003: [runtime] [proxy] Implementing [[Call]] (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updating comment 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 unified diff | Download patch
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_PPC 5 #if V8_TARGET_ARCH_PPC
6 6
7 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1691 1691
1692 Label non_callable, non_function, non_smi; 1692 Label non_callable, non_function, non_smi;
1693 __ JumpIfSmi(r4, &non_callable); 1693 __ JumpIfSmi(r4, &non_callable);
1694 __ bind(&non_smi); 1694 __ bind(&non_smi);
1695 __ CompareObjectType(r4, r7, r8, JS_FUNCTION_TYPE); 1695 __ CompareObjectType(r4, r7, r8, JS_FUNCTION_TYPE);
1696 __ Jump(masm->isolate()->builtins()->CallFunction(mode), 1696 __ Jump(masm->isolate()->builtins()->CallFunction(mode),
1697 RelocInfo::CODE_TARGET, eq); 1697 RelocInfo::CODE_TARGET, eq);
1698 __ cmpi(r8, Operand(JS_PROXY_TYPE)); 1698 __ cmpi(r8, Operand(JS_PROXY_TYPE));
1699 __ bne(&non_function); 1699 __ bne(&non_function);
1700 1700
1701 // 1. Call to proxy. 1701 // 1. Runtime fallback for Proxy [[Call]].
1702 // TODO(neis): Implement [[Call]] on proxies. 1702 __ Push(r4);
1703 // Increase the arguments size to include the pushed function and the
1704 // existing receiver on the stack.
1705 __ addi(r3, r3, Operand(2));
1706 // Tail-call to the runtime.
1707 __ JumpToExternalReference(
1708 ExternalReference(Runtime::kJSProxyCall, masm->isolate()));
1703 1709
1704 // 2. Call to something else, which might have a [[Call]] internal method (if 1710 // 2. Call to something else, which might have a [[Call]] internal method (if
1705 // not we raise an exception). 1711 // not we raise an exception).
1706 __ bind(&non_function); 1712 __ bind(&non_function);
1707 // Check if target has a [[Call]] internal method. 1713 // Check if target has a [[Call]] internal method.
1708 __ lbz(r7, FieldMemOperand(r7, Map::kBitFieldOffset)); 1714 __ lbz(r7, FieldMemOperand(r7, Map::kBitFieldOffset));
1709 __ TestBit(r7, Map::kIsCallable, r0); 1715 __ TestBit(r7, Map::kIsCallable, r0);
1710 __ beq(&non_callable, cr0); 1716 __ beq(&non_callable, cr0);
1711 // Overwrite the original receiver the (original) target. 1717 // Overwrite the original receiver the (original) target.
1712 __ ShiftLeftImm(r8, r3, Operand(kPointerSizeLog2)); 1718 __ ShiftLeftImm(r8, r3, Operand(kPointerSizeLog2));
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1965 __ bkpt(0); 1971 __ bkpt(0);
1966 } 1972 }
1967 } 1973 }
1968 1974
1969 1975
1970 #undef __ 1976 #undef __
1971 } // namespace internal 1977 } // namespace internal
1972 } // namespace v8 1978 } // namespace v8
1973 1979
1974 #endif // V8_TARGET_ARCH_PPC 1980 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698