| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/code_descriptors.h" | 9 #include "vm/code_descriptors.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 | 36 |
| 37 static const String& PrivateCoreLibName(const String& str) { | 37 static const String& PrivateCoreLibName(const String& str) { |
| 38 const Library& core_lib = Library::Handle(Library::CoreLibrary()); | 38 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
| 39 const String& private_name = String::ZoneHandle(core_lib.PrivateName(str)); | 39 const String& private_name = String::ZoneHandle(core_lib.PrivateName(str)); |
| 40 return private_name; | 40 return private_name; |
| 41 } | 41 } |
| 42 | 42 |
| 43 | 43 |
| 44 FlowGraphBuilder::FlowGraphBuilder(const ParsedFunction& parsed_function, | 44 FlowGraphBuilder::FlowGraphBuilder(const ParsedFunction& parsed_function, |
| 45 const Array& ic_data_array, |
| 45 InlineExitCollector* exit_collector) | 46 InlineExitCollector* exit_collector) |
| 46 : parsed_function_(parsed_function), | 47 : parsed_function_(parsed_function), |
| 48 ic_data_array_(ic_data_array), |
| 47 num_copied_params_(parsed_function.num_copied_params()), | 49 num_copied_params_(parsed_function.num_copied_params()), |
| 48 // All parameters are copied if any parameter is. | 50 // All parameters are copied if any parameter is. |
| 49 num_non_copied_params_((num_copied_params_ == 0) | 51 num_non_copied_params_((num_copied_params_ == 0) |
| 50 ? parsed_function.function().num_fixed_parameters() | 52 ? parsed_function.function().num_fixed_parameters() |
| 51 : 0), | 53 : 0), |
| 52 num_stack_locals_(parsed_function.num_stack_locals()), | 54 num_stack_locals_(parsed_function.num_stack_locals()), |
| 53 exit_collector_(exit_collector), | 55 exit_collector_(exit_collector), |
| 54 last_used_block_id_(0), // 0 is used for the graph entry. | 56 last_used_block_id_(0), // 0 is used for the graph entry. |
| 55 context_level_(0), | 57 context_level_(0), |
| 56 last_used_try_index_(CatchClauseNode::kInvalidTryIndex), | 58 last_used_try_index_(CatchClauseNode::kInvalidTryIndex), |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 921 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 920 new ZoneGrowableArray<PushArgumentInstr*>(2); | 922 new ZoneGrowableArray<PushArgumentInstr*>(2); |
| 921 arguments->Add(push_left); | 923 arguments->Add(push_left); |
| 922 arguments->Add(push_right); | 924 arguments->Add(push_right); |
| 923 const String& name = String::ZoneHandle(Symbols::New(node->Name())); | 925 const String& name = String::ZoneHandle(Symbols::New(node->Name())); |
| 924 InstanceCallInstr* call = new InstanceCallInstr(node->token_pos(), | 926 InstanceCallInstr* call = new InstanceCallInstr(node->token_pos(), |
| 925 name, | 927 name, |
| 926 node->kind(), | 928 node->kind(), |
| 927 arguments, | 929 arguments, |
| 928 Array::ZoneHandle(), | 930 Array::ZoneHandle(), |
| 929 2); | 931 2, |
| 932 owner()->ic_data_array()); |
| 930 ReturnDefinition(call); | 933 ReturnDefinition(call); |
| 931 } | 934 } |
| 932 | 935 |
| 933 | 936 |
| 934 // Special handling for AND/OR. | 937 // Special handling for AND/OR. |
| 935 void ValueGraphVisitor::VisitBinaryOpNode(BinaryOpNode* node) { | 938 void ValueGraphVisitor::VisitBinaryOpNode(BinaryOpNode* node) { |
| 936 // Operators "&&" and "||" cannot be overloaded therefore do not call | 939 // Operators "&&" and "||" cannot be overloaded therefore do not call |
| 937 // operator. | 940 // operator. |
| 938 if ((node->kind() == Token::kAND) || (node->kind() == Token::kOR)) { | 941 if ((node->kind() == Token::kAND) || (node->kind() == Token::kOR)) { |
| 939 // Implement short-circuit logic: do not evaluate right if evaluation | 942 // Implement short-circuit logic: do not evaluate right if evaluation |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 Bool::False(); | 1164 Bool::False(); |
| 1162 Value* negate_arg = Bind(new ConstantInstr(negate)); | 1165 Value* negate_arg = Bind(new ConstantInstr(negate)); |
| 1163 arguments->Add(PushArgument(negate_arg)); | 1166 arguments->Add(PushArgument(negate_arg)); |
| 1164 const intptr_t kNumArgsChecked = 1; | 1167 const intptr_t kNumArgsChecked = 1; |
| 1165 InstanceCallInstr* call = new InstanceCallInstr( | 1168 InstanceCallInstr* call = new InstanceCallInstr( |
| 1166 node->token_pos(), | 1169 node->token_pos(), |
| 1167 PrivateCoreLibName(Symbols::_instanceOf()), | 1170 PrivateCoreLibName(Symbols::_instanceOf()), |
| 1168 node->kind(), | 1171 node->kind(), |
| 1169 arguments, | 1172 arguments, |
| 1170 Array::ZoneHandle(), // No argument names. | 1173 Array::ZoneHandle(), // No argument names. |
| 1171 kNumArgsChecked); | 1174 kNumArgsChecked, |
| 1175 owner()->ic_data_array()); |
| 1172 ReturnDefinition(call); | 1176 ReturnDefinition(call); |
| 1173 } | 1177 } |
| 1174 | 1178 |
| 1175 | 1179 |
| 1176 void EffectGraphVisitor::BuildTypeCast(ComparisonNode* node) { | 1180 void EffectGraphVisitor::BuildTypeCast(ComparisonNode* node) { |
| 1177 ASSERT(Token::IsTypeCastOperator(node->kind())); | 1181 ASSERT(Token::IsTypeCastOperator(node->kind())); |
| 1178 const AbstractType& type = node->right()->AsTypeNode()->type(); | 1182 const AbstractType& type = node->right()->AsTypeNode()->type(); |
| 1179 ASSERT(type.IsFinalized()); // The type in a type cast may be malformed. | 1183 ASSERT(type.IsFinalized()); // The type in a type cast may be malformed. |
| 1180 ValueGraphVisitor for_value(owner(), temp_index()); | 1184 ValueGraphVisitor for_value(owner(), temp_index()); |
| 1181 node->left()->Visit(&for_value); | 1185 node->left()->Visit(&for_value); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 arguments->Add(push_type_args); | 1234 arguments->Add(push_type_args); |
| 1231 Value* type_arg = Bind(new ConstantInstr(type)); | 1235 Value* type_arg = Bind(new ConstantInstr(type)); |
| 1232 arguments->Add(PushArgument(type_arg)); | 1236 arguments->Add(PushArgument(type_arg)); |
| 1233 const intptr_t kNumArgsChecked = 1; | 1237 const intptr_t kNumArgsChecked = 1; |
| 1234 InstanceCallInstr* call = new InstanceCallInstr( | 1238 InstanceCallInstr* call = new InstanceCallInstr( |
| 1235 node->token_pos(), | 1239 node->token_pos(), |
| 1236 PrivateCoreLibName(Symbols::_as()), | 1240 PrivateCoreLibName(Symbols::_as()), |
| 1237 node->kind(), | 1241 node->kind(), |
| 1238 arguments, | 1242 arguments, |
| 1239 Array::ZoneHandle(), // No argument names. | 1243 Array::ZoneHandle(), // No argument names. |
| 1240 kNumArgsChecked); | 1244 kNumArgsChecked, |
| 1245 owner()->ic_data_array()); |
| 1241 ReturnDefinition(call); | 1246 ReturnDefinition(call); |
| 1242 } | 1247 } |
| 1243 } | 1248 } |
| 1244 | 1249 |
| 1245 | 1250 |
| 1246 // <Expression> :: Comparison { kind: Token::Kind | 1251 // <Expression> :: Comparison { kind: Token::Kind |
| 1247 // left: <Expression> | 1252 // left: <Expression> |
| 1248 // right: <Expression> } | 1253 // right: <Expression> } |
| 1249 // TODO(srdjan): Implement new equality. | 1254 // TODO(srdjan): Implement new equality. |
| 1250 void EffectGraphVisitor::VisitComparisonNode(ComparisonNode* node) { | 1255 void EffectGraphVisitor::VisitComparisonNode(ComparisonNode* node) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1275 node->left()->Visit(&for_left_value); | 1280 node->left()->Visit(&for_left_value); |
| 1276 Append(for_left_value); | 1281 Append(for_left_value); |
| 1277 ValueGraphVisitor for_right_value(owner(), temp_index()); | 1282 ValueGraphVisitor for_right_value(owner(), temp_index()); |
| 1278 node->right()->Visit(&for_right_value); | 1283 node->right()->Visit(&for_right_value); |
| 1279 Append(for_right_value); | 1284 Append(for_right_value); |
| 1280 if (FLAG_enable_type_checks) { | 1285 if (FLAG_enable_type_checks) { |
| 1281 EqualityCompareInstr* comp = new EqualityCompareInstr( | 1286 EqualityCompareInstr* comp = new EqualityCompareInstr( |
| 1282 node->token_pos(), | 1287 node->token_pos(), |
| 1283 Token::kEQ, | 1288 Token::kEQ, |
| 1284 for_left_value.value(), | 1289 for_left_value.value(), |
| 1285 for_right_value.value()); | 1290 for_right_value.value(), |
| 1291 owner()->ic_data_array()); |
| 1286 if (node->kind() == Token::kEQ) { | 1292 if (node->kind() == Token::kEQ) { |
| 1287 ReturnDefinition(comp); | 1293 ReturnDefinition(comp); |
| 1288 } else { | 1294 } else { |
| 1289 Value* eq_result = Bind(comp); | 1295 Value* eq_result = Bind(comp); |
| 1290 eq_result = Bind(new AssertBooleanInstr(node->token_pos(), eq_result)); | 1296 eq_result = Bind(new AssertBooleanInstr(node->token_pos(), eq_result)); |
| 1291 ReturnDefinition(new BooleanNegateInstr(eq_result)); | 1297 ReturnDefinition(new BooleanNegateInstr(eq_result)); |
| 1292 } | 1298 } |
| 1293 } else { | 1299 } else { |
| 1294 EqualityCompareInstr* comp = new EqualityCompareInstr( | 1300 EqualityCompareInstr* comp = new EqualityCompareInstr( |
| 1295 node->token_pos(), | 1301 node->token_pos(), |
| 1296 node->kind(), | 1302 node->kind(), |
| 1297 for_left_value.value(), | 1303 for_left_value.value(), |
| 1298 for_right_value.value()); | 1304 for_right_value.value(), |
| 1305 owner()->ic_data_array()); |
| 1299 ReturnDefinition(comp); | 1306 ReturnDefinition(comp); |
| 1300 } | 1307 } |
| 1301 return; | 1308 return; |
| 1302 } | 1309 } |
| 1303 | 1310 |
| 1304 ValueGraphVisitor for_left_value(owner(), temp_index()); | 1311 ValueGraphVisitor for_left_value(owner(), temp_index()); |
| 1305 node->left()->Visit(&for_left_value); | 1312 node->left()->Visit(&for_left_value); |
| 1306 Append(for_left_value); | 1313 Append(for_left_value); |
| 1307 ValueGraphVisitor for_right_value(owner(), temp_index()); | 1314 ValueGraphVisitor for_right_value(owner(), temp_index()); |
| 1308 node->right()->Visit(&for_right_value); | 1315 node->right()->Visit(&for_right_value); |
| 1309 Append(for_right_value); | 1316 Append(for_right_value); |
| 1310 RelationalOpInstr* comp = new RelationalOpInstr(node->token_pos(), | 1317 RelationalOpInstr* comp = new RelationalOpInstr(node->token_pos(), |
| 1311 node->kind(), | 1318 node->kind(), |
| 1312 for_left_value.value(), | 1319 for_left_value.value(), |
| 1313 for_right_value.value()); | 1320 for_right_value.value(), |
| 1321 owner()->ic_data_array()); |
| 1314 ReturnDefinition(comp); | 1322 ReturnDefinition(comp); |
| 1315 } | 1323 } |
| 1316 | 1324 |
| 1317 | 1325 |
| 1318 void EffectGraphVisitor::VisitUnaryOpNode(UnaryOpNode* node) { | 1326 void EffectGraphVisitor::VisitUnaryOpNode(UnaryOpNode* node) { |
| 1319 // "!" cannot be overloaded, therefore do not call operator. | 1327 // "!" cannot be overloaded, therefore do not call operator. |
| 1320 if (node->kind() == Token::kNOT) { | 1328 if (node->kind() == Token::kNOT) { |
| 1321 ValueGraphVisitor for_value(owner(), temp_index()); | 1329 ValueGraphVisitor for_value(owner(), temp_index()); |
| 1322 node->operand()->Visit(&for_value); | 1330 node->operand()->Visit(&for_value); |
| 1323 Append(for_value); | 1331 Append(for_value); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1338 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 1346 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 1339 new ZoneGrowableArray<PushArgumentInstr*>(1); | 1347 new ZoneGrowableArray<PushArgumentInstr*>(1); |
| 1340 arguments->Add(push_value); | 1348 arguments->Add(push_value); |
| 1341 InstanceCallInstr* call = | 1349 InstanceCallInstr* call = |
| 1342 new InstanceCallInstr(node->token_pos(), | 1350 new InstanceCallInstr(node->token_pos(), |
| 1343 String::ZoneHandle( | 1351 String::ZoneHandle( |
| 1344 Symbols::New(Token::Str(node->kind()))), | 1352 Symbols::New(Token::Str(node->kind()))), |
| 1345 node->kind(), | 1353 node->kind(), |
| 1346 arguments, | 1354 arguments, |
| 1347 Array::ZoneHandle(), | 1355 Array::ZoneHandle(), |
| 1348 1); | 1356 1, |
| 1357 owner()->ic_data_array()); |
| 1349 ReturnDefinition(call); | 1358 ReturnDefinition(call); |
| 1350 } | 1359 } |
| 1351 | 1360 |
| 1352 | 1361 |
| 1353 void EffectGraphVisitor::VisitConditionalExprNode(ConditionalExprNode* node) { | 1362 void EffectGraphVisitor::VisitConditionalExprNode(ConditionalExprNode* node) { |
| 1354 TestGraphVisitor for_test(owner(), | 1363 TestGraphVisitor for_test(owner(), |
| 1355 temp_index(), | 1364 temp_index(), |
| 1356 node->condition()->token_pos()); | 1365 node->condition()->token_pos()); |
| 1357 node->condition()->Visit(&for_test); | 1366 node->condition()->Visit(&for_test); |
| 1358 | 1367 |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1906 PushArgumentInstr* push_receiver = PushArgument(for_receiver.value()); | 1915 PushArgumentInstr* push_receiver = PushArgument(for_receiver.value()); |
| 1907 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 1916 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 1908 new ZoneGrowableArray<PushArgumentInstr*>( | 1917 new ZoneGrowableArray<PushArgumentInstr*>( |
| 1909 node->arguments()->length() + 1); | 1918 node->arguments()->length() + 1); |
| 1910 arguments->Add(push_receiver); | 1919 arguments->Add(push_receiver); |
| 1911 | 1920 |
| 1912 BuildPushArguments(*node->arguments(), arguments); | 1921 BuildPushArguments(*node->arguments(), arguments); |
| 1913 InstanceCallInstr* call = new InstanceCallInstr( | 1922 InstanceCallInstr* call = new InstanceCallInstr( |
| 1914 node->token_pos(), | 1923 node->token_pos(), |
| 1915 node->function_name(), Token::kILLEGAL, arguments, | 1924 node->function_name(), Token::kILLEGAL, arguments, |
| 1916 node->arguments()->names(), 1); | 1925 node->arguments()->names(), |
| 1926 1, |
| 1927 owner()->ic_data_array()); |
| 1917 ReturnDefinition(call); | 1928 ReturnDefinition(call); |
| 1918 } | 1929 } |
| 1919 | 1930 |
| 1920 | 1931 |
| 1921 static intptr_t GetResultCidOfNative(const Function& function) { | 1932 static intptr_t GetResultCidOfNative(const Function& function) { |
| 1922 const Class& function_class = Class::Handle(function.Owner()); | 1933 const Class& function_class = Class::Handle(function.Owner()); |
| 1923 if (function_class.library() == Library::TypedDataLibrary()) { | 1934 if (function_class.library() == Library::TypedDataLibrary()) { |
| 1924 const String& function_name = String::Handle(function.name()); | 1935 const String& function_name = String::Handle(function.name()); |
| 1925 if (!String::EqualsIgnoringPrivateKey(function_name, Symbols::_New())) { | 1936 if (!String::EqualsIgnoringPrivateKey(function_name, Symbols::_New())) { |
| 1926 return kDynamicCid; | 1937 return kDynamicCid; |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2350 ValueGraphVisitor for_receiver(owner(), temp_index()); | 2361 ValueGraphVisitor for_receiver(owner(), temp_index()); |
| 2351 node->receiver()->Visit(&for_receiver); | 2362 node->receiver()->Visit(&for_receiver); |
| 2352 Append(for_receiver); | 2363 Append(for_receiver); |
| 2353 PushArgumentInstr* push_receiver = PushArgument(for_receiver.value()); | 2364 PushArgumentInstr* push_receiver = PushArgument(for_receiver.value()); |
| 2354 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 2365 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 2355 new ZoneGrowableArray<PushArgumentInstr*>(1); | 2366 new ZoneGrowableArray<PushArgumentInstr*>(1); |
| 2356 arguments->Add(push_receiver); | 2367 arguments->Add(push_receiver); |
| 2357 const String& name = | 2368 const String& name = |
| 2358 String::ZoneHandle(Field::GetterSymbol(node->field_name())); | 2369 String::ZoneHandle(Field::GetterSymbol(node->field_name())); |
| 2359 InstanceCallInstr* call = new InstanceCallInstr( | 2370 InstanceCallInstr* call = new InstanceCallInstr( |
| 2360 node->token_pos(), name, Token::kGET, | 2371 node->token_pos(), |
| 2361 arguments, Array::ZoneHandle(), 1); | 2372 name, |
| 2373 Token::kGET, |
| 2374 arguments, Array::ZoneHandle(), |
| 2375 1, |
| 2376 owner()->ic_data_array()); |
| 2362 ReturnDefinition(call); | 2377 ReturnDefinition(call); |
| 2363 } | 2378 } |
| 2364 | 2379 |
| 2365 | 2380 |
| 2366 void EffectGraphVisitor::BuildInstanceSetterArguments( | 2381 void EffectGraphVisitor::BuildInstanceSetterArguments( |
| 2367 InstanceSetterNode* node, | 2382 InstanceSetterNode* node, |
| 2368 ZoneGrowableArray<PushArgumentInstr*>* arguments, | 2383 ZoneGrowableArray<PushArgumentInstr*>* arguments, |
| 2369 bool result_is_needed) { | 2384 bool result_is_needed) { |
| 2370 ValueGraphVisitor for_receiver(owner(), temp_index()); | 2385 ValueGraphVisitor for_receiver(owner(), temp_index()); |
| 2371 node->receiver()->Visit(&for_receiver); | 2386 node->receiver()->Visit(&for_receiver); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2390 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 2405 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 2391 new ZoneGrowableArray<PushArgumentInstr*>(2); | 2406 new ZoneGrowableArray<PushArgumentInstr*>(2); |
| 2392 BuildInstanceSetterArguments(node, arguments, kResultNotNeeded); | 2407 BuildInstanceSetterArguments(node, arguments, kResultNotNeeded); |
| 2393 const String& name = | 2408 const String& name = |
| 2394 String::ZoneHandle(Field::SetterSymbol(node->field_name())); | 2409 String::ZoneHandle(Field::SetterSymbol(node->field_name())); |
| 2395 InstanceCallInstr* call = new InstanceCallInstr(node->token_pos(), | 2410 InstanceCallInstr* call = new InstanceCallInstr(node->token_pos(), |
| 2396 name, | 2411 name, |
| 2397 Token::kSET, | 2412 Token::kSET, |
| 2398 arguments, | 2413 arguments, |
| 2399 Array::ZoneHandle(), | 2414 Array::ZoneHandle(), |
| 2400 2); // Checked arg count. | 2415 2, // Checked arg count. |
| 2416 owner()->ic_data_array()); |
| 2401 ReturnDefinition(call); | 2417 ReturnDefinition(call); |
| 2402 } | 2418 } |
| 2403 | 2419 |
| 2404 | 2420 |
| 2405 void ValueGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) { | 2421 void ValueGraphVisitor::VisitInstanceSetterNode(InstanceSetterNode* node) { |
| 2406 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 2422 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 2407 new ZoneGrowableArray<PushArgumentInstr*>(2); | 2423 new ZoneGrowableArray<PushArgumentInstr*>(2); |
| 2408 BuildInstanceSetterArguments(node, arguments, kResultNeeded); | 2424 BuildInstanceSetterArguments(node, arguments, kResultNeeded); |
| 2409 const String& name = | 2425 const String& name = |
| 2410 String::ZoneHandle(Field::SetterSymbol(node->field_name())); | 2426 String::ZoneHandle(Field::SetterSymbol(node->field_name())); |
| 2411 Do(new InstanceCallInstr(node->token_pos(), | 2427 Do(new InstanceCallInstr(node->token_pos(), |
| 2412 name, | 2428 name, |
| 2413 Token::kSET, | 2429 Token::kSET, |
| 2414 arguments, | 2430 arguments, |
| 2415 Array::ZoneHandle(), | 2431 Array::ZoneHandle(), |
| 2416 2)); // Checked argument count. | 2432 2, // Checked argument count. |
| 2433 owner()->ic_data_array())); |
| 2417 ReturnDefinition(BuildLoadExprTemp()); | 2434 ReturnDefinition(BuildLoadExprTemp()); |
| 2418 } | 2435 } |
| 2419 | 2436 |
| 2420 | 2437 |
| 2421 void EffectGraphVisitor::VisitStaticGetterNode(StaticGetterNode* node) { | 2438 void EffectGraphVisitor::VisitStaticGetterNode(StaticGetterNode* node) { |
| 2422 const String& getter_name = | 2439 const String& getter_name = |
| 2423 String::ZoneHandle(Field::GetterSymbol(node->field_name())); | 2440 String::ZoneHandle(Field::GetterSymbol(node->field_name())); |
| 2424 ZoneGrowableArray<PushArgumentInstr*>* arguments = | 2441 ZoneGrowableArray<PushArgumentInstr*>* arguments = |
| 2425 new ZoneGrowableArray<PushArgumentInstr*>(); | 2442 new ZoneGrowableArray<PushArgumentInstr*>(); |
| 2426 Function& getter_function = Function::ZoneHandle(); | 2443 Function& getter_function = Function::ZoneHandle(); |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2771 arguments); | 2788 arguments); |
| 2772 ReturnDefinition(load); | 2789 ReturnDefinition(load); |
| 2773 } else { | 2790 } else { |
| 2774 // Generate dynamic call to index operator. | 2791 // Generate dynamic call to index operator. |
| 2775 const intptr_t checked_argument_count = 1; | 2792 const intptr_t checked_argument_count = 1; |
| 2776 InstanceCallInstr* load = new InstanceCallInstr(node->token_pos(), | 2793 InstanceCallInstr* load = new InstanceCallInstr(node->token_pos(), |
| 2777 Symbols::IndexToken(), | 2794 Symbols::IndexToken(), |
| 2778 Token::kINDEX, | 2795 Token::kINDEX, |
| 2779 arguments, | 2796 arguments, |
| 2780 Array::ZoneHandle(), | 2797 Array::ZoneHandle(), |
| 2781 checked_argument_count); | 2798 checked_argument_count, |
| 2799 owner()->ic_data_array()); |
| 2782 ReturnDefinition(load); | 2800 ReturnDefinition(load); |
| 2783 } | 2801 } |
| 2784 } | 2802 } |
| 2785 | 2803 |
| 2786 | 2804 |
| 2787 Definition* EffectGraphVisitor::BuildStoreIndexedValues( | 2805 Definition* EffectGraphVisitor::BuildStoreIndexedValues( |
| 2788 StoreIndexedNode* node, | 2806 StoreIndexedNode* node, |
| 2789 bool result_is_needed) { | 2807 bool result_is_needed) { |
| 2790 Function* super_function = NULL; | 2808 Function* super_function = NULL; |
| 2791 if (node->IsSuperStore()) { | 2809 if (node->IsSuperStore()) { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2870 // Generate dynamic call to operator []=. | 2888 // Generate dynamic call to operator []=. |
| 2871 const intptr_t checked_argument_count = 3; | 2889 const intptr_t checked_argument_count = 3; |
| 2872 const String& name = | 2890 const String& name = |
| 2873 String::ZoneHandle(Symbols::New(Token::Str(Token::kASSIGN_INDEX))); | 2891 String::ZoneHandle(Symbols::New(Token::Str(Token::kASSIGN_INDEX))); |
| 2874 InstanceCallInstr* store = | 2892 InstanceCallInstr* store = |
| 2875 new InstanceCallInstr(node->token_pos(), | 2893 new InstanceCallInstr(node->token_pos(), |
| 2876 name, | 2894 name, |
| 2877 Token::kASSIGN_INDEX, | 2895 Token::kASSIGN_INDEX, |
| 2878 arguments, | 2896 arguments, |
| 2879 Array::ZoneHandle(), | 2897 Array::ZoneHandle(), |
| 2880 checked_argument_count); | 2898 checked_argument_count, |
| 2899 owner()->ic_data_array()); |
| 2881 if (result_is_needed) { | 2900 if (result_is_needed) { |
| 2882 Do(store); | 2901 Do(store); |
| 2883 return BuildLoadExprTemp(); | 2902 return BuildLoadExprTemp(); |
| 2884 } else { | 2903 } else { |
| 2885 return store; | 2904 return store; |
| 2886 } | 2905 } |
| 2887 } | 2906 } |
| 2888 } | 2907 } |
| 2889 | 2908 |
| 2890 | 2909 |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3375 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 3394 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 3376 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 3395 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 3377 OS::SNPrint(chars, len, kFormat, function_name, reason); | 3396 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 3378 const Error& error = Error::Handle( | 3397 const Error& error = Error::Handle( |
| 3379 LanguageError::New(String::Handle(String::New(chars)))); | 3398 LanguageError::New(String::Handle(String::New(chars)))); |
| 3380 Isolate::Current()->long_jump_base()->Jump(1, error); | 3399 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 3381 } | 3400 } |
| 3382 | 3401 |
| 3383 | 3402 |
| 3384 } // namespace dart | 3403 } // namespace dart |
| OLD | NEW |