| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/code_index_table.h" | 7 #include "vm/code_index_table.h" |
| 8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 DartFrame* caller_frame = iterator.NextFrame(); | 472 DartFrame* caller_frame = iterator.NextFrame(); |
| 473 ICData ic_data(Array::Handle( | 473 ICData ic_data(Array::Handle( |
| 474 CodePatcher::GetInstanceCallIcDataAt(caller_frame->pc()))); | 474 CodePatcher::GetInstanceCallIcDataAt(caller_frame->pc()))); |
| 475 GrowableArray<const Class*> classes; | 475 GrowableArray<const Class*> classes; |
| 476 classes.Add(&Class::ZoneHandle(receiver.clazz())); | 476 classes.Add(&Class::ZoneHandle(receiver.clazz())); |
| 477 ic_data.AddCheck(classes, target_function); | 477 ic_data.AddCheck(classes, target_function); |
| 478 CodePatcher::SetInstanceCallIcDataAt(caller_frame->pc(), | 478 CodePatcher::SetInstanceCallIcDataAt(caller_frame->pc(), |
| 479 Array::ZoneHandle(ic_data.data())); | 479 Array::ZoneHandle(ic_data.data())); |
| 480 arguments.SetReturn(target_function); | 480 arguments.SetReturn(target_function); |
| 481 if (FLAG_trace_ic) { | 481 if (FLAG_trace_ic) { |
| 482 OS::Print("InlineCacheMissHandler 0x%x adding receiver '%s' -> '%s'\n", | 482 OS::Print("InlineCacheMissHandler call at 0x%x' adding <%s> -> <%s>\n", |
| 483 caller_frame->pc(), receiver.ToCString(), target_function.ToCString()); | 483 caller_frame->pc(), |
| 484 Class::Handle(receiver.clazz()).ToCString(), |
| 485 target_function.ToCString()); |
| 484 } | 486 } |
| 485 } | 487 } |
| 486 | 488 |
| 487 | 489 |
| 488 static RawFunction* LookupDynamicFunction(const Class& in_cls, | 490 static RawFunction* LookupDynamicFunction(const Class& in_cls, |
| 489 const String& name) { | 491 const String& name) { |
| 490 Class& cls = Class::Handle(); | 492 Class& cls = Class::Handle(); |
| 491 // For lookups treat null as an instance of class Object. | 493 // For lookups treat null as an instance of class Object. |
| 492 if (in_cls.IsNullClass()) { | 494 if (in_cls.IsNullClass()) { |
| 493 cls = Isolate::Current()->object_store()->object_class(); | 495 cls = Isolate::Current()->object_store()->object_class(); |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 } | 964 } |
| 963 } | 965 } |
| 964 } | 966 } |
| 965 // The cache is null terminated, therefore the loop above should never | 967 // The cache is null terminated, therefore the loop above should never |
| 966 // terminate by itself. | 968 // terminate by itself. |
| 967 UNREACHABLE(); | 969 UNREACHABLE(); |
| 968 return Code::null(); | 970 return Code::null(); |
| 969 } | 971 } |
| 970 | 972 |
| 971 } // namespace dart | 973 } // namespace dart |
| OLD | NEW |