| OLD | NEW |
| 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/code_generator.h" | 5 #include "vm/code_generator.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
| 9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 | 1019 |
| 1020 Object& result = Object::Handle(); | 1020 Object& result = Object::Handle(); |
| 1021 if (!ResolveCallThroughGetter(receiver, | 1021 if (!ResolveCallThroughGetter(receiver, |
| 1022 receiver_class, | 1022 receiver_class, |
| 1023 target_name, | 1023 target_name, |
| 1024 args_descriptor, | 1024 args_descriptor, |
| 1025 args, | 1025 args, |
| 1026 ic_data, | 1026 ic_data, |
| 1027 &result)) { | 1027 &result)) { |
| 1028 ArgumentsDescriptor desc(args_descriptor); | 1028 ArgumentsDescriptor desc(args_descriptor); |
| 1029 Function& target_function = Function::Handle(); | 1029 const Function& target_function = |
| 1030 if (receiver.IsClosure() && target_name.Equals(Symbols::Call())) { | 1030 Function::Handle(receiver_class.GetInvocationDispatcher( |
| 1031 target_function = receiver_class.GetInvocationDispatcher( | 1031 target_name, |
| 1032 target_name, | 1032 args_descriptor, |
| 1033 args_descriptor, | 1033 RawFunction::kNoSuchMethodDispatcher)); |
| 1034 RawFunction::kInvokeClosureDispatcher); | |
| 1035 } else { | |
| 1036 target_function = receiver_class.GetInvocationDispatcher( | |
| 1037 target_name, | |
| 1038 args_descriptor, | |
| 1039 RawFunction::kNoSuchMethodDispatcher); | |
| 1040 } | |
| 1041 // Update IC data. | 1034 // Update IC data. |
| 1042 ASSERT(!target_function.IsNull()); | 1035 ASSERT(!target_function.IsNull()); |
| 1043 intptr_t receiver_cid = receiver.GetClassId(); | 1036 intptr_t receiver_cid = receiver.GetClassId(); |
| 1044 if (ic_data.num_args_tested() == 1) { | 1037 if (ic_data.num_args_tested() == 1) { |
| 1045 // In optimized code we may enter into here via the | 1038 // In optimized code we may enter into here via the |
| 1046 // MegamorphicCacheMissHandler since noSuchMethod dispatchers are not | 1039 // MegamorphicCacheMissHandler since noSuchMethod dispatchers are not |
| 1047 // inserted into the megamorphic cache. Therefore, we need to guard | 1040 // inserted into the megamorphic cache. Therefore, we need to guard |
| 1048 // against entering the same check twice into the ICData. | 1041 // against entering the same check twice into the ICData. |
| 1049 // Note that num_args_tested == 1 in optimized code. | 1042 // Note that num_args_tested == 1 in optimized code. |
| 1050 // TODO(fschneider): Handle extraordinary cases like noSuchMethod and | 1043 // TODO(fschneider): Handle extraordinary cases like noSuchMethod and |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1555 // of the given value. | 1548 // of the given value. |
| 1556 // Arg0: Field object; | 1549 // Arg0: Field object; |
| 1557 // Arg1: Value that is being stored. | 1550 // Arg1: Value that is being stored. |
| 1558 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { | 1551 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { |
| 1559 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); | 1552 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); |
| 1560 const Object& value = Object::Handle(arguments.ArgAt(1)); | 1553 const Object& value = Object::Handle(arguments.ArgAt(1)); |
| 1561 field.UpdateGuardedCidAndLength(value); | 1554 field.UpdateGuardedCidAndLength(value); |
| 1562 } | 1555 } |
| 1563 | 1556 |
| 1564 } // namespace dart | 1557 } // namespace dart |
| OLD | NEW |