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

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

Issue 882323004: VM: Share closure-call dispatchers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | runtime/vm/parser_test.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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 const int kNumArguments = 1; 732 const int kNumArguments = 1;
733 ArgumentsDescriptor args_desc( 733 ArgumentsDescriptor args_desc(
734 Array::Handle(ArgumentsDescriptor::New(kNumArguments))); 734 Array::Handle(ArgumentsDescriptor::New(kNumArguments)));
735 const Function& getter = Function::Handle( 735 const Function& getter = Function::Handle(
736 Resolver::ResolveDynamicForReceiverClass(receiver_class, 736 Resolver::ResolveDynamicForReceiverClass(receiver_class,
737 getter_name, 737 getter_name,
738 args_desc)); 738 args_desc));
739 if (getter.IsNull() || getter.IsMethodExtractor()) { 739 if (getter.IsNull() || getter.IsMethodExtractor()) {
740 return false; 740 return false;
741 } 741 }
742 742 const Class& cache_class = Class::Handle(receiver_class.IsSignatureClass()
743 ? receiver_class.SuperClass()
744 : receiver_class.raw());
745 ASSERT(
746 !receiver_class.IsSignatureClass() ||
747 (receiver_class.SuperClass() == Type::Handle(
748 Isolate::Current()->object_store()->function_impl_type()).type_class()));
743 const Function& target_function = 749 const Function& target_function =
744 Function::Handle(receiver_class.GetInvocationDispatcher( 750 Function::Handle(cache_class.GetInvocationDispatcher(
745 target_name, 751 target_name,
746 arguments_descriptor, 752 arguments_descriptor,
747 RawFunction::kInvokeFieldDispatcher)); 753 RawFunction::kInvokeFieldDispatcher));
748 ASSERT(!target_function.IsNull()); 754 ASSERT(!target_function.IsNull());
749 if (FLAG_trace_ic) { 755 if (FLAG_trace_ic) {
750 OS::PrintErr("InvokeField IC miss: adding <%s> id:%" Pd " -> <%s>\n", 756 OS::PrintErr("InvokeField IC miss: adding <%s> id:%" Pd " -> <%s>\n",
751 Class::Handle(receiver.clazz()).ToCString(), 757 Class::Handle(receiver.clazz()).ToCString(),
752 receiver.GetClassId(), 758 receiver.GetClassId(),
753 target_function.ToCString()); 759 target_function.ToCString());
754 } 760 }
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
1673 const intptr_t elm_size = old_data.ElementSizeInBytes(); 1679 const intptr_t elm_size = old_data.ElementSizeInBytes();
1674 const TypedData& new_data = 1680 const TypedData& new_data =
1675 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); 1681 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld));
1676 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); 1682 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size);
1677 typed_data_cell.SetAt(0, new_data); 1683 typed_data_cell.SetAt(0, new_data);
1678 arguments.SetReturn(new_data); 1684 arguments.SetReturn(new_data);
1679 } 1685 }
1680 1686
1681 1687
1682 } // namespace dart 1688 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | runtime/vm/parser_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698