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

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

Issue 2818273002: Remove parent_level field of function type parameters. (Closed)
Patch Set: address comments Created 3 years, 8 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_builder.cc ('k') | runtime/vm/kernel_reader.cc » ('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 4
5 #include "vm/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/bootstrap.h" 8 #include "vm/bootstrap.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/constant_propagator.h" 10 #include "vm/constant_propagator.h"
(...skipping 2046 matching lines...) Expand 10 before | Expand all | Expand 10 after
2057 2057
2058 return this; 2058 return this;
2059 } 2059 }
2060 2060
2061 2061
2062 Definition* AssertAssignableInstr::Canonicalize(FlowGraph* flow_graph) { 2062 Definition* AssertAssignableInstr::Canonicalize(FlowGraph* flow_graph) {
2063 if (FLAG_eliminate_type_checks && 2063 if (FLAG_eliminate_type_checks &&
2064 value()->Type()->IsAssignableTo(dst_type())) { 2064 value()->Type()->IsAssignableTo(dst_type())) {
2065 return value()->definition(); 2065 return value()->definition();
2066 } 2066 }
2067 2067 if (dst_type().IsInstantiated()) {
2068 return this;
2069 }
2068 // For uninstantiated target types: If the instantiator and function 2070 // For uninstantiated target types: If the instantiator and function
2069 // type arguments are constant, instantiate the target type here. 2071 // type arguments are constant, instantiate the target type here.
2070 // If the uninstantiated type refers to parent function type parameters, we
2071 // cannot instantiated it here.
2072 if (dst_type().IsInstantiated() ||
2073 !dst_type().IsInstantiated(kParentFunctions)) {
2074 return this;
2075 }
2076
2077 ConstantInstr* constant_instantiator_type_args = 2072 ConstantInstr* constant_instantiator_type_args =
2078 instantiator_type_arguments()->definition()->AsConstant(); 2073 instantiator_type_arguments()->definition()->AsConstant();
2079 ConstantInstr* constant_function_type_args = 2074 ConstantInstr* constant_function_type_args =
2080 function_type_arguments()->definition()->AsConstant(); 2075 function_type_arguments()->definition()->AsConstant();
2081 if ((constant_instantiator_type_args != NULL) && 2076 if ((constant_instantiator_type_args != NULL) &&
2082 (constant_function_type_args != NULL)) { 2077 (constant_function_type_args != NULL)) {
2083 ASSERT(constant_instantiator_type_args->value().IsNull() || 2078 ASSERT(constant_instantiator_type_args->value().IsNull() ||
2084 constant_instantiator_type_args->value().IsTypeArguments()); 2079 constant_instantiator_type_args->value().IsTypeArguments());
2085 ASSERT(constant_function_type_args->value().IsNull() || 2080 ASSERT(constant_function_type_args->value().IsNull() ||
2086 constant_function_type_args->value().IsTypeArguments()); 2081 constant_function_type_args->value().IsTypeArguments());
(...skipping 1920 matching lines...) Expand 10 before | Expand all | Expand 10 after
4007 "native function '%s' (%" Pd " arguments) cannot be found", 4002 "native function '%s' (%" Pd " arguments) cannot be found",
4008 native_name().ToCString(), function().NumParameters()); 4003 native_name().ToCString(), function().NumParameters());
4009 } 4004 }
4010 set_is_auto_scope(auto_setup_scope); 4005 set_is_auto_scope(auto_setup_scope);
4011 set_native_c_function(native_function); 4006 set_native_c_function(native_function);
4012 } 4007 }
4013 4008
4014 #undef __ 4009 #undef __
4015 4010
4016 } // namespace dart 4011 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/kernel_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698