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

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

Issue 2761933002: Add Genericity enum in VM to distinguish how a type is uninstantiated. (Closed)
Patch Set: sync 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/jit_optimizer.cc ('k') | runtime/vm/object.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 <map> 5 #include <map>
6 #include <set> 6 #include <set>
7 #include <string> 7 #include <string>
8 8
9 #include "vm/kernel_to_il.h" 9 #include "vm/kernel_to_il.h"
10 10
(...skipping 2094 matching lines...) Expand 10 before | Expand all | Expand 10 after
2105 instructions += LoadLocal(scopes_->this_variable); 2105 instructions += LoadLocal(scopes_->this_variable);
2106 instructions += LoadField(type_arguments_field_offset); 2106 instructions += LoadField(type_arguments_field_offset);
2107 } else { 2107 } else {
2108 instructions += NullConstant(); 2108 instructions += NullConstant();
2109 } 2109 }
2110 return instructions; 2110 return instructions;
2111 } 2111 }
2112 2112
2113 2113
2114 Fragment FlowGraphBuilder::InstantiateType(const AbstractType& type) { 2114 Fragment FlowGraphBuilder::InstantiateType(const AbstractType& type) {
2115 InstantiateTypeInstr* instr = new (Z) InstantiateTypeInstr( 2115 InstantiateTypeInstr* instr = new (Z)
2116 TokenPosition::kNoSource, type, *active_class_.klass, Pop()); 2116 InstantiateTypeInstr(TokenPosition::kNoSource, type, Pop(),
2117 NULL); // TODO(regis): Pop function type arguments.
2117 Push(instr); 2118 Push(instr);
2118 return Fragment(instr); 2119 return Fragment(instr);
2119 } 2120 }
2120 2121
2121 2122
2122 Fragment FlowGraphBuilder::InstantiateTypeArguments( 2123 Fragment FlowGraphBuilder::InstantiateTypeArguments(
2123 const TypeArguments& type_arguments) { 2124 const TypeArguments& type_arguments) {
2124 InstantiateTypeArgumentsInstr* instr = new (Z) InstantiateTypeArgumentsInstr( 2125 InstantiateTypeArgumentsInstr* instr = new (Z) InstantiateTypeArgumentsInstr(
2125 TokenPosition::kNoSource, type_arguments, *active_class_.klass, Pop()); 2126 TokenPosition::kNoSource, type_arguments, *active_class_.klass, Pop(),
2127 NULL); // TODO(regis): Pop function type arguments.
2126 Push(instr); 2128 Push(instr);
2127 return Fragment(instr); 2129 return Fragment(instr);
2128 } 2130 }
2129 2131
2130 2132
2131 Fragment FlowGraphBuilder::TranslateInstantiatedTypeArguments( 2133 Fragment FlowGraphBuilder::TranslateInstantiatedTypeArguments(
2132 const TypeArguments& type_arguments) { 2134 const TypeArguments& type_arguments) {
2133 Fragment instructions; 2135 Fragment instructions;
2134 2136
2135 if (type_arguments.IsNull() || type_arguments.IsInstantiated()) { 2137 if (type_arguments.IsNull() || type_arguments.IsInstantiated()) {
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after
3730 Fragment FlowGraphBuilder::AssertAssignable(const dart::AbstractType& dst_type, 3732 Fragment FlowGraphBuilder::AssertAssignable(const dart::AbstractType& dst_type,
3731 const dart::String& dst_name) { 3733 const dart::String& dst_name) {
3732 Fragment instructions; 3734 Fragment instructions;
3733 Value* value = Pop(); 3735 Value* value = Pop();
3734 3736
3735 instructions += LoadInstantiatorTypeArguments(); 3737 instructions += LoadInstantiatorTypeArguments();
3736 Value* type_args = Pop(); 3738 Value* type_args = Pop();
3737 3739
3738 AssertAssignableInstr* instr = new (Z) 3740 AssertAssignableInstr* instr = new (Z)
3739 AssertAssignableInstr(TokenPosition::kNoSource, value, type_args, 3741 AssertAssignableInstr(TokenPosition::kNoSource, value, type_args,
3742 NULL, // TODO(regis): Pop function type arguments.
3740 dst_type, dst_name, H.thread()->GetNextDeoptId()); 3743 dst_type, dst_name, H.thread()->GetNextDeoptId());
3741 Push(instr); 3744 Push(instr);
3742 3745
3743 instructions += Fragment(instr); 3746 instructions += Fragment(instr);
3744 3747
3745 return instructions; 3748 return instructions;
3746 } 3749 }
3747 3750
3748 3751
3749 FlowGraph* FlowGraphBuilder::BuildGraphOfMethodExtractor( 3752 FlowGraph* FlowGraphBuilder::BuildGraphOfMethodExtractor(
(...skipping 2690 matching lines...) Expand 10 before | Expand all | Expand 10 after
6440 thread->clear_sticky_error(); 6443 thread->clear_sticky_error();
6441 return error.raw(); 6444 return error.raw();
6442 } 6445 }
6443 } 6446 }
6444 6447
6445 6448
6446 } // namespace kernel 6449 } // namespace kernel
6447 } // namespace dart 6450 } // namespace dart
6448 6451
6449 #endif // !defined(DART_PRECOMPILED_RUNTIME) 6452 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW
« no previous file with comments | « runtime/vm/jit_optimizer.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698