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

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

Issue 1133093004: PPC: [strong] Function arity check should be based on required parameters (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 9c969fd3f902d4279b105e8bc57897d74c8e6cd5..ee89116313a7f9707b8b66436561e6a27d888f41 100644
--- a/src/ppc/builtins-ppc.cc
+++ b/src/ppc/builtins-ppc.cc
@@ -1765,17 +1765,28 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
__ bind(&too_few);
// If the function is strong we need to throw an error.
- Label weak_function;
+ Label no_strong_error;
__ LoadP(r7, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
- __ lwz(r7, FieldMemOperand(r7, SharedFunctionInfo::kCompilerHintsOffset));
- __ TestBit(r7,
+ __ lwz(r8, FieldMemOperand(r7, SharedFunctionInfo::kCompilerHintsOffset));
+ __ TestBit(r8,
#if V8_TARGET_ARCH_PPC64
SharedFunctionInfo::kStrongModeFunction,
#else
SharedFunctionInfo::kStrongModeFunction + kSmiTagSize,
#endif
r0);
- __ beq(&weak_function, cr0);
+ __ beq(&no_strong_error, cr0);
+
+ // What we really care about is the required number of arguments.
+ __ lwa(r7, FieldMemOperand(r7, SharedFunctionInfo::kLengthOffset));
+#if V8_TARGET_ARCH_PPC64
+ // See commment near kLenghtOffset in src/objects.h
+ __ srawi(r7, r7, kSmiTagSize);
+#else
+ __ SmiUntag(r7);
+#endif
+ __ cmp(r3, r7);
+ __ bge(&no_strong_error);
{
FrameScope frame(masm, StackFrame::MANUAL);
@@ -1783,7 +1794,7 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
__ CallRuntime(Runtime::kThrowStrongModeTooFewArguments, 0);
}
- __ bind(&weak_function);
+ __ bind(&no_strong_error);
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