| OLD | NEW |
| 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
| 7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
| 8 | 8 |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
| (...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 // TODO(asiva): Symbols should contain private keys. | 1073 // TODO(asiva): Symbols should contain private keys. |
| 1074 const String& function_name = | 1074 const String& function_name = |
| 1075 String::Handle(isolate_lib.PrivateName(Symbols::_get_or_create())); | 1075 String::Handle(isolate_lib.PrivateName(Symbols::_get_or_create())); |
| 1076 const int kNumArguments = 1; | 1076 const int kNumArguments = 1; |
| 1077 const Function& function = Function::Handle( | 1077 const Function& function = Function::Handle( |
| 1078 isolate, | 1078 isolate, |
| 1079 Resolver::ResolveStatic(isolate_lib, | 1079 Resolver::ResolveStatic(isolate_lib, |
| 1080 class_name, | 1080 class_name, |
| 1081 function_name, | 1081 function_name, |
| 1082 kNumArguments, | 1082 kNumArguments, |
| 1083 Object::empty_array(), | 1083 Object::empty_array())); |
| 1084 Resolver::kIsQualified)); | |
| 1085 ASSERT(!function.IsNull()); | 1084 ASSERT(!function.IsNull()); |
| 1086 const Array& args = Array::Handle(isolate, Array::New(kNumArguments)); | 1085 const Array& args = Array::Handle(isolate, Array::New(kNumArguments)); |
| 1087 args.SetAt(0, Integer::Handle(isolate, Integer::New(port_id))); | 1086 args.SetAt(0, Integer::Handle(isolate, Integer::New(port_id))); |
| 1088 return Api::NewHandle(isolate, DartEntry::InvokeFunction(function, args)); | 1087 return Api::NewHandle(isolate, DartEntry::InvokeFunction(function, args)); |
| 1089 } | 1088 } |
| 1090 | 1089 |
| 1091 | 1090 |
| 1092 DART_EXPORT Dart_Port Dart_GetMainPortId() { | 1091 DART_EXPORT Dart_Port Dart_GetMainPortId() { |
| 1093 Isolate* isolate = Isolate::Current(); | 1092 Isolate* isolate = Isolate::Current(); |
| 1094 CHECK_ISOLATE(isolate); | 1093 CHECK_ISOLATE(isolate); |
| (...skipping 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3098 if (::Dart_IsError(state)) { | 3097 if (::Dart_IsError(state)) { |
| 3099 return state; | 3098 return state; |
| 3100 } | 3099 } |
| 3101 | 3100 |
| 3102 const Class& cls = Class::Handle(isolate, Type::Cast(obj).type_class()); | 3101 const Class& cls = Class::Handle(isolate, Type::Cast(obj).type_class()); |
| 3103 const Function& function = Function::Handle( | 3102 const Function& function = Function::Handle( |
| 3104 isolate, | 3103 isolate, |
| 3105 Resolver::ResolveStatic(cls, | 3104 Resolver::ResolveStatic(cls, |
| 3106 function_name, | 3105 function_name, |
| 3107 number_of_arguments, | 3106 number_of_arguments, |
| 3108 Object::empty_array(), | 3107 Object::empty_array())); |
| 3109 Resolver::kIsQualified)); | |
| 3110 if (function.IsNull()) { | 3108 if (function.IsNull()) { |
| 3111 const String& cls_name = String::Handle(isolate, cls.Name()); | 3109 const String& cls_name = String::Handle(isolate, cls.Name()); |
| 3112 return Api::NewError("%s: did not find static method '%s.%s'.", | 3110 return Api::NewError("%s: did not find static method '%s.%s'.", |
| 3113 CURRENT_FUNC, | 3111 CURRENT_FUNC, |
| 3114 cls_name.ToCString(), | 3112 cls_name.ToCString(), |
| 3115 function_name.ToCString()); | 3113 function_name.ToCString()); |
| 3116 } | 3114 } |
| 3117 // Setup args and check for malformed arguments in the arguments list. | 3115 // Setup args and check for malformed arguments in the arguments list. |
| 3118 result = SetupArguments(isolate, number_of_arguments, arguments, 0, &args); | 3116 result = SetupArguments(isolate, number_of_arguments, arguments, 0, &args); |
| 3119 if (!::Dart_IsError(result)) { | 3117 if (!::Dart_IsError(result)) { |
| (...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4413 } | 4411 } |
| 4414 { | 4412 { |
| 4415 NoGCScope no_gc; | 4413 NoGCScope no_gc; |
| 4416 RawObject* raw_obj = obj.raw(); | 4414 RawObject* raw_obj = obj.raw(); |
| 4417 isolate->heap()->SetPeer(raw_obj, peer); | 4415 isolate->heap()->SetPeer(raw_obj, peer); |
| 4418 } | 4416 } |
| 4419 return Api::Success(); | 4417 return Api::Success(); |
| 4420 } | 4418 } |
| 4421 | 4419 |
| 4422 } // namespace dart | 4420 } // namespace dart |
| OLD | NEW |