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

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

Issue 227723002: VM: Implement closure calls as instance calls. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: adjust inlining of dispatchers Created 6 years, 8 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 | « runtime/vm/code_generator.h ('k') | runtime/vm/flow_graph_inliner.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 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 const Object& result = Object::Handle( 943 const Object& result = Object::Handle(
944 DartEntry::InvokeNoSuchMethod(receiver, 944 DartEntry::InvokeNoSuchMethod(receiver,
945 original_function_name, 945 original_function_name,
946 orig_arguments, 946 orig_arguments,
947 orig_arguments_desc)); 947 orig_arguments_desc));
948 CheckResultError(result); 948 CheckResultError(result);
949 arguments.SetReturn(result); 949 arguments.SetReturn(result);
950 } 950 }
951 951
952 952
953 // A non-closure object was invoked as a closure, so call the "call" method
954 // on it.
955 // Arg0: arguments descriptor.
956 // Arg1: arguments array, including non-closure object.
957 DEFINE_RUNTIME_ENTRY(InvokeNonClosure, 2) {
958 const Array& args_descriptor = Array::CheckedHandle(arguments.ArgAt(0));
959 const Array& function_args = Array::CheckedHandle(arguments.ArgAt(1));
960
961 const Object& result = Object::Handle(
962 DartEntry::InvokeClosure(function_args, args_descriptor));
963 CheckResultError(result);
964 arguments.SetReturn(result);
965 }
966
967
968 static bool CanOptimizeFunction(const Function& function, Isolate* isolate) { 953 static bool CanOptimizeFunction(const Function& function, Isolate* isolate) {
969 const intptr_t kLowInvocationCount = -100000000; 954 const intptr_t kLowInvocationCount = -100000000;
970 if (isolate->debugger()->IsStepping() || 955 if (isolate->debugger()->IsStepping() ||
971 isolate->debugger()->HasBreakpoint(function)) { 956 isolate->debugger()->HasBreakpoint(function)) {
972 // We cannot set breakpoints and single step in optimized code, 957 // We cannot set breakpoints and single step in optimized code,
973 // so do not optimize the function. 958 // so do not optimize the function.
974 function.set_usage_counter(0); 959 function.set_usage_counter(0);
975 return false; 960 return false;
976 } 961 }
977 if (function.deoptimization_counter() >= 962 if (function.deoptimization_counter() >=
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1512 // of the given value. 1497 // of the given value.
1513 // Arg0: Field object; 1498 // Arg0: Field object;
1514 // Arg1: Value that is being stored. 1499 // Arg1: Value that is being stored.
1515 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { 1500 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) {
1516 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); 1501 const Field& field = Field::CheckedHandle(arguments.ArgAt(0));
1517 const Object& value = Object::Handle(arguments.ArgAt(1)); 1502 const Object& value = Object::Handle(arguments.ArgAt(1));
1518 field.UpdateGuardedCidAndLength(value); 1503 field.UpdateGuardedCidAndLength(value);
1519 } 1504 }
1520 1505
1521 } // namespace dart 1506 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.h ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698