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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/stub_code_x64.cc
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index d60227d207974dda81aad9bf566edd88aeef2b17..f679a748d4b9bae0f9ba9808bd84b11b6bcb1810 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -833,6 +833,15 @@ void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
// Push arguments. At this point we only need to preserve kTargetCodeReg.
ASSERT(kTargetCodeReg != RDX);
+ // 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.
+ // TODO(regis): Add this check or proper implementation to other platforms.
+ __ cmpq(FieldAddress(R10, ArgumentsDescriptor::type_args_len_offset()),
+ Immediate(0));
+ Label no_type_args;
+ __ j(EQUAL, &no_type_args, Assembler::kNearJump);
+ __ int3();
+ __ Bind(&no_type_args);
+
// Load number of arguments into RBX.
__ movq(RBX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
__ SmiUntag(RBX);
« 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