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

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

Issue 188703004: Fix invocation of closures via .call in the VM (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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/debugger.cc » ('j') | no next file with comments »
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/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 1019
1020 Object& result = Object::Handle(); 1020 Object& result = Object::Handle();
1021 if (!ResolveCallThroughGetter(receiver, 1021 if (!ResolveCallThroughGetter(receiver,
1022 receiver_class, 1022 receiver_class,
1023 target_name, 1023 target_name,
1024 args_descriptor, 1024 args_descriptor,
1025 args, 1025 args,
1026 ic_data, 1026 ic_data,
1027 &result)) { 1027 &result)) {
1028 ArgumentsDescriptor desc(args_descriptor); 1028 ArgumentsDescriptor desc(args_descriptor);
1029 const Function& target_function = 1029 Function& target_function = Function::Handle();
1030 Function::Handle(receiver_class.GetInvocationDispatcher( 1030 if (receiver.IsClosure() && target_name.Equals(Symbols::Call())) {
1031 target_name, 1031 target_function = receiver_class.GetInvocationDispatcher(
1032 args_descriptor, 1032 target_name,
1033 RawFunction::kNoSuchMethodDispatcher)); 1033 args_descriptor,
1034 RawFunction::kInvokeClosureDispatcher);
1035 } else {
1036 target_function = receiver_class.GetInvocationDispatcher(
1037 target_name,
1038 args_descriptor,
1039 RawFunction::kNoSuchMethodDispatcher);
1040 }
1034 // Update IC data. 1041 // Update IC data.
1035 ASSERT(!target_function.IsNull()); 1042 ASSERT(!target_function.IsNull());
1036 intptr_t receiver_cid = receiver.GetClassId(); 1043 intptr_t receiver_cid = receiver.GetClassId();
1037 if (ic_data.num_args_tested() == 1) { 1044 if (ic_data.num_args_tested() == 1) {
1038 // In optimized code we may enter into here via the 1045 // In optimized code we may enter into here via the
1039 // MegamorphicCacheMissHandler since noSuchMethod dispatchers are not 1046 // MegamorphicCacheMissHandler since noSuchMethod dispatchers are not
1040 // inserted into the megamorphic cache. Therefore, we need to guard 1047 // inserted into the megamorphic cache. Therefore, we need to guard
1041 // against entering the same check twice into the ICData. 1048 // against entering the same check twice into the ICData.
1042 // Note that num_args_tested == 1 in optimized code. 1049 // Note that num_args_tested == 1 in optimized code.
1043 // TODO(fschneider): Handle extraordinary cases like noSuchMethod and 1050 // TODO(fschneider): Handle extraordinary cases like noSuchMethod and
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
1548 // of the given value. 1555 // of the given value.
1549 // Arg0: Field object; 1556 // Arg0: Field object;
1550 // Arg1: Value that is being stored. 1557 // Arg1: Value that is being stored.
1551 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { 1558 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) {
1552 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); 1559 const Field& field = Field::CheckedHandle(arguments.ArgAt(0));
1553 const Object& value = Object::Handle(arguments.ArgAt(1)); 1560 const Object& value = Object::Handle(arguments.ArgAt(1));
1554 field.UpdateGuardedCidAndLength(value); 1561 field.UpdateGuardedCidAndLength(value);
1555 } 1562 }
1556 1563
1557 } // namespace dart 1564 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698