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

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

Issue 1126783003: Handle the case when derived constructor is [[Call]]ed with 0 args. (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 unified diff | Download patch
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | test/mjsunit/es6/regress/regress-474783.js » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 StackArgumentsAccessor args(rsp, 3, ARGUMENTS_DONT_CONTAIN_RECEIVER); 955 StackArgumentsAccessor args(rsp, 3, ARGUMENTS_DONT_CONTAIN_RECEIVER);
956 __ movp(rcx, args.GetArgumentOperand(2)); 956 __ movp(rcx, args.GetArgumentOperand(2));
957 __ SmiToInteger64(rcx, rcx); 957 __ SmiToInteger64(rcx, rcx);
958 __ jmp(&try_allocate); 958 __ jmp(&try_allocate);
959 959
960 // Patch the arguments.length and the parameters pointer. 960 // Patch the arguments.length and the parameters pointer.
961 __ bind(&adaptor_frame); 961 __ bind(&adaptor_frame);
962 __ movp(rcx, Operand(rdx, ArgumentsAdaptorFrameConstants::kLengthOffset)); 962 __ movp(rcx, Operand(rdx, ArgumentsAdaptorFrameConstants::kLengthOffset));
963 963
964 if (has_new_target()) { 964 if (has_new_target()) {
965 // If the constructor was [[Call]]ed, the call will not push a new.target
966 // onto the stack. In that case the arguments array we construct is bogus,
967 // bu we do not care as the constructor throws immediately.
968 __ Cmp(rcx, Smi::FromInt(0));
969 Label skip_decrement;
970 __ j(equal, &skip_decrement);
965 // Subtract 1 from smi-tagged arguments count. 971 // Subtract 1 from smi-tagged arguments count.
966 __ SmiToInteger32(rcx, rcx); 972 __ SmiToInteger32(rcx, rcx);
967 __ decl(rcx); 973 __ decl(rcx);
968 __ Integer32ToSmi(rcx, rcx); 974 __ Integer32ToSmi(rcx, rcx);
975 __ bind(&skip_decrement);
969 } 976 }
970 __ movp(args.GetArgumentOperand(2), rcx); 977 __ movp(args.GetArgumentOperand(2), rcx);
971 __ SmiToInteger64(rcx, rcx); 978 __ SmiToInteger64(rcx, rcx);
972 __ leap(rdx, Operand(rdx, rcx, times_pointer_size, 979 __ leap(rdx, Operand(rdx, rcx, times_pointer_size,
973 StandardFrameConstants::kCallerSPOffset)); 980 StandardFrameConstants::kCallerSPOffset));
974 __ movp(args.GetArgumentOperand(1), rdx); 981 __ movp(args.GetArgumentOperand(1), rdx);
975 982
976 // Try the new space allocation. Start out with computing the size of 983 // Try the new space allocation. Start out with computing the size of
977 // the arguments object and the elements array. 984 // the arguments object and the elements array.
978 Label add_arguments_object; 985 Label add_arguments_object;
(...skipping 4375 matching lines...) Expand 10 before | Expand all | Expand 10 after
5354 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, 5361 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg,
5355 kStackSpace, nullptr, return_value_operand, NULL); 5362 kStackSpace, nullptr, return_value_operand, NULL);
5356 } 5363 }
5357 5364
5358 5365
5359 #undef __ 5366 #undef __
5360 5367
5361 } } // namespace v8::internal 5368 } } // namespace v8::internal
5362 5369
5363 #endif // V8_TARGET_ARCH_X64 5370 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/mips64/code-stubs-mips64.cc ('k') | test/mjsunit/es6/regress/regress-474783.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698