Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: runtime/vm/code_generator.cc

Issue 1346473002: Move megamorphic cache table into the Dart heap. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: non-x64 Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/dart.cc » ('j') | runtime/vm/megamorphic_cache_table.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart.cc » ('j') | runtime/vm/megamorphic_cache_table.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698