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

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

Issue 10778005: Add a limited version of ParameterMirrors that can only tell whether they are (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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
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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 2839 matching lines...) Expand 10 before | Expand all | Expand 10 after
2850 // to check for a setter function here, but unfortunately the only 2850 // to check for a setter function here, but unfortunately the only
2851 // way to distinguish abstract setter functions is to use the name 2851 // way to distinguish abstract setter functions is to use the name
2852 // itself. Consider adding a RawFunction::kAbstractSetter type. 2852 // itself. Consider adding a RawFunction::kAbstractSetter type.
2853 const String& func_name = String::Handle(isolate, func.name()); 2853 const String& func_name = String::Handle(isolate, func.name());
2854 *is_setter = Field::IsSetterName(func_name); 2854 *is_setter = Field::IsSetterName(func_name);
2855 2855
2856 return Api::Success(isolate); 2856 return Api::Success(isolate);
2857 } 2857 }
2858 2858
2859 2859
2860 DART_EXPORT Dart_Handle Dart_FunctionParameterCounts(
2861 Dart_Handle function,
2862 int64_t* fixed_param_count,
2863 int64_t* opt_param_count) {
2864 Isolate* isolate = Isolate::Current();
2865 DARTSCOPE(isolate);
2866 if (fixed_param_count == NULL) {
2867 RETURN_NULL_ERROR(fixed_param_count);
2868 }
2869 if (opt_param_count == NULL) {
2870 RETURN_NULL_ERROR(opt_param_count);
2871 }
2872 const Function& func = Api::UnwrapFunctionHandle(isolate, function);
2873 if (func.IsNull()) {
2874 RETURN_TYPE_ERROR(isolate, function, Function);
2875 }
2876
2877 // We hide implicit parameters, such as a method's receiver. This is
2878 // consistent with Invoke or New, which don't expect their callers to
2879 // provide them in the argument lists they are handed.
2880 *fixed_param_count = (func.num_fixed_parameters() -
2881 func.NumberOfImplicitParameters());
2882 *opt_param_count = func.num_optional_parameters();
2883
2884 return Api::Success(isolate);
2885 }
2886
2887
2860 DART_EXPORT Dart_Handle Dart_GetVariableNames(Dart_Handle target) { 2888 DART_EXPORT Dart_Handle Dart_GetVariableNames(Dart_Handle target) {
2861 Isolate* isolate = Isolate::Current(); 2889 Isolate* isolate = Isolate::Current();
2862 DARTSCOPE(isolate); 2890 DARTSCOPE(isolate);
2863 const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(target)); 2891 const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(target));
2864 if (obj.IsError()) { 2892 if (obj.IsError()) {
2865 return target; 2893 return target;
2866 } 2894 }
2867 2895
2868 const GrowableObjectArray& names = 2896 const GrowableObjectArray& names =
2869 GrowableObjectArray::Handle(isolate, GrowableObjectArray::New()); 2897 GrowableObjectArray::Handle(isolate, GrowableObjectArray::New());
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
4120 *buffer_size = 0; 4148 *buffer_size = 0;
4121 } 4149 }
4122 } 4150 }
4123 4151
4124 4152
4125 DART_EXPORT void Dart_InitFlowGraphPrinting(FileWriterFunction function) { 4153 DART_EXPORT void Dart_InitFlowGraphPrinting(FileWriterFunction function) {
4126 Dart::set_flow_graph_writer(function); 4154 Dart::set_flow_graph_writer(function);
4127 } 4155 }
4128 4156
4129 } // namespace dart 4157 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698