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

Side by Side Diff: runtime/vm/stub_code_x64.cc

Issue 2941643002: Check for a passed-in type argument vector in the prolog of generic functions. (Closed)
Patch Set: Created 3 years, 6 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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 #endif 826 #endif
827 827
828 __ movq(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0)); 828 __ movq(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
829 829
830 // Load arguments descriptor array into R10, which is passed to Dart code. 830 // Load arguments descriptor array into R10, which is passed to Dart code.
831 __ movq(R10, Address(kArgDescReg, VMHandles::kOffsetOfRawPtrInHandle)); 831 __ movq(R10, Address(kArgDescReg, VMHandles::kOffsetOfRawPtrInHandle));
832 832
833 // Push arguments. At this point we only need to preserve kTargetCodeReg. 833 // Push arguments. At this point we only need to preserve kTargetCodeReg.
834 ASSERT(kTargetCodeReg != RDX); 834 ASSERT(kTargetCodeReg != RDX);
835 835
836 // TODO(regis): Do we need to support type arguments when calling from C++?
rmacnak 2017/06/14 00:14:20 Or mirrors? *cringe* Let's not add this until the
regis 2017/06/14 21:02:05 Agreed.
837 // TODO(regis): Add this check or proper implementation to other platforms.
838 __ cmpq(FieldAddress(R10, ArgumentsDescriptor::type_args_len_offset()),
839 Immediate(0));
840 Label no_type_args;
841 __ j(EQUAL, &no_type_args, Assembler::kNearJump);
842 __ int3();
843 __ Bind(&no_type_args);
844
836 // Load number of arguments into RBX. 845 // Load number of arguments into RBX.
837 __ movq(RBX, FieldAddress(R10, ArgumentsDescriptor::count_offset())); 846 __ movq(RBX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
838 __ SmiUntag(RBX); 847 __ SmiUntag(RBX);
839 848
840 // Compute address of 'arguments array' data area into RDX. 849 // Compute address of 'arguments array' data area into RDX.
841 __ movq(RDX, Address(kArgsReg, VMHandles::kOffsetOfRawPtrInHandle)); 850 __ movq(RDX, Address(kArgsReg, VMHandles::kOffsetOfRawPtrInHandle));
842 __ leaq(RDX, FieldAddress(RDX, Array::data_offset())); 851 __ leaq(RDX, FieldAddress(RDX, Array::data_offset()));
843 852
844 // Set up arguments for the Dart call. 853 // Set up arguments for the Dart call.
845 Label push_arguments; 854 Label push_arguments;
(...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after
2319 } 2328 }
2320 2329
2321 2330
2322 void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) { 2331 void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) {
2323 __ int3(); 2332 __ int3();
2324 } 2333 }
2325 2334
2326 } // namespace dart 2335 } // namespace dart
2327 2336
2328 #endif // defined TARGET_ARCH_X64 2337 #endif // defined TARGET_ARCH_X64
OLDNEW
« runtime/vm/parser.cc ('K') | « runtime/vm/scopes.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698