OLD | NEW |
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 4863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4874 // If we have a special operation (e.g. +/-/==) we mark both arguments as | 4874 // If we have a special operation (e.g. +/-/==) we mark both arguments as |
4875 // to be checked. | 4875 // to be checked. |
4876 if (token_kind != Token::kILLEGAL) { | 4876 if (token_kind != Token::kILLEGAL) { |
4877 ASSERT(argument_count <= 2); | 4877 ASSERT(argument_count <= 2); |
4878 num_args_checked = argument_count; | 4878 num_args_checked = argument_count; |
4879 } | 4879 } |
4880 | 4880 |
4881 fragment_ = instructions + InstanceCall(node->position(), name, token_kind, | 4881 fragment_ = instructions + InstanceCall(node->position(), name, token_kind, |
4882 argument_count, argument_names, | 4882 argument_count, argument_names, |
4883 num_args_checked); | 4883 num_args_checked); |
| 4884 // Later optimization passes assume that result of a x.[]=(...) call is not |
| 4885 // used. We must guarantee this invariant because violation will lead to an |
| 4886 // illegal IL once we replace x.[]=(...) with a sequence that does not |
| 4887 // actually produce any value. See http://dartbug.com/29135 for more details. |
| 4888 if (name.raw() == Symbols::AssignIndexToken().raw()) { |
| 4889 fragment_ += Drop(); |
| 4890 fragment_ += NullConstant(); |
| 4891 } |
4884 } | 4892 } |
4885 | 4893 |
4886 | 4894 |
4887 void FlowGraphBuilder::VisitDirectMethodInvocation( | 4895 void FlowGraphBuilder::VisitDirectMethodInvocation( |
4888 DirectMethodInvocation* node) { | 4896 DirectMethodInvocation* node) { |
4889 const dart::String& method_name = H.DartProcedureName(node->target()); | 4897 const dart::String& method_name = H.DartProcedureName(node->target()); |
4890 const Function& target = Function::ZoneHandle( | 4898 const Function& target = Function::ZoneHandle( |
4891 Z, LookupMethodByMember(node->target(), method_name)); | 4899 Z, LookupMethodByMember(node->target(), method_name)); |
4892 | 4900 |
4893 intptr_t argument_count = node->arguments()->count() + 1; | 4901 intptr_t argument_count = node->arguments()->count() + 1; |
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6443 thread->clear_sticky_error(); | 6451 thread->clear_sticky_error(); |
6444 return error.raw(); | 6452 return error.raw(); |
6445 } | 6453 } |
6446 } | 6454 } |
6447 | 6455 |
6448 | 6456 |
6449 } // namespace kernel | 6457 } // namespace kernel |
6450 } // namespace dart | 6458 } // namespace dart |
6451 | 6459 |
6452 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 6460 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
OLD | NEW |