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/debugger.h" | 9 #include "vm/debugger.h" |
10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 } | 344 } |
345 | 345 |
346 | 346 |
347 void ArgumentsDescriptor::InitOnce() { | 347 void ArgumentsDescriptor::InitOnce() { |
348 for (int i = 0; i < kCachedDescriptorCount; i++) { | 348 for (int i = 0; i < kCachedDescriptorCount; i++) { |
349 cached_args_descriptors_[i] = ArgumentsDescriptor::NewNonCached(i, false); | 349 cached_args_descriptors_[i] = ArgumentsDescriptor::NewNonCached(i, false); |
350 } | 350 } |
351 } | 351 } |
352 | 352 |
353 | 353 |
354 RawObject* DartLibraryCalls::ExceptionCreate(const Library& lib, | 354 RawObject* DartLibraryCalls::InstanceCreate(const Library& lib, |
355 const String& class_name, | 355 const String& class_name, |
356 const String& constructor_name, | 356 const String& constructor_name, |
357 const Array& arguments) { | 357 const Array& arguments) { |
358 const Class& cls = Class::Handle(lib.LookupClassAllowPrivate(class_name)); | 358 const Class& cls = Class::Handle(lib.LookupClassAllowPrivate(class_name)); |
359 ASSERT(!cls.IsNull()); | 359 ASSERT(!cls.IsNull()); |
360 // For now, we only support a non-parameterized or raw type. | 360 // For now, we only support a non-parameterized or raw type. |
361 const int kNumExtraArgs = 2; // implicit rcvr and construction phase args. | 361 const int kNumExtraArgs = 2; // implicit rcvr and construction phase args. |
362 const Instance& exception_object = Instance::Handle(Instance::New(cls)); | 362 const Instance& exception_object = Instance::Handle(Instance::New(cls)); |
363 const Array& constructor_arguments = | 363 const Array& constructor_arguments = |
364 Array::Handle(Array::New(arguments.Length() + kNumExtraArgs)); | 364 Array::Handle(Array::New(arguments.Length() + kNumExtraArgs)); |
365 constructor_arguments.SetAt(0, exception_object); | 365 constructor_arguments.SetAt(0, exception_object); |
366 constructor_arguments.SetAt( | 366 constructor_arguments.SetAt( |
367 1, Smi::Handle(Smi::New(Function::kCtorPhaseAll))); | 367 1, Smi::Handle(Smi::New(Function::kCtorPhaseAll))); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 String::Handle(Field::GetterName(Symbols::_id())))); | 545 String::Handle(Field::GetterName(Symbols::_id())))); |
546 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); | 546 const Function& func = Function::Handle(cls.LookupDynamicFunction(func_name)); |
547 ASSERT(!func.IsNull()); | 547 ASSERT(!func.IsNull()); |
548 const Array& args = Array::Handle(Array::New(1)); | 548 const Array& args = Array::Handle(Array::New(1)); |
549 args.SetAt(0, port); | 549 args.SetAt(0, port); |
550 return DartEntry::InvokeFunction(func, args); | 550 return DartEntry::InvokeFunction(func, args); |
551 } | 551 } |
552 | 552 |
553 | 553 |
554 } // namespace dart | 554 } // namespace dart |
OLD | NEW |