| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/dart_entry.h" | 5 #include "vm/dart_entry.h" |
| 6 | 6 |
| 7 #include "vm/code_generator.h" | 7 #include "vm/code_generator.h" |
| 8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
| 9 #include "vm/object_store.h" | 9 #include "vm/object_store.h" |
| 10 #include "vm/resolver.h" | 10 #include "vm/resolver.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 const GrowableArray<const Object*>& arguments) { | 216 const GrowableArray<const Object*>& arguments) { |
| 217 const Class& cls = Class::Handle(lib.LookupClassAllowPrivate(class_name)); | 217 const Class& cls = Class::Handle(lib.LookupClassAllowPrivate(class_name)); |
| 218 ASSERT(!cls.IsNull()); | 218 ASSERT(!cls.IsNull()); |
| 219 // For now, we only support a non-parameterized or raw type. | 219 // For now, we only support a non-parameterized or raw type. |
| 220 const Instance& exception_object = Instance::Handle(Instance::New(cls)); | 220 const Instance& exception_object = Instance::Handle(Instance::New(cls)); |
| 221 GrowableArray<const Object*> constructor_arguments(arguments.length() + 2); | 221 GrowableArray<const Object*> constructor_arguments(arguments.length() + 2); |
| 222 constructor_arguments.Add(&exception_object); | 222 constructor_arguments.Add(&exception_object); |
| 223 constructor_arguments.Add(&Smi::Handle(Smi::New(Function::kCtorPhaseAll))); | 223 constructor_arguments.Add(&Smi::Handle(Smi::New(Function::kCtorPhaseAll))); |
| 224 constructor_arguments.AddArray(arguments); | 224 constructor_arguments.AddArray(arguments); |
| 225 | 225 |
| 226 const String& period = String::Handle(Symbols::Dot()); | 226 String& constructor_name = String::Handle( |
| 227 String& constructor_name = String::Handle(String::Concat(class_name, period)); | 227 String::Concat(class_name, Symbols::DotHandle())); |
| 228 Function& constructor = | 228 Function& constructor = |
| 229 Function::Handle(cls.LookupConstructor(constructor_name)); | 229 Function::Handle(cls.LookupConstructor(constructor_name)); |
| 230 ASSERT(!constructor.IsNull()); | 230 ASSERT(!constructor.IsNull()); |
| 231 const Array& kNoArgumentNames = Array::Handle(); | 231 const Array& kNoArgumentNames = Array::Handle(); |
| 232 const Object& retval = Object::Handle( | 232 const Object& retval = Object::Handle( |
| 233 DartEntry::InvokeStatic(constructor, constructor_arguments, | 233 DartEntry::InvokeStatic(constructor, constructor_arguments, |
| 234 kNoArgumentNames)); | 234 kNoArgumentNames)); |
| 235 ASSERT(retval.IsNull() || retval.IsError()); | 235 ASSERT(retval.IsNull() || retval.IsError()); |
| 236 if (retval.IsError()) { | 236 if (retval.IsError()) { |
| 237 return retval.raw(); | 237 return retval.raw(); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 const String& func_name = String::Handle(Field::GetterName(field_name)); | 361 const String& func_name = String::Handle(Field::GetterName(field_name)); |
| 362 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); | 362 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); |
| 363 ASSERT(!func.IsNull()); | 363 ASSERT(!func.IsNull()); |
| 364 GrowableArray<const Object*> arguments; | 364 GrowableArray<const Object*> arguments; |
| 365 const Array& kNoArgumentNames = Array::Handle(); | 365 const Array& kNoArgumentNames = Array::Handle(); |
| 366 return DartEntry::InvokeDynamic(port, func, arguments, kNoArgumentNames); | 366 return DartEntry::InvokeDynamic(port, func, arguments, kNoArgumentNames); |
| 367 } | 367 } |
| 368 | 368 |
| 369 | 369 |
| 370 } // namespace dart | 370 } // namespace dart |
| OLD | NEW |