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

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

Issue 2411823003: VM support for running Kernel binaries. (Closed)
Patch Set: Address comments Created 4 years, 2 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/flag_list.h ('k') | runtime/vm/flow_graph_inliner.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/globals.h" // Needed here to get TARGET_ARCH_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/cha.h" 10 #include "vm/cha.h"
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 total_code_size, 1128 total_code_size,
1129 targets.Length() * sizeof(uword)); 1129 targets.Length() * sizeof(uword));
1130 } 1130 }
1131 1131
1132 1132
1133 // Returns 'true' if regular code generation should be skipped. 1133 // Returns 'true' if regular code generation should be skipped.
1134 bool FlowGraphCompiler::TryIntrinsify() { 1134 bool FlowGraphCompiler::TryIntrinsify() {
1135 // Intrinsification skips arguments checks, therefore disable if in checked 1135 // Intrinsification skips arguments checks, therefore disable if in checked
1136 // mode. 1136 // mode.
1137 if (FLAG_intrinsify && !isolate()->type_checks()) { 1137 if (FLAG_intrinsify && !isolate()->type_checks()) {
1138 const Class& owner = Class::Handle(parsed_function().function().Owner());
1139 String& name = String::Handle(parsed_function().function().name());
1140
1138 if (parsed_function().function().kind() == RawFunction::kImplicitGetter) { 1141 if (parsed_function().function().kind() == RawFunction::kImplicitGetter) {
1139 // An implicit getter must have a specific AST structure. 1142 // TODO(27590) Store Field object inside RawFunction::data_ if possible.
1140 const SequenceNode& sequence_node = *parsed_function().node_sequence(); 1143 name = Field::NameFromGetter(name);
1141 ASSERT(sequence_node.length() == 1); 1144 const Field& field = Field::Handle(owner.LookupFieldAllowPrivate(name));
1142 ASSERT(sequence_node.NodeAt(0)->IsReturnNode()); 1145 ASSERT(!field.IsNull());
1143 const ReturnNode& return_node = *sequence_node.NodeAt(0)->AsReturnNode(); 1146
1144 ASSERT(return_node.value()->IsLoadInstanceFieldNode());
1145 const LoadInstanceFieldNode& load_node =
1146 *return_node.value()->AsLoadInstanceFieldNode();
1147 // Only intrinsify getter if the field cannot contain a mutable double. 1147 // Only intrinsify getter if the field cannot contain a mutable double.
1148 // Reading from a mutable double box requires allocating a fresh double. 1148 // Reading from a mutable double box requires allocating a fresh double.
1149 if (FLAG_precompiled_mode || 1149 if (field.is_instance() &&
1150 !IsPotentialUnboxedField(load_node.field())) { 1150 (FLAG_precompiled_mode || !IsPotentialUnboxedField(field))) {
1151 GenerateInlinedGetter(load_node.field().Offset()); 1151 GenerateInlinedGetter(field.Offset());
1152 return !FLAG_use_field_guards; 1152 return !FLAG_use_field_guards;
1153 } 1153 }
1154 return false; 1154 return false;
1155 } 1155 }
1156 if (parsed_function().function().kind() == RawFunction::kImplicitSetter) { 1156 if (parsed_function().function().kind() == RawFunction::kImplicitSetter) {
1157 // An implicit setter must have a specific AST structure. 1157 // TODO(27590) Store Field object inside RawFunction::data_ if possible.
1158 // Sequence node has one store node and one return NULL node. 1158 name = Field::NameFromSetter(name);
1159 const SequenceNode& sequence_node = *parsed_function().node_sequence(); 1159 const Field& field = Field::Handle(owner.LookupFieldAllowPrivate(name));
1160 ASSERT(sequence_node.length() == 2); 1160 ASSERT(!field.IsNull());
1161 ASSERT(sequence_node.NodeAt(0)->IsStoreInstanceFieldNode()); 1161
1162 ASSERT(sequence_node.NodeAt(1)->IsReturnNode()); 1162 if (field.is_instance() &&
1163 const StoreInstanceFieldNode& store_node = 1163 (FLAG_precompiled_mode || field.guarded_cid() == kDynamicCid)) {
1164 *sequence_node.NodeAt(0)->AsStoreInstanceFieldNode(); 1164 GenerateInlinedSetter(field.Offset());
1165 if (FLAG_precompiled_mode ||
1166 (store_node.field().guarded_cid() == kDynamicCid)) {
1167 GenerateInlinedSetter(store_node.field().Offset());
1168 return !FLAG_use_field_guards; 1165 return !FLAG_use_field_guards;
1169 } 1166 }
1167 return false;
1170 } 1168 }
1171 } 1169 }
1172 1170
1173 EnterIntrinsicMode(); 1171 EnterIntrinsicMode();
1174 1172
1175 bool complete = Intrinsifier::Intrinsify(parsed_function(), this); 1173 bool complete = Intrinsifier::Intrinsify(parsed_function(), this);
1176 1174
1177 ExitIntrinsicMode(); 1175 ExitIntrinsicMode();
1178 1176
1179 // "Deoptimization" from intrinsic continues here. All deoptimization 1177 // "Deoptimization" from intrinsic continues here. All deoptimization
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
1991 1989
1992 1990
1993 void FlowGraphCompiler::FrameStateClear() { 1991 void FlowGraphCompiler::FrameStateClear() {
1994 ASSERT(!is_optimizing()); 1992 ASSERT(!is_optimizing());
1995 frame_state_.TruncateTo(0); 1993 frame_state_.TruncateTo(0);
1996 } 1994 }
1997 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) 1995 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC)
1998 1996
1999 1997
2000 } // namespace dart 1998 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flag_list.h ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698