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

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

Issue 2859673002: Pass type argument vector to generic functions (if --reify-generic-functions is (Closed)
Patch Set: address review comments and sync Created 3 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 | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/intermediate_language.h » ('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 (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 #if !defined(DART_PRECOMPILED_RUNTIME) 4 #if !defined(DART_PRECOMPILED_RUNTIME)
5 #include "vm/flow_graph_inliner.h" 5 #include "vm/flow_graph_inliner.h"
6 6
7 #include "vm/aot_optimizer.h" 7 #include "vm/aot_optimizer.h"
8 #include "vm/precompiler.h" 8 #include "vm/precompiler.h"
9 #include "vm/block_scheduler.h" 9 #include "vm/block_scheduler.h"
10 #include "vm/branch_optimizer.h" 10 #include "vm/branch_optimizer.h"
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 function.set_is_inlinable(false); 856 function.set_is_inlinable(false);
857 TRACE_INLINING(THR_Print(" Bailout: optional arg mismatch\n")); 857 TRACE_INLINING(THR_Print(" Bailout: optional arg mismatch\n"));
858 PRINT_INLINING_TREE("Optional arg mismatch", &call_data->caller, 858 PRINT_INLINING_TREE("Optional arg mismatch", &call_data->caller,
859 &function, call_data->call); 859 &function, call_data->call);
860 return false; 860 return false;
861 } 861 }
862 } 862 }
863 863
864 // After treating optional parameters the actual/formal count must 864 // After treating optional parameters the actual/formal count must
865 // match. 865 // match.
866 ASSERT(arguments->length() == function.NumParameters()); 866 // TODO(regis): Consider type arguments in arguments.
867 if (arguments->length() != function.NumParameters()) {
868 ASSERT(function.IsGeneric());
869 ASSERT(arguments->length() == function.NumParameters() + 1);
870 TRACE_INLINING(
871 THR_Print(" Bailout: unsupported type arguments\n"));
872 PRINT_INLINING_TREE("Unsupported type arguments", &call_data->caller,
873 &function, call_data->call);
874 return false;
875 }
867 ASSERT(param_stubs->length() == callee_graph->parameter_count()); 876 ASSERT(param_stubs->length() == callee_graph->parameter_count());
868 877
869 // Update try-index of the callee graph. 878 // Update try-index of the callee graph.
870 BlockEntryInstr* call_block = call_data->call->GetBlock(); 879 BlockEntryInstr* call_block = call_data->call->GetBlock();
871 if (call_block->InsideTryBlock()) { 880 if (call_block->InsideTryBlock()) {
872 intptr_t try_index = call_block->try_index(); 881 intptr_t try_index = call_block->try_index();
873 for (BlockIterator it = callee_graph->reverse_postorder_iterator(); 882 for (BlockIterator it = callee_graph->reverse_postorder_iterator();
874 !it.Done(); it.Advance()) { 883 !it.Done(); it.Advance()) {
875 BlockEntryInstr* block = it.Current(); 884 BlockEntryInstr* block = it.Current();
876 block->set_try_index(try_index); 885 block->set_try_index(try_index);
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 const Array& argument_names, 1343 const Array& argument_names,
1335 GrowableArray<Value*>* arguments, 1344 GrowableArray<Value*>* arguments,
1336 ZoneGrowableArray<Definition*>* param_stubs, 1345 ZoneGrowableArray<Definition*>* param_stubs,
1337 FlowGraph* callee_graph) { 1346 FlowGraph* callee_graph) {
1338 const Function& function = parsed_function.function(); 1347 const Function& function = parsed_function.function();
1339 // The language and this code does not support both optional positional 1348 // The language and this code does not support both optional positional
1340 // and optional named parameters for the same function. 1349 // and optional named parameters for the same function.
1341 ASSERT(!function.HasOptionalPositionalParameters() || 1350 ASSERT(!function.HasOptionalPositionalParameters() ||
1342 !function.HasOptionalNamedParameters()); 1351 !function.HasOptionalNamedParameters());
1343 1352
1353 // TODO(regis): Consider type arguments in arguments.
1344 intptr_t arg_count = arguments->length(); 1354 intptr_t arg_count = arguments->length();
1345 intptr_t param_count = function.NumParameters(); 1355 intptr_t param_count = function.NumParameters();
1346 intptr_t fixed_param_count = function.num_fixed_parameters(); 1356 intptr_t fixed_param_count = function.num_fixed_parameters();
1347 ASSERT(fixed_param_count <= arg_count); 1357 ASSERT(fixed_param_count <= arg_count);
1348 ASSERT(arg_count <= param_count); 1358 ASSERT(arg_count <= param_count);
1349 1359
1350 if (function.HasOptionalPositionalParameters()) { 1360 if (function.HasOptionalPositionalParameters()) {
1351 // Create a stub for each optional positional parameters with an actual. 1361 // Create a stub for each optional positional parameters with an actual.
1352 for (intptr_t i = fixed_param_count; i < arg_count; ++i) { 1362 for (intptr_t i = fixed_param_count; i < arg_count; ++i) {
1353 param_stubs->Add(CreateParameterStub(i, (*arguments)[i], callee_graph)); 1363 param_stubs->Add(CreateParameterStub(i, (*arguments)[i], callee_graph));
(...skipping 2429 matching lines...) Expand 10 before | Expand all | Expand 10 after
3783 } 3793 }
3784 3794
3785 default: 3795 default:
3786 return false; 3796 return false;
3787 } 3797 }
3788 } 3798 }
3789 3799
3790 3800
3791 } // namespace dart 3801 } // namespace dart
3792 #endif // !defined(DART_PRECOMPILED_RUNTIME) 3802 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698