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

Side by Side Diff: runtime/lib/function.cc

Issue 12315087: Hook up simulator (if needed) when calling Dart code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/lib/invocation_mirror.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "vm/compiler.h" 7 #include "vm/compiler.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/exceptions.h" 9 #include "vm/exceptions.h"
10 #include "vm/native_entry.h" 10 #include "vm/native_entry.h"
11 #include "vm/object.h" 11 #include "vm/object.h"
12 #include "vm/symbols.h" 12 #include "vm/symbols.h"
13 13
14 namespace dart { 14 namespace dart {
15 15
16 DEFINE_NATIVE_ENTRY(Function_apply, 2) { 16 DEFINE_NATIVE_ENTRY(Function_apply, 2) {
17 const Array& fun_arguments = Array::CheckedHandle(arguments->NativeArgAt(0)); 17 const Array& fun_arguments = Array::CheckedHandle(arguments->NativeArgAt(0));
18 const Array& fun_arg_names = Array::CheckedHandle(arguments->NativeArgAt(1)); 18 const Array& fun_arg_names = Array::CheckedHandle(arguments->NativeArgAt(1));
19 Instance& instance = Instance::Handle();
20 instance ^= fun_arguments.At(0);
21 const Array& fun_args_desc = 19 const Array& fun_args_desc =
22 Array::Handle(ArgumentsDescriptor::New(fun_arguments.Length(), 20 Array::Handle(ArgumentsDescriptor::New(fun_arguments.Length(),
23 fun_arg_names)); 21 fun_arg_names));
24 const Object& result = 22 const Object& result =
25 Object::Handle(DartEntry::InvokeClosure(instance, 23 Object::Handle(DartEntry::InvokeClosure(fun_arguments, fun_args_desc));
26 fun_arguments,
27 fun_args_desc));
28 if (result.IsError()) { 24 if (result.IsError()) {
29 Exceptions::PropagateError(Error::Cast(result)); 25 Exceptions::PropagateError(Error::Cast(result));
30 } 26 }
31 return result.raw(); 27 return result.raw();
32 } 28 }
33 29
34 } // namespace dart 30 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/invocation_mirror.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698