OLD | NEW |
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/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 RawClass* Object::void_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 72 RawClass* Object::void_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
73 RawClass* Object::unresolved_class_class_ = | 73 RawClass* Object::unresolved_class_class_ = |
74 reinterpret_cast<RawClass*>(RAW_NULL); | 74 reinterpret_cast<RawClass*>(RAW_NULL); |
75 RawClass* Object::type_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 75 RawClass* Object::type_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
76 RawClass* Object::type_parameter_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 76 RawClass* Object::type_parameter_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
77 RawClass* Object::type_arguments_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 77 RawClass* Object::type_arguments_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
78 RawClass* Object::instantiated_type_arguments_class_ = | 78 RawClass* Object::instantiated_type_arguments_class_ = |
79 reinterpret_cast<RawClass*>(RAW_NULL); | 79 reinterpret_cast<RawClass*>(RAW_NULL); |
80 RawClass* Object::patch_class_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 80 RawClass* Object::patch_class_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
81 RawClass* Object::function_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 81 RawClass* Object::function_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 82 RawClass* Object::closure_data_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
82 RawClass* Object::field_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 83 RawClass* Object::field_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
83 RawClass* Object::literal_token_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 84 RawClass* Object::literal_token_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
84 RawClass* Object::token_stream_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 85 RawClass* Object::token_stream_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
85 RawClass* Object::script_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 86 RawClass* Object::script_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
86 RawClass* Object::library_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 87 RawClass* Object::library_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
87 RawClass* Object::library_prefix_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 88 RawClass* Object::library_prefix_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
88 RawClass* Object::code_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 89 RawClass* Object::code_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
89 RawClass* Object::instructions_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 90 RawClass* Object::instructions_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
90 RawClass* Object::pc_descriptors_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 91 RawClass* Object::pc_descriptors_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
91 RawClass* Object::stackmap_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 92 RawClass* Object::stackmap_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 | 325 |
325 cls = Class::New<InstantiatedTypeArguments>(); | 326 cls = Class::New<InstantiatedTypeArguments>(); |
326 instantiated_type_arguments_class_ = cls.raw(); | 327 instantiated_type_arguments_class_ = cls.raw(); |
327 | 328 |
328 cls = Class::New<PatchClass>(); | 329 cls = Class::New<PatchClass>(); |
329 patch_class_class_ = cls.raw(); | 330 patch_class_class_ = cls.raw(); |
330 | 331 |
331 cls = Class::New<Function>(); | 332 cls = Class::New<Function>(); |
332 function_class_ = cls.raw(); | 333 function_class_ = cls.raw(); |
333 | 334 |
| 335 cls = Class::New<ClosureData>(); |
| 336 closure_data_class_ = cls.raw(); |
| 337 |
334 cls = Class::New<Field>(); | 338 cls = Class::New<Field>(); |
335 field_class_ = cls.raw(); | 339 field_class_ = cls.raw(); |
336 | 340 |
337 cls = Class::New<LiteralToken>(); | 341 cls = Class::New<LiteralToken>(); |
338 literal_token_class_ = cls.raw(); | 342 literal_token_class_ = cls.raw(); |
339 | 343 |
340 cls = Class::New<TokenStream>(); | 344 cls = Class::New<TokenStream>(); |
341 token_stream_class_ = cls.raw(); | 345 token_stream_class_ = cls.raw(); |
342 | 346 |
343 cls = Class::New<Script>(); | 347 cls = Class::New<Script>(); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 SET_CLASS_NAME(null, Null); | 432 SET_CLASS_NAME(null, Null); |
429 SET_CLASS_NAME(dynamic, Dynamic); | 433 SET_CLASS_NAME(dynamic, Dynamic); |
430 SET_CLASS_NAME(void, Void); | 434 SET_CLASS_NAME(void, Void); |
431 SET_CLASS_NAME(unresolved_class, UnresolvedClass); | 435 SET_CLASS_NAME(unresolved_class, UnresolvedClass); |
432 SET_CLASS_NAME(type, Type); | 436 SET_CLASS_NAME(type, Type); |
433 SET_CLASS_NAME(type_parameter, TypeParameter); | 437 SET_CLASS_NAME(type_parameter, TypeParameter); |
434 SET_CLASS_NAME(type_arguments, TypeArguments); | 438 SET_CLASS_NAME(type_arguments, TypeArguments); |
435 SET_CLASS_NAME(instantiated_type_arguments, InstantiatedTypeArguments); | 439 SET_CLASS_NAME(instantiated_type_arguments, InstantiatedTypeArguments); |
436 SET_CLASS_NAME(patch_class, PatchClass); | 440 SET_CLASS_NAME(patch_class, PatchClass); |
437 SET_CLASS_NAME(function, Function); | 441 SET_CLASS_NAME(function, Function); |
| 442 SET_CLASS_NAME(closure_data, ClosureData); |
438 SET_CLASS_NAME(field, Field); | 443 SET_CLASS_NAME(field, Field); |
439 SET_CLASS_NAME(literal_token, LiteralToken); | 444 SET_CLASS_NAME(literal_token, LiteralToken); |
440 SET_CLASS_NAME(token_stream, TokenStream); | 445 SET_CLASS_NAME(token_stream, TokenStream); |
441 SET_CLASS_NAME(script, Script); | 446 SET_CLASS_NAME(script, Script); |
442 SET_CLASS_NAME(library, LibraryClass); | 447 SET_CLASS_NAME(library, LibraryClass); |
443 SET_CLASS_NAME(library_prefix, LibraryPrefix); | 448 SET_CLASS_NAME(library_prefix, LibraryPrefix); |
444 SET_CLASS_NAME(code, Code); | 449 SET_CLASS_NAME(code, Code); |
445 SET_CLASS_NAME(instructions, Instructions); | 450 SET_CLASS_NAME(instructions, Instructions); |
446 SET_CLASS_NAME(pc_descriptors, PcDescriptors); | 451 SET_CLASS_NAME(pc_descriptors, PcDescriptors); |
447 SET_CLASS_NAME(stackmap, Stackmap); | 452 SET_CLASS_NAME(stackmap, Stackmap); |
(...skipping 3346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3794 SetCode(Code::Handle(unoptimized_code())); | 3799 SetCode(Code::Handle(unoptimized_code())); |
3795 CodePatcher::RestoreEntry(Code::Handle(unoptimized_code())); | 3800 CodePatcher::RestoreEntry(Code::Handle(unoptimized_code())); |
3796 } | 3801 } |
3797 | 3802 |
3798 | 3803 |
3799 void Function::set_unoptimized_code(const Code& value) const { | 3804 void Function::set_unoptimized_code(const Code& value) const { |
3800 StorePointer(&raw_ptr()->unoptimized_code_, value.raw()); | 3805 StorePointer(&raw_ptr()->unoptimized_code_, value.raw()); |
3801 } | 3806 } |
3802 | 3807 |
3803 | 3808 |
| 3809 RawContextScope* Function::context_scope() const { |
| 3810 if (IsClosureFunction()) { |
| 3811 const Object& obj = Object::Handle(raw_ptr()->data_); |
| 3812 ASSERT(!obj.IsNull()); |
| 3813 return ClosureData::Cast(obj).context_scope(); |
| 3814 } |
| 3815 return ContextScope::null(); |
| 3816 } |
| 3817 |
| 3818 |
3804 void Function::set_context_scope(const ContextScope& value) const { | 3819 void Function::set_context_scope(const ContextScope& value) const { |
3805 StorePointer(&raw_ptr()->context_scope_, value.raw()); | 3820 if (IsClosureFunction()) { |
| 3821 const Object& obj = Object::Handle(raw_ptr()->data_); |
| 3822 ASSERT(!obj.IsNull()); |
| 3823 ClosureData::Cast(obj).set_context_scope(value); |
| 3824 return; |
| 3825 } |
| 3826 UNREACHABLE(); |
| 3827 } |
| 3828 |
| 3829 |
| 3830 RawCode* Function::closure_allocation_stub() const { |
| 3831 if (IsClosureFunction()) { |
| 3832 const Object& obj = Object::Handle(raw_ptr()->data_); |
| 3833 ASSERT(!obj.IsNull()); |
| 3834 return ClosureData::Cast(obj).closure_allocation_stub(); |
| 3835 } |
| 3836 return Code::null(); |
3806 } | 3837 } |
3807 | 3838 |
3808 | 3839 |
3809 void Function::set_closure_allocation_stub(const Code& value) const { | 3840 void Function::set_closure_allocation_stub(const Code& value) const { |
3810 ASSERT(!value.IsNull()); | 3841 if (IsClosureFunction()) { |
3811 ASSERT(raw_ptr()->closure_allocation_stub_ == Code::null()); | 3842 const Object& obj = Object::Handle(raw_ptr()->data_); |
3812 StorePointer(&raw_ptr()->closure_allocation_stub_, value.raw()); | 3843 ASSERT(!obj.IsNull()); |
| 3844 ClosureData::Cast(obj).set_closure_allocation_stub(value); |
| 3845 return; |
| 3846 } |
| 3847 UNREACHABLE(); |
| 3848 } |
| 3849 |
| 3850 |
| 3851 RawFunction* Function::parent_function() const { |
| 3852 if (IsClosureFunction()) { |
| 3853 const Object& obj = Object::Handle(raw_ptr()->data_); |
| 3854 ASSERT(!obj.IsNull()); |
| 3855 return ClosureData::Cast(obj).parent_function(); |
| 3856 } |
| 3857 return Function::null(); |
| 3858 } |
| 3859 |
| 3860 |
| 3861 void Function::set_parent_function(const Function& value) const { |
| 3862 if (IsClosureFunction()) { |
| 3863 const Object& obj = Object::Handle(raw_ptr()->data_); |
| 3864 ASSERT(!obj.IsNull()); |
| 3865 ClosureData::Cast(obj).set_parent_function(value); |
| 3866 return; |
| 3867 } |
| 3868 UNREACHABLE(); |
| 3869 } |
| 3870 |
| 3871 |
| 3872 RawFunction* Function::implicit_closure_function() const { |
| 3873 if (IsClosureFunction() || IsSignatureFunction()) { |
| 3874 return Function::null(); |
| 3875 } |
| 3876 const Object& obj = Object::Handle(raw_ptr()->data_); |
| 3877 ASSERT(obj.IsNull() || obj.IsFunction()); |
| 3878 return (obj.IsNull()) ? Function::null() : Function::Cast(obj).raw(); |
3813 } | 3879 } |
3814 | 3880 |
3815 | 3881 |
3816 void Function::set_implicit_closure_function(const Function& value) const { | 3882 void Function::set_implicit_closure_function(const Function& value) const { |
3817 ASSERT(!value.IsNull()); | 3883 ASSERT(!IsClosureFunction() && !IsSignatureFunction()); |
3818 ASSERT(raw_ptr()->implicit_closure_function_ == Function::null()); | 3884 set_data(value); |
3819 StorePointer(&raw_ptr()->implicit_closure_function_, value.raw()); | |
3820 } | 3885 } |
3821 | 3886 |
3822 | 3887 |
3823 void Function::set_parent_function(const Function& value) const { | 3888 RawClass* Function::signature_class() const { |
3824 StorePointer(&raw_ptr()->parent_function_, value.raw()); | 3889 if (IsSignatureFunction()) { |
| 3890 const Object& obj = Object::Handle(raw_ptr()->data_); |
| 3891 ASSERT(obj.IsNull() || obj.IsClass()); |
| 3892 return (obj.IsNull()) ? Class::null() : Class::Cast(obj).raw(); |
| 3893 } |
| 3894 if (IsClosureFunction()) { |
| 3895 const Object& obj = Object::Handle(raw_ptr()->data_); |
| 3896 ASSERT(!obj.IsNull()); |
| 3897 return ClosureData::Cast(obj).signature_class(); |
| 3898 } |
| 3899 return Class::null(); |
3825 } | 3900 } |
3826 | 3901 |
3827 | 3902 |
3828 void Function::set_signature_class(const Class& value) const { | 3903 void Function::set_signature_class(const Class& value) const { |
3829 StorePointer(&raw_ptr()->signature_class_, value.raw()); | 3904 if (IsSignatureFunction()) { |
| 3905 set_data(value); |
| 3906 return; |
| 3907 } |
| 3908 if (IsClosureFunction()) { |
| 3909 const Object& obj = Object::Handle(raw_ptr()->data_); |
| 3910 ASSERT(!obj.IsNull()); |
| 3911 ClosureData::Cast(obj).set_signature_class(value); |
| 3912 return; |
| 3913 } |
| 3914 UNREACHABLE(); |
| 3915 } |
| 3916 |
| 3917 |
| 3918 void Function::set_data(const Object& value) const { |
| 3919 StorePointer(&raw_ptr()->data_, value.raw()); |
3830 } | 3920 } |
3831 | 3921 |
3832 | 3922 |
3833 bool Function::IsInFactoryScope() const { | 3923 bool Function::IsInFactoryScope() const { |
3834 Function& outer_function = Function::Handle(raw()); | 3924 Function& outer_function = Function::Handle(raw()); |
3835 while (outer_function.IsLocalFunction()) { | 3925 while (outer_function.IsLocalFunction()) { |
3836 outer_function = outer_function.parent_function(); | 3926 outer_function = outer_function.parent_function(); |
3837 } | 3927 } |
3838 return outer_function.IsFactory(); | 3928 return outer_function.IsFactory(); |
3839 } | 3929 } |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4465 } | 4555 } |
4466 return true; | 4556 return true; |
4467 } | 4557 } |
4468 | 4558 |
4469 | 4559 |
4470 bool Function::IsImplicitClosureFunction() const { | 4560 bool Function::IsImplicitClosureFunction() const { |
4471 if (!IsClosureFunction()) { | 4561 if (!IsClosureFunction()) { |
4472 return false; | 4562 return false; |
4473 } | 4563 } |
4474 const Function& parent = Function::Handle(parent_function()); | 4564 const Function& parent = Function::Handle(parent_function()); |
4475 return parent.raw_ptr()->implicit_closure_function_ == raw(); | 4565 return (parent.implicit_closure_function() == raw()); |
4476 } | 4566 } |
4477 | 4567 |
4478 | 4568 |
4479 RawFunction* Function::New() { | 4569 RawFunction* Function::New() { |
4480 ASSERT(Object::function_class() != Class::null()); | 4570 ASSERT(Object::function_class() != Class::null()); |
4481 RawObject* raw = Object::Allocate(Function::kClassId, | 4571 RawObject* raw = Object::Allocate(Function::kClassId, |
4482 Function::InstanceSize(), | 4572 Function::InstanceSize(), |
4483 Heap::kOld); | 4573 Heap::kOld); |
4484 return reinterpret_cast<RawFunction*>(raw); | 4574 return reinterpret_cast<RawFunction*>(raw); |
4485 } | 4575 } |
(...skipping 23 matching lines...) Expand all Loading... |
4509 result.set_token_pos(token_pos); | 4599 result.set_token_pos(token_pos); |
4510 result.set_end_token_pos(token_pos); | 4600 result.set_end_token_pos(token_pos); |
4511 result.set_num_fixed_parameters(0); | 4601 result.set_num_fixed_parameters(0); |
4512 result.set_num_optional_positional_parameters(0); | 4602 result.set_num_optional_positional_parameters(0); |
4513 result.set_num_optional_named_parameters(0); | 4603 result.set_num_optional_named_parameters(0); |
4514 result.set_usage_counter(0); | 4604 result.set_usage_counter(0); |
4515 result.set_deoptimization_counter(0); | 4605 result.set_deoptimization_counter(0); |
4516 result.set_is_optimizable(true); | 4606 result.set_is_optimizable(true); |
4517 result.set_has_finally(false); | 4607 result.set_has_finally(false); |
4518 result.set_is_native(false); | 4608 result.set_is_native(false); |
| 4609 if (kind == RawFunction::kClosureFunction) { |
| 4610 const ClosureData& data = ClosureData::Handle(ClosureData::New()); |
| 4611 result.set_data(data); |
| 4612 } |
4519 return result.raw(); | 4613 return result.raw(); |
4520 } | 4614 } |
4521 | 4615 |
4522 | 4616 |
4523 RawFunction* Function::NewClosureFunction(const String& name, | 4617 RawFunction* Function::NewClosureFunction(const String& name, |
4524 const Function& parent, | 4618 const Function& parent, |
4525 intptr_t token_pos) { | 4619 intptr_t token_pos) { |
4526 ASSERT(name.IsOneByteString()); | 4620 ASSERT(name.IsOneByteString()); |
4527 ASSERT(!parent.IsNull()); | 4621 ASSERT(!parent.IsNull()); |
4528 // Use the owner defining the parent function and not the class containing it. | 4622 // Use the owner defining the parent function and not the class containing it. |
4529 const Object& parent_owner = Object::Handle(parent.raw_ptr()->owner_); | 4623 const Object& parent_owner = Object::Handle(parent.raw_ptr()->owner_); |
4530 ASSERT(!parent_owner.IsNull()); | 4624 ASSERT(!parent_owner.IsNull()); |
4531 const Function& result = Function::Handle( | 4625 const Function& result = Function::Handle( |
4532 Function::New(name, | 4626 Function::New(name, |
4533 RawFunction::kClosureFunction, | 4627 RawFunction::kClosureFunction, |
4534 /* is_static = */ parent.is_static(), | 4628 /* is_static = */ parent.is_static(), |
4535 /* is_const = */ false, | 4629 /* is_const = */ false, |
4536 /* is_abstract = */ false, | 4630 /* is_abstract = */ false, |
4537 /* is_external = */ false, | 4631 /* is_external = */ false, |
4538 parent_owner, | 4632 parent_owner, |
4539 token_pos)); | 4633 token_pos)); |
4540 result.set_parent_function(parent); | 4634 result.set_parent_function(parent); |
4541 return result.raw(); | 4635 return result.raw(); |
4542 } | 4636 } |
4543 | 4637 |
4544 | 4638 |
4545 RawFunction* Function::ImplicitClosureFunction() const { | 4639 RawFunction* Function::ImplicitClosureFunction() const { |
4546 // Return the existing implicit closure function if any. | 4640 // Return the existing implicit closure function if any. |
4547 if (raw_ptr()->implicit_closure_function_ != Function::null()) { | 4641 if (implicit_closure_function() != Function::null()) { |
4548 return raw_ptr()->implicit_closure_function_; | 4642 return implicit_closure_function(); |
4549 } | 4643 } |
4550 ASSERT(!IsSignatureFunction() && !IsClosureFunction()); | 4644 ASSERT(!IsSignatureFunction() && !IsClosureFunction()); |
4551 // Create closure function. | 4645 // Create closure function. |
4552 const String& closure_name = String::Handle(name()); | 4646 const String& closure_name = String::Handle(name()); |
4553 const Function& closure_function = Function::Handle( | 4647 const Function& closure_function = Function::Handle( |
4554 NewClosureFunction(closure_name, *this, token_pos())); | 4648 NewClosureFunction(closure_name, *this, token_pos())); |
4555 | 4649 |
4556 // Set closure function's context scope. | 4650 // Set closure function's context scope. |
4557 ContextScope& context_scope = ContextScope::Handle(); | 4651 ContextScope& context_scope = ContextScope::Handle(); |
4558 if (is_static()) { | 4652 if (is_static()) { |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4838 const char* function_name = String::Handle(name()).ToCString(); | 4932 const char* function_name = String::Handle(name()).ToCString(); |
4839 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, | 4933 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, |
4840 static_str, abstract_str, kind_str, const_str) + 1; | 4934 static_str, abstract_str, kind_str, const_str) + 1; |
4841 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 4935 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
4842 OS::SNPrint(chars, len, kFormat, function_name, | 4936 OS::SNPrint(chars, len, kFormat, function_name, |
4843 static_str, abstract_str, kind_str, const_str); | 4937 static_str, abstract_str, kind_str, const_str); |
4844 return chars; | 4938 return chars; |
4845 } | 4939 } |
4846 | 4940 |
4847 | 4941 |
| 4942 void ClosureData::set_context_scope(const ContextScope& value) const { |
| 4943 StorePointer(&raw_ptr()->context_scope_, value.raw()); |
| 4944 } |
| 4945 |
| 4946 |
| 4947 void ClosureData::set_closure_allocation_stub(const Code& value) const { |
| 4948 ASSERT(!value.IsNull()); |
| 4949 ASSERT(raw_ptr()->closure_allocation_stub_ == Code::null()); |
| 4950 StorePointer(&raw_ptr()->closure_allocation_stub_, value.raw()); |
| 4951 } |
| 4952 |
| 4953 |
| 4954 void ClosureData::set_parent_function(const Function& value) const { |
| 4955 StorePointer(&raw_ptr()->parent_function_, value.raw()); |
| 4956 } |
| 4957 |
| 4958 |
| 4959 void ClosureData::set_signature_class(const Class& value) const { |
| 4960 StorePointer(&raw_ptr()->signature_class_, value.raw()); |
| 4961 } |
| 4962 |
| 4963 |
| 4964 RawClosureData* ClosureData::New() { |
| 4965 ASSERT(Object::closure_data_class() != Class::null()); |
| 4966 RawObject* raw = Object::Allocate(ClosureData::kClassId, |
| 4967 ClosureData::InstanceSize(), |
| 4968 Heap::kOld); |
| 4969 return reinterpret_cast<RawClosureData*>(raw); |
| 4970 } |
| 4971 |
| 4972 |
| 4973 const char* ClosureData::ToCString() const { |
| 4974 return "ClosureData class"; |
| 4975 } |
| 4976 |
| 4977 |
4848 RawString* Field::GetterName(const String& field_name) { | 4978 RawString* Field::GetterName(const String& field_name) { |
4849 String& str = String::Handle(); | 4979 String& str = String::Handle(); |
4850 str = String::New(kGetterPrefix); | 4980 str = String::New(kGetterPrefix); |
4851 str = String::Concat(str, field_name); | 4981 str = String::Concat(str, field_name); |
4852 return str.raw(); | 4982 return str.raw(); |
4853 } | 4983 } |
4854 | 4984 |
4855 | 4985 |
4856 RawString* Field::GetterSymbol(const String& field_name) { | 4986 RawString* Field::GetterSymbol(const String& field_name) { |
4857 String& str = String::Handle(); | 4987 String& str = String::Handle(); |
(...skipping 6644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11502 } | 11632 } |
11503 return result.raw(); | 11633 return result.raw(); |
11504 } | 11634 } |
11505 | 11635 |
11506 | 11636 |
11507 const char* WeakProperty::ToCString() const { | 11637 const char* WeakProperty::ToCString() const { |
11508 return "_WeakProperty"; | 11638 return "_WeakProperty"; |
11509 } | 11639 } |
11510 | 11640 |
11511 } // namespace dart | 11641 } // namespace dart |
OLD | NEW |