| 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 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 const Instance& other = Instance::CheckedHandle(arguments.At(1)); | 973 const Instance& other = Instance::CheckedHandle(arguments.At(1)); |
| 974 GrowableArray<const Instance*> args(2); | 974 GrowableArray<const Instance*> args(2); |
| 975 args.Add(&receiver); | 975 args.Add(&receiver); |
| 976 args.Add(&other); | 976 args.Add(&other); |
| 977 const Function& result = | 977 const Function& result = |
| 978 Function::Handle(InlineCacheMissHandler(isolate, args)); | 978 Function::Handle(InlineCacheMissHandler(isolate, args)); |
| 979 arguments.SetReturn(result); | 979 arguments.SetReturn(result); |
| 980 } | 980 } |
| 981 | 981 |
| 982 | 982 |
| 983 // Handles inline cache misses by updating the IC data array of the call |
| 984 // site. |
| 985 // Arg0: Receiver object. |
| 986 // Arg1: Argument after receiver. |
| 987 // Arg2: Second argument after receiver. |
| 988 // Returns: target function with compiled code or null. |
| 989 // Modifies the instance call to hold the updated IC data array. |
| 990 DEFINE_RUNTIME_ENTRY(InlineCacheMissHandlerThreeArgs, 3) { |
| 991 ASSERT(arguments.Count() == |
| 992 kInlineCacheMissHandlerThreeArgsRuntimeEntry.argument_count()); |
| 993 const Instance& receiver = Instance::CheckedHandle(arguments.At(0)); |
| 994 const Instance& arg1 = Instance::CheckedHandle(arguments.At(1)); |
| 995 const Instance& arg2 = Instance::CheckedHandle(arguments.At(2)); |
| 996 GrowableArray<const Instance*> args(3); |
| 997 args.Add(&receiver); |
| 998 args.Add(&arg1); |
| 999 args.Add(&arg2); |
| 1000 const Function& result = |
| 1001 Function::Handle(InlineCacheMissHandler(isolate, args)); |
| 1002 arguments.SetReturn(result); |
| 1003 } |
| 1004 |
| 1005 |
| 983 static RawFunction* LookupDynamicFunction(Isolate* isolate, | 1006 static RawFunction* LookupDynamicFunction(Isolate* isolate, |
| 984 const Class& in_cls, | 1007 const Class& in_cls, |
| 985 const String& name) { | 1008 const String& name) { |
| 986 Class& cls = Class::Handle(); | 1009 Class& cls = Class::Handle(); |
| 987 // For lookups treat null as an instance of class Object. | 1010 // For lookups treat null as an instance of class Object. |
| 988 if (in_cls.IsNullClass()) { | 1011 if (in_cls.IsNullClass()) { |
| 989 cls = isolate->object_store()->object_class(); | 1012 cls = isolate->object_store()->object_class(); |
| 990 } else { | 1013 } else { |
| 991 cls = in_cls.raw(); | 1014 cls = in_cls.raw(); |
| 992 } | 1015 } |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1703 current->slot(), | 1726 current->slot(), |
| 1704 current->value()); | 1727 current->value()); |
| 1705 } | 1728 } |
| 1706 | 1729 |
| 1707 delete current; | 1730 delete current; |
| 1708 } | 1731 } |
| 1709 } | 1732 } |
| 1710 | 1733 |
| 1711 | 1734 |
| 1712 } // namespace dart | 1735 } // namespace dart |
| OLD | NEW |