| 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/code_generator.h" | 5 #include "vm/code_generator.h" |
| 6 | 6 |
| 7 #include "vm/assembler_macros.h" | 7 #include "vm/assembler_macros.h" |
| 8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
| 9 #include "vm/code_patcher.h" | 9 #include "vm/code_patcher.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 String& function_name = String::Handle(); | 744 String& function_name = String::Handle(); |
| 745 DartFrameIterator iterator; | 745 DartFrameIterator iterator; |
| 746 StackFrame* caller_frame = iterator.NextFrame(); | 746 StackFrame* caller_frame = iterator.NextFrame(); |
| 747 ASSERT(caller_frame != NULL); | 747 ASSERT(caller_frame != NULL); |
| 748 CodePatcher::GetInstanceCallAt(caller_frame->pc(), | 748 CodePatcher::GetInstanceCallAt(caller_frame->pc(), |
| 749 &function_name, | 749 &function_name, |
| 750 &num_arguments, | 750 &num_arguments, |
| 751 &num_named_arguments, | 751 &num_named_arguments, |
| 752 &target); | 752 &target); |
| 753 ASSERT(function_name.IsSymbol()); | 753 ASSERT(function_name.IsSymbol()); |
| 754 Class& receiver_class = Class::Handle(); | |
| 755 if (receiver.IsNull()) { | |
| 756 // TODO(srdjan): Clarify behavior of null objects. | |
| 757 receiver_class = isolate->object_store()->object_class(); | |
| 758 } else { | |
| 759 receiver_class = receiver.clazz(); | |
| 760 } | |
| 761 | 754 |
| 762 Function& function = Function::Handle(); | 755 Function& function = Function::Handle(); |
| 763 function = Resolver::ResolveDynamic(receiver, | 756 function = Resolver::ResolveDynamic(receiver, |
| 764 function_name, | 757 function_name, |
| 765 num_arguments, | 758 num_arguments, |
| 766 num_named_arguments); | 759 num_named_arguments); |
| 767 if (function.IsNull()) { | 760 if (function.IsNull()) { |
| 768 return Code::null(); | 761 return Code::null(); |
| 769 } else { | 762 } else { |
| 770 if (!function.HasCode()) { | 763 if (!function.HasCode()) { |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1614 function.set_usage_counter(0); | 1607 function.set_usage_counter(0); |
| 1615 function.set_deoptimization_counter(function.deoptimization_counter() + 1); | 1608 function.set_deoptimization_counter(function.deoptimization_counter() + 1); |
| 1616 | 1609 |
| 1617 if (function.HasOptimizedCode()) { | 1610 if (function.HasOptimizedCode()) { |
| 1618 function.SwitchToUnoptimizedCode(); | 1611 function.SwitchToUnoptimizedCode(); |
| 1619 } | 1612 } |
| 1620 } | 1613 } |
| 1621 END_LEAF_RUNTIME_ENTRY | 1614 END_LEAF_RUNTIME_ENTRY |
| 1622 | 1615 |
| 1623 } // namespace dart | 1616 } // namespace dart |
| OLD | NEW |