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

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

Issue 1132153003: PPC: [strong] Check arity of functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months 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 eed082d6f95865906b54f1a3b57707560c753a14..9c969fd3f902d4279b105e8bc57897d74c8e6cd5 100644
--- a/src/ppc/builtins-ppc.cc
+++ b/src/ppc/builtins-ppc.cc
@@ -1763,6 +1763,27 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
{ // Too few parameters: Actual < expected
__ bind(&too_few);
+
+ // If the function is strong we need to throw an error.
+ Label weak_function;
+ __ LoadP(r7, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
+ __ lwz(r7, FieldMemOperand(r7, SharedFunctionInfo::kCompilerHintsOffset));
+ __ TestBit(r7,
+#if V8_TARGET_ARCH_PPC64
paul.l... 2015/05/12 01:49:49 Can you avoid ifdef here by using SharedFunctionIn
MTBrandyberry 2015/05/12 13:49:05 Makes sense. I'll look at doing this in a future
+ SharedFunctionInfo::kStrongModeFunction,
+#else
+ SharedFunctionInfo::kStrongModeFunction + kSmiTagSize,
+#endif
+ r0);
+ __ beq(&weak_function, cr0);
+
+ {
+ FrameScope frame(masm, StackFrame::MANUAL);
+ EnterArgumentsAdaptorFrame(masm);
+ __ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0);
+ }
+
+ __ bind(&weak_function);
EnterArgumentsAdaptorFrame(masm);
// Calculate copy start address into r0 and copy end address is fp.
« 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