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

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 1272673003: [es6] Re-implement rest parameters via desugaring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Oops. Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after
1951 // Return and remove the on-stack parameters. 1951 // Return and remove the on-stack parameters.
1952 __ bind(&done); 1952 __ bind(&done);
1953 __ DropAndRet(3); 1953 __ DropAndRet(3);
1954 1954
1955 // Do the runtime call to allocate the arguments object. 1955 // Do the runtime call to allocate the arguments object.
1956 __ bind(&runtime); 1956 __ bind(&runtime);
1957 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); 1957 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1);
1958 } 1958 }
1959 1959
1960 1960
1961 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) {
1962 // sp[0] : language mode
1963 // sp[4] : index of rest parameter
1964 // sp[8] : number of parameters
1965 // sp[12] : receiver displacement
1966 // Check if the calling frame is an arguments adaptor frame.
1967
1968 Label runtime;
1969 __ lw(a2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
1970 __ lw(a3, MemOperand(a2, StandardFrameConstants::kContextOffset));
1971 __ Branch(&runtime, ne, a3,
1972 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
1973
1974 // Patch the arguments.length and the parameters pointer.
1975 __ lw(a1, MemOperand(a2, ArgumentsAdaptorFrameConstants::kLengthOffset));
1976 __ sw(a1, MemOperand(sp, 2 * kPointerSize));
1977 __ sll(at, a1, kPointerSizeLog2 - kSmiTagSize);
1978 __ Addu(a3, a2, Operand(at));
1979
1980 __ Addu(a3, a3, Operand(StandardFrameConstants::kCallerSPOffset));
1981 __ sw(a3, MemOperand(sp, 3 * kPointerSize));
1982
1983 // Do the runtime call to allocate the arguments object.
1984 __ bind(&runtime);
1985 __ TailCallRuntime(Runtime::kNewRestParam, 4, 1);
1986 }
1987
1988
1989 void RegExpExecStub::Generate(MacroAssembler* masm) { 1961 void RegExpExecStub::Generate(MacroAssembler* masm) {
1990 // Just jump directly to runtime if native RegExp is not selected at compile 1962 // Just jump directly to runtime if native RegExp is not selected at compile
1991 // time or if regexp entry in generated code is turned off runtime switch or 1963 // time or if regexp entry in generated code is turned off runtime switch or
1992 // at compilation. 1964 // at compilation.
1993 #ifdef V8_INTERPRETED_REGEXP 1965 #ifdef V8_INTERPRETED_REGEXP
1994 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); 1966 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
1995 #else // V8_INTERPRETED_REGEXP 1967 #else // V8_INTERPRETED_REGEXP
1996 1968
1997 // Stack frame on entry. 1969 // Stack frame on entry.
1998 // sp[0]: last_match_info (expected JSArray) 1970 // sp[0]: last_match_info (expected JSArray)
(...skipping 3661 matching lines...) Expand 10 before | Expand all | Expand 10 after
5660 MemOperand(fp, 6 * kPointerSize), NULL); 5632 MemOperand(fp, 6 * kPointerSize), NULL);
5661 } 5633 }
5662 5634
5663 5635
5664 #undef __ 5636 #undef __
5665 5637
5666 } // namespace internal 5638 } // namespace internal
5667 } // namespace v8 5639 } // namespace v8
5668 5640
5669 #endif // V8_TARGET_ARCH_MIPS 5641 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | src/parser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698