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

Unified Diff: runtime/vm/kernel_to_il.cc

Issue 2792033002: [kernel] vm: Fix a few issues in the kernel flow graph builder, update status file for checked-mode (Closed)
Patch Set: addressed comments Created 3 years, 9 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
« no previous file with comments | « runtime/vm/compiler.cc ('k') | tests/co19/co19-kernel.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_to_il.cc
diff --git a/runtime/vm/kernel_to_il.cc b/runtime/vm/kernel_to_il.cc
index b64ca2809b8411be4f61711f823fbf9364ea8f2b..100610e1f1914db2d45a34242a66ec73ccd87b89 100644
--- a/runtime/vm/kernel_to_il.cc
+++ b/runtime/vm/kernel_to_il.cc
@@ -4963,9 +4963,8 @@ void FlowGraphBuilder::VisitConstructorInvocation(ConstructorInvocation* node) {
// Check for malbounded-ness of type.
if (I->type_checks()) {
List<DartType>& kernel_type_arguments = node->arguments()->types();
- const TypeArguments& type_arguments = T.TranslateInstantiatedTypeArguments(
- klass, kernel_type_arguments.raw_array(),
- kernel_type_arguments.length());
+ const TypeArguments& type_arguments = T.TranslateTypeArguments(
+ kernel_type_arguments.raw_array(), kernel_type_arguments.length());
AbstractType& type = AbstractType::Handle(
Z, Type::New(klass, type_arguments, TokenPosition::kNoSource));
@@ -6451,33 +6450,37 @@ RawObject* BuildParameterDescriptor(TreeNode* const kernel_node) {
ConstantEvaluator constant_evaluator(/* flow_graph_builder = */ NULL, Z,
&translation_helper, &type_translator);
-
- intptr_t param_count = function_node->positional_parameters().length() +
- function_node->named_parameters().length();
+ const intptr_t positional_count =
+ function_node->positional_parameters().length();
+ const intptr_t param_count =
+ positional_count + function_node->named_parameters().length();
const Array& param_descriptor = Array::Handle(
Array::New(param_count * Parser::kParameterEntrySize, Heap::kOld));
for (intptr_t i = 0; i < param_count; ++i) {
+ const intptr_t entry_start = i * Parser::kParameterEntrySize;
+
VariableDeclaration* variable;
- if (i < function_node->positional_parameters().length()) {
+ if (i < positional_count) {
variable = function_node->positional_parameters()[i];
} else {
- variable = function_node->named_parameters()[i];
+ variable = function_node->named_parameters()[i - positional_count];
}
param_descriptor.SetAt(
- i + Parser::kParameterIsFinalOffset,
+ entry_start + Parser::kParameterIsFinalOffset,
variable->IsFinal() ? Bool::True() : Bool::False());
if (variable->initializer() != NULL) {
param_descriptor.SetAt(
- i + Parser::kParameterDefaultValueOffset,
+ entry_start + Parser::kParameterDefaultValueOffset,
constant_evaluator.EvaluateExpression(variable->initializer()));
} else {
- param_descriptor.SetAt(i + Parser::kParameterDefaultValueOffset,
- Object::null_instance());
+ param_descriptor.SetAt(
+ entry_start + Parser::kParameterDefaultValueOffset,
+ Object::null_instance());
}
- param_descriptor.SetAt(i + Parser::kParameterMetadataOffset,
+ param_descriptor.SetAt(entry_start + Parser::kParameterMetadataOffset,
/* Issue(28434): Missing parameter metadata. */
Object::null_instance());
}
« no previous file with comments | « runtime/vm/compiler.cc ('k') | tests/co19/co19-kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698