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/code_patcher.h" | 9 #include "vm/code_patcher.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 // Arg1: ICData object. | 1005 // Arg1: ICData object. |
1006 // Arg2: Arguments descriptor array. | 1006 // Arg2: Arguments descriptor array. |
1007 | 1007 |
1008 // Returns: target function to call. | 1008 // Returns: target function to call. |
1009 DEFINE_RUNTIME_ENTRY(MegamorphicCacheMissHandler, 3) { | 1009 DEFINE_RUNTIME_ENTRY(MegamorphicCacheMissHandler, 3) { |
1010 const Instance& receiver = Instance::CheckedHandle(arguments.ArgAt(0)); | 1010 const Instance& receiver = Instance::CheckedHandle(arguments.ArgAt(0)); |
1011 const ICData& ic_data = ICData::CheckedHandle(arguments.ArgAt(1)); | 1011 const ICData& ic_data = ICData::CheckedHandle(arguments.ArgAt(1)); |
1012 const Array& descriptor = Array::CheckedHandle(arguments.ArgAt(2)); | 1012 const Array& descriptor = Array::CheckedHandle(arguments.ArgAt(2)); |
1013 const String& name = String::Handle(ic_data.target_name()); | 1013 const String& name = String::Handle(ic_data.target_name()); |
1014 const MegamorphicCache& cache = MegamorphicCache::Handle( | 1014 const MegamorphicCache& cache = MegamorphicCache::Handle( |
1015 isolate->megamorphic_cache_table()->Lookup(name, descriptor)); | 1015 MegamorphicCacheTable::Lookup(isolate, name, descriptor)); |
1016 Class& cls = Class::Handle(receiver.clazz()); | 1016 Class& cls = Class::Handle(receiver.clazz()); |
1017 ASSERT(!cls.IsNull()); | 1017 ASSERT(!cls.IsNull()); |
1018 if (FLAG_trace_ic || FLAG_trace_ic_miss_in_optimized) { | 1018 if (FLAG_trace_ic || FLAG_trace_ic_miss_in_optimized) { |
1019 OS::PrintErr("Megamorphic IC miss, class=%s, function=%s\n", | 1019 OS::PrintErr("Megamorphic IC miss, class=%s, function=%s\n", |
1020 cls.ToCString(), name.ToCString()); | 1020 cls.ToCString(), name.ToCString()); |
1021 } | 1021 } |
1022 | 1022 |
1023 ArgumentsDescriptor args_desc(descriptor); | 1023 ArgumentsDescriptor args_desc(descriptor); |
1024 Function& target_function = Function::Handle( | 1024 Function& target_function = Function::Handle( |
1025 Resolver::ResolveDynamicForReceiverClass(cls, | 1025 Resolver::ResolveDynamicForReceiverClass(cls, |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1855 const intptr_t elm_size = old_data.ElementSizeInBytes(); | 1855 const intptr_t elm_size = old_data.ElementSizeInBytes(); |
1856 const TypedData& new_data = | 1856 const TypedData& new_data = |
1857 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); | 1857 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); |
1858 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); | 1858 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); |
1859 typed_data_cell.SetAt(0, new_data); | 1859 typed_data_cell.SetAt(0, new_data); |
1860 arguments.SetReturn(new_data); | 1860 arguments.SetReturn(new_data); |
1861 } | 1861 } |
1862 | 1862 |
1863 | 1863 |
1864 } // namespace dart | 1864 } // namespace dart |
OLD | NEW |