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/become.h" | 10 #include "vm/become.h" |
(...skipping 2722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2733 false, // Not native. | 2733 false, // Not native. |
2734 owner, TokenPosition::kMethodExtractor)); | 2734 owner, TokenPosition::kMethodExtractor)); |
2735 | 2735 |
2736 // Initialize signature: receiver is a single fixed parameter. | 2736 // Initialize signature: receiver is a single fixed parameter. |
2737 const intptr_t kNumParameters = 1; | 2737 const intptr_t kNumParameters = 1; |
2738 extractor.set_num_fixed_parameters(kNumParameters); | 2738 extractor.set_num_fixed_parameters(kNumParameters); |
2739 extractor.SetNumOptionalParameters(0, 0); | 2739 extractor.SetNumOptionalParameters(0, 0); |
2740 extractor.set_parameter_types(Object::extractor_parameter_types()); | 2740 extractor.set_parameter_types(Object::extractor_parameter_types()); |
2741 extractor.set_parameter_names(Object::extractor_parameter_names()); | 2741 extractor.set_parameter_names(Object::extractor_parameter_names()); |
2742 extractor.set_result_type(Object::dynamic_type()); | 2742 extractor.set_result_type(Object::dynamic_type()); |
2743 extractor.set_kernel_function(kernel_function()); | 2743 extractor.set_kernel_offset(kernel_offset()); |
2744 | 2744 |
2745 extractor.set_extracted_method_closure(closure_function); | 2745 extractor.set_extracted_method_closure(closure_function); |
2746 extractor.set_is_debuggable(false); | 2746 extractor.set_is_debuggable(false); |
2747 extractor.set_is_visible(false); | 2747 extractor.set_is_visible(false); |
2748 | 2748 |
2749 owner.AddFunction(extractor); | 2749 owner.AddFunction(extractor); |
2750 | 2750 |
2751 return extractor.raw(); | 2751 return extractor.raw(); |
2752 } | 2752 } |
2753 | 2753 |
(...skipping 4034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6788 NOT_IN_PRECOMPILED(result.set_was_compiled(false)); | 6788 NOT_IN_PRECOMPILED(result.set_was_compiled(false)); |
6789 result.set_owner(owner); | 6789 result.set_owner(owner); |
6790 NOT_IN_PRECOMPILED(result.set_token_pos(token_pos)); | 6790 NOT_IN_PRECOMPILED(result.set_token_pos(token_pos)); |
6791 NOT_IN_PRECOMPILED(result.set_end_token_pos(token_pos)); | 6791 NOT_IN_PRECOMPILED(result.set_end_token_pos(token_pos)); |
6792 result.set_num_fixed_parameters(0); | 6792 result.set_num_fixed_parameters(0); |
6793 result.set_num_optional_parameters(0); | 6793 result.set_num_optional_parameters(0); |
6794 NOT_IN_PRECOMPILED(result.set_usage_counter(0)); | 6794 NOT_IN_PRECOMPILED(result.set_usage_counter(0)); |
6795 NOT_IN_PRECOMPILED(result.set_deoptimization_counter(0)); | 6795 NOT_IN_PRECOMPILED(result.set_deoptimization_counter(0)); |
6796 NOT_IN_PRECOMPILED(result.set_optimized_instruction_count(0)); | 6796 NOT_IN_PRECOMPILED(result.set_optimized_instruction_count(0)); |
6797 NOT_IN_PRECOMPILED(result.set_optimized_call_site_count(0)); | 6797 NOT_IN_PRECOMPILED(result.set_optimized_call_site_count(0)); |
6798 result.set_kernel_function(NULL); | 6798 result.set_kernel_offset(-1); |
6799 result.set_is_optimizable(is_native ? false : true); | 6799 result.set_is_optimizable(is_native ? false : true); |
6800 result.set_is_inlinable(true); | 6800 result.set_is_inlinable(true); |
6801 result.set_allows_hoisting_check_class(true); | 6801 result.set_allows_hoisting_check_class(true); |
6802 result.set_allows_bounds_check_generalization(true); | 6802 result.set_allows_bounds_check_generalization(true); |
6803 result.SetInstructionsSafe( | 6803 result.SetInstructionsSafe( |
6804 Code::Handle(StubCode::LazyCompile_entry()->code())); | 6804 Code::Handle(StubCode::LazyCompile_entry()->code())); |
6805 if (kind == RawFunction::kClosureFunction) { | 6805 if (kind == RawFunction::kClosureFunction) { |
6806 ASSERT(space == Heap::kOld); | 6806 ASSERT(space == Heap::kOld); |
6807 const ClosureData& data = ClosureData::Handle(ClosureData::New()); | 6807 const ClosureData& data = ClosureData::Handle(ClosureData::New()); |
6808 result.set_data(data); | 6808 result.set_data(data); |
(...skipping 19 matching lines...) Expand all Loading... |
6828 const Class& origin = Class::Handle(zone, this->origin()); | 6828 const Class& origin = Class::Handle(zone, this->origin()); |
6829 const PatchClass& clone_owner = | 6829 const PatchClass& clone_owner = |
6830 PatchClass::Handle(zone, PatchClass::New(new_owner, origin)); | 6830 PatchClass::Handle(zone, PatchClass::New(new_owner, origin)); |
6831 clone.set_owner(clone_owner); | 6831 clone.set_owner(clone_owner); |
6832 clone.ClearICDataArray(); | 6832 clone.ClearICDataArray(); |
6833 clone.ClearCode(); | 6833 clone.ClearCode(); |
6834 clone.set_usage_counter(0); | 6834 clone.set_usage_counter(0); |
6835 clone.set_deoptimization_counter(0); | 6835 clone.set_deoptimization_counter(0); |
6836 clone.set_optimized_instruction_count(0); | 6836 clone.set_optimized_instruction_count(0); |
6837 clone.set_optimized_call_site_count(0); | 6837 clone.set_optimized_call_site_count(0); |
6838 clone.set_kernel_function(kernel_function()); | 6838 clone.set_kernel_offset(kernel_offset()); |
6839 if (new_owner.NumTypeParameters() > 0) { | 6839 if (new_owner.NumTypeParameters() > 0) { |
6840 // Adjust uninstantiated types to refer to type parameters of the new owner. | 6840 // Adjust uninstantiated types to refer to type parameters of the new owner. |
6841 const TypeArguments& type_params = | 6841 const TypeArguments& type_params = |
6842 TypeArguments::Handle(zone, type_parameters()); | 6842 TypeArguments::Handle(zone, type_parameters()); |
6843 if (!type_params.IsNull()) { | 6843 if (!type_params.IsNull()) { |
6844 const intptr_t num_type_params = type_params.Length(); | 6844 const intptr_t num_type_params = type_params.Length(); |
6845 const TypeArguments& type_params_clone = | 6845 const TypeArguments& type_params_clone = |
6846 TypeArguments::Handle(zone, TypeArguments::New(num_type_params)); | 6846 TypeArguments::Handle(zone, TypeArguments::New(num_type_params)); |
6847 TypeParameter& type_param = TypeParameter::Handle(zone); | 6847 TypeParameter& type_param = TypeParameter::Handle(zone); |
6848 for (intptr_t i = 0; i < num_type_params; i++) { | 6848 for (intptr_t i = 0; i < num_type_params; i++) { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6984 // Add implicit closure object parameter. | 6984 // Add implicit closure object parameter. |
6985 param_type = Type::DynamicType(); | 6985 param_type = Type::DynamicType(); |
6986 closure_function.SetParameterTypeAt(0, param_type); | 6986 closure_function.SetParameterTypeAt(0, param_type); |
6987 closure_function.SetParameterNameAt(0, Symbols::ClosureParameter()); | 6987 closure_function.SetParameterNameAt(0, Symbols::ClosureParameter()); |
6988 for (int i = kClosure; i < num_params; i++) { | 6988 for (int i = kClosure; i < num_params; i++) { |
6989 param_type = ParameterTypeAt(has_receiver - kClosure + i); | 6989 param_type = ParameterTypeAt(has_receiver - kClosure + i); |
6990 closure_function.SetParameterTypeAt(i, param_type); | 6990 closure_function.SetParameterTypeAt(i, param_type); |
6991 param_name = ParameterNameAt(has_receiver - kClosure + i); | 6991 param_name = ParameterNameAt(has_receiver - kClosure + i); |
6992 closure_function.SetParameterNameAt(i, param_name); | 6992 closure_function.SetParameterNameAt(i, param_name); |
6993 } | 6993 } |
6994 closure_function.set_kernel_function(kernel_function()); | 6994 closure_function.set_kernel_offset(kernel_offset()); |
6995 | 6995 |
6996 const Type& signature_type = | 6996 const Type& signature_type = |
6997 Type::Handle(zone, closure_function.SignatureType()); | 6997 Type::Handle(zone, closure_function.SignatureType()); |
6998 if (!signature_type.IsFinalized()) { | 6998 if (!signature_type.IsFinalized()) { |
6999 ClassFinalizer::FinalizeType(Class::Handle(zone, Owner()), signature_type); | 6999 ClassFinalizer::FinalizeType(Class::Handle(zone, Owner()), signature_type); |
7000 } | 7000 } |
7001 set_implicit_closure_function(closure_function); | 7001 set_implicit_closure_function(closure_function); |
7002 ASSERT(closure_function.IsImplicitClosureFunction()); | 7002 ASSERT(closure_function.IsImplicitClosureFunction()); |
7003 return closure_function.raw(); | 7003 return closure_function.raw(); |
7004 } | 7004 } |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7454 for (intptr_t i = 1; i < array.Length(); i++) { | 7454 for (intptr_t i = 1; i < array.Length(); i++) { |
7455 ic_data ^= array.At(i); | 7455 ic_data ^= array.At(i); |
7456 if (ic_data.deopt_id() == deopt_id) { | 7456 if (ic_data.deopt_id() == deopt_id) { |
7457 ic_data.AddDeoptReason(reason); | 7457 ic_data.AddDeoptReason(reason); |
7458 } | 7458 } |
7459 } | 7459 } |
7460 } | 7460 } |
7461 | 7461 |
7462 | 7462 |
7463 bool Function::CheckSourceFingerprint(const char* prefix, int32_t fp) const { | 7463 bool Function::CheckSourceFingerprint(const char* prefix, int32_t fp) const { |
7464 if ((kernel_function() == NULL) && (SourceFingerprint() != fp)) { | 7464 if ((kernel_offset() <= 0) && (SourceFingerprint() != fp)) { |
7465 const bool recalculatingFingerprints = false; | 7465 const bool recalculatingFingerprints = false; |
7466 if (recalculatingFingerprints) { | 7466 if (recalculatingFingerprints) { |
7467 // This output can be copied into a file, then used with sed | 7467 // This output can be copied into a file, then used with sed |
7468 // to replace the old values. | 7468 // to replace the old values. |
7469 // sed -i.bak -f /tmp/newkeys runtime/vm/method_recognizer.h | 7469 // sed -i.bak -f /tmp/newkeys runtime/vm/method_recognizer.h |
7470 THR_Print("s/0x%08x/0x%08x/\n", fp, SourceFingerprint()); | 7470 THR_Print("s/0x%08x/0x%08x/\n", fp, SourceFingerprint()); |
7471 } else { | 7471 } else { |
7472 THR_Print( | 7472 THR_Print( |
7473 "FP mismatch while recognizing method %s:" | 7473 "FP mismatch while recognizing method %s:" |
7474 " expecting 0x%08x found 0x%08x\n", | 7474 " expecting 0x%08x found 0x%08x\n", |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7838 result.SetOffset(0); | 7838 result.SetOffset(0); |
7839 } | 7839 } |
7840 result.set_is_final(is_final); | 7840 result.set_is_final(is_final); |
7841 result.set_is_const(is_const); | 7841 result.set_is_const(is_const); |
7842 result.set_is_reflectable(is_reflectable); | 7842 result.set_is_reflectable(is_reflectable); |
7843 result.set_is_double_initialized(false); | 7843 result.set_is_double_initialized(false); |
7844 result.set_owner(owner); | 7844 result.set_owner(owner); |
7845 result.set_token_pos(token_pos); | 7845 result.set_token_pos(token_pos); |
7846 result.set_has_initializer(false); | 7846 result.set_has_initializer(false); |
7847 result.set_is_unboxing_candidate(true); | 7847 result.set_is_unboxing_candidate(true); |
7848 result.set_kernel_field(NULL); | 7848 result.set_kernel_offset(-1); |
7849 Isolate* isolate = Isolate::Current(); | 7849 Isolate* isolate = Isolate::Current(); |
7850 | 7850 |
7851 // Use field guards if they are enabled and the isolate has never reloaded. | 7851 // Use field guards if they are enabled and the isolate has never reloaded. |
7852 // TODO(johnmccutchan): The reload case assumes the worst case (everything is | 7852 // TODO(johnmccutchan): The reload case assumes the worst case (everything is |
7853 // dynamic and possibly null). Attempt to relax this later. | 7853 // dynamic and possibly null). Attempt to relax this later. |
7854 const bool use_guarded_cid = | 7854 const bool use_guarded_cid = |
7855 FLAG_precompiled_mode || | 7855 FLAG_precompiled_mode || |
7856 (isolate->use_field_guards() && !isolate->HasAttemptedReload()); | 7856 (isolate->use_field_guards() && !isolate->HasAttemptedReload()); |
7857 result.set_guarded_cid(use_guarded_cid ? kIllegalCid : kDynamicCid); | 7857 result.set_guarded_cid(use_guarded_cid ? kIllegalCid : kDynamicCid); |
7858 result.set_is_nullable(use_guarded_cid ? false : true); | 7858 result.set_is_nullable(use_guarded_cid ? false : true); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7918 | 7918 |
7919 | 7919 |
7920 RawField* Field::Clone(const Field& original) const { | 7920 RawField* Field::Clone(const Field& original) const { |
7921 if (original.IsNull()) { | 7921 if (original.IsNull()) { |
7922 return Field::null(); | 7922 return Field::null(); |
7923 } | 7923 } |
7924 ASSERT(original.IsOriginal()); | 7924 ASSERT(original.IsOriginal()); |
7925 Field& clone = Field::Handle(); | 7925 Field& clone = Field::Handle(); |
7926 clone ^= Object::Clone(*this, Heap::kOld); | 7926 clone ^= Object::Clone(*this, Heap::kOld); |
7927 clone.SetOriginal(original); | 7927 clone.SetOriginal(original); |
7928 clone.set_kernel_field(original.kernel_field()); | 7928 clone.set_kernel_offset(original.kernel_offset()); |
7929 return clone.raw(); | 7929 return clone.raw(); |
7930 } | 7930 } |
7931 | 7931 |
7932 | 7932 |
7933 RawString* Field::InitializingExpression() const { | 7933 RawString* Field::InitializingExpression() const { |
7934 Thread* thread = Thread::Current(); | 7934 Thread* thread = Thread::Current(); |
7935 Zone* zone = thread->zone(); | 7935 Zone* zone = thread->zone(); |
7936 const class Script& scr = Script::Handle(zone, Script()); | 7936 const class Script& scr = Script::Handle(zone, Script()); |
7937 ASSERT(!scr.IsNull()); | 7937 ASSERT(!scr.IsNull()); |
7938 const TokenStream& tkns = TokenStream::Handle(zone, scr.tokens()); | 7938 const TokenStream& tkns = TokenStream::Handle(zone, scr.tokens()); |
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9095 } | 9095 } |
9096 return token_stream.GenerateSource(); | 9096 return token_stream.GenerateSource(); |
9097 } | 9097 } |
9098 | 9098 |
9099 | 9099 |
9100 void Script::set_compile_time_constants(const Array& value) const { | 9100 void Script::set_compile_time_constants(const Array& value) const { |
9101 StorePointer(&raw_ptr()->compile_time_constants_, value.raw()); | 9101 StorePointer(&raw_ptr()->compile_time_constants_, value.raw()); |
9102 } | 9102 } |
9103 | 9103 |
9104 | 9104 |
| 9105 void Script::set_kernel_data(const uint8_t* kernel_data) const { |
| 9106 StoreNonPointer(&raw_ptr()->kernel_data_, kernel_data); |
| 9107 } |
| 9108 |
| 9109 |
| 9110 void Script::set_kernel_data_size(const intptr_t kernel_data_size) const { |
| 9111 StoreNonPointer(&raw_ptr()->kernel_data_size_, kernel_data_size); |
| 9112 } |
| 9113 |
| 9114 |
9105 void Script::set_kernel_string_offsets(const TypedData& offsets) const { | 9115 void Script::set_kernel_string_offsets(const TypedData& offsets) const { |
9106 StorePointer(&raw_ptr()->kernel_string_offsets_, offsets.raw()); | 9116 StorePointer(&raw_ptr()->kernel_string_offsets_, offsets.raw()); |
9107 } | 9117 } |
9108 | 9118 |
9109 | 9119 |
9110 void Script::set_kernel_string_data(const TypedData& data) const { | 9120 void Script::set_kernel_string_data(const TypedData& data) const { |
9111 StorePointer(&raw_ptr()->kernel_string_data_, data.raw()); | 9121 StorePointer(&raw_ptr()->kernel_string_data_, data.raw()); |
9112 } | 9122 } |
9113 | 9123 |
9114 | 9124 |
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10059 pieces.Add(cname); | 10069 pieces.Add(cname); |
10060 pieces.Add(Symbols::At()); | 10070 pieces.Add(Symbols::At()); |
10061 pieces.Add(String::Handle(param.name())); | 10071 pieces.Add(String::Handle(param.name())); |
10062 return Symbols::FromConcatAll(thread, pieces); | 10072 return Symbols::FromConcatAll(thread, pieces); |
10063 } | 10073 } |
10064 | 10074 |
10065 | 10075 |
10066 void Library::AddMetadata(const Object& owner, | 10076 void Library::AddMetadata(const Object& owner, |
10067 const String& name, | 10077 const String& name, |
10068 TokenPosition token_pos, | 10078 TokenPosition token_pos, |
10069 kernel::TreeNode* kernel_node) const { | 10079 intptr_t kernel_offset) const { |
10070 Thread* thread = Thread::Current(); | 10080 Thread* thread = Thread::Current(); |
10071 ASSERT(thread->IsMutatorThread()); | 10081 ASSERT(thread->IsMutatorThread()); |
10072 Zone* zone = thread->zone(); | 10082 Zone* zone = thread->zone(); |
10073 const String& metaname = String::Handle(zone, Symbols::New(thread, name)); | 10083 const String& metaname = String::Handle(zone, Symbols::New(thread, name)); |
10074 const Field& field = | 10084 const Field& field = |
10075 Field::Handle(zone, Field::NewTopLevel(metaname, | 10085 Field::Handle(zone, Field::NewTopLevel(metaname, |
10076 false, // is_final | 10086 false, // is_final |
10077 false, // is_const | 10087 false, // is_const |
10078 owner, token_pos)); | 10088 owner, token_pos)); |
10079 field.SetFieldType(Object::dynamic_type()); | 10089 field.SetFieldType(Object::dynamic_type()); |
10080 field.set_is_reflectable(false); | 10090 field.set_is_reflectable(false); |
10081 field.SetStaticValue(Array::empty_array(), true); | 10091 field.SetStaticValue(Array::empty_array(), true); |
10082 field.set_kernel_field(kernel_node); | 10092 field.set_kernel_offset(kernel_offset); |
10083 GrowableObjectArray& metadata = | 10093 GrowableObjectArray& metadata = |
10084 GrowableObjectArray::Handle(zone, this->metadata()); | 10094 GrowableObjectArray::Handle(zone, this->metadata()); |
10085 metadata.Add(field, Heap::kOld); | 10095 metadata.Add(field, Heap::kOld); |
10086 } | 10096 } |
10087 | 10097 |
10088 | 10098 |
10089 void Library::AddClassMetadata(const Class& cls, | 10099 void Library::AddClassMetadata(const Class& cls, |
10090 const Object& tl_owner, | 10100 const Object& tl_owner, |
10091 TokenPosition token_pos, | 10101 TokenPosition token_pos, |
10092 kernel::TreeNode* kernel_node) const { | 10102 intptr_t kernel_offset) const { |
10093 Thread* thread = Thread::Current(); | 10103 Thread* thread = Thread::Current(); |
10094 Zone* zone = thread->zone(); | 10104 Zone* zone = thread->zone(); |
10095 // We use the toplevel class as the owner of a class's metadata field because | 10105 // We use the toplevel class as the owner of a class's metadata field because |
10096 // a class's metadata is in scope of the library, not the class. | 10106 // a class's metadata is in scope of the library, not the class. |
10097 AddMetadata(tl_owner, | 10107 AddMetadata(tl_owner, |
10098 String::Handle(zone, MakeClassMetaName(thread, zone, cls)), | 10108 String::Handle(zone, MakeClassMetaName(thread, zone, cls)), |
10099 token_pos, kernel_node); | 10109 token_pos, kernel_offset); |
10100 } | 10110 } |
10101 | 10111 |
10102 | 10112 |
10103 void Library::AddFieldMetadata(const Field& field, | 10113 void Library::AddFieldMetadata(const Field& field, |
10104 TokenPosition token_pos, | 10114 TokenPosition token_pos, |
10105 kernel::TreeNode* kernel_node) const { | 10115 intptr_t kernel_offset) const { |
10106 Thread* thread = Thread::Current(); | 10116 Thread* thread = Thread::Current(); |
10107 Zone* zone = thread->zone(); | 10117 Zone* zone = thread->zone(); |
10108 AddMetadata(Object::Handle(zone, field.RawOwner()), | 10118 AddMetadata(Object::Handle(zone, field.RawOwner()), |
10109 String::Handle(zone, MakeFieldMetaName(thread, zone, field)), | 10119 String::Handle(zone, MakeFieldMetaName(thread, zone, field)), |
10110 token_pos, kernel_node); | 10120 token_pos, kernel_offset); |
10111 } | 10121 } |
10112 | 10122 |
10113 | 10123 |
10114 void Library::AddFunctionMetadata(const Function& func, | 10124 void Library::AddFunctionMetadata(const Function& func, |
10115 TokenPosition token_pos, | 10125 TokenPosition token_pos, |
10116 kernel::TreeNode* kernel_node) const { | 10126 intptr_t kernel_offset) const { |
10117 Thread* thread = Thread::Current(); | 10127 Thread* thread = Thread::Current(); |
10118 Zone* zone = thread->zone(); | 10128 Zone* zone = thread->zone(); |
10119 AddMetadata(Object::Handle(zone, func.RawOwner()), | 10129 AddMetadata(Object::Handle(zone, func.RawOwner()), |
10120 String::Handle(zone, MakeFunctionMetaName(thread, zone, func)), | 10130 String::Handle(zone, MakeFunctionMetaName(thread, zone, func)), |
10121 token_pos, kernel_node); | 10131 token_pos, kernel_offset); |
10122 } | 10132 } |
10123 | 10133 |
10124 | 10134 |
10125 void Library::AddTypeParameterMetadata(const TypeParameter& param, | 10135 void Library::AddTypeParameterMetadata(const TypeParameter& param, |
10126 TokenPosition token_pos) const { | 10136 TokenPosition token_pos) const { |
10127 Thread* thread = Thread::Current(); | 10137 Thread* thread = Thread::Current(); |
10128 Zone* zone = thread->zone(); | 10138 Zone* zone = thread->zone(); |
10129 AddMetadata( | 10139 AddMetadata( |
10130 Class::Handle(zone, param.parameterized_class()), | 10140 Class::Handle(zone, param.parameterized_class()), |
10131 String::Handle(zone, MakeTypeParameterMetaName(thread, zone, param)), | 10141 String::Handle(zone, MakeTypeParameterMetaName(thread, zone, param)), |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10187 } | 10197 } |
10188 const String& metaname = String::Handle(MakeMetadataName(obj)); | 10198 const String& metaname = String::Handle(MakeMetadataName(obj)); |
10189 Field& field = Field::Handle(GetMetadataField(metaname)); | 10199 Field& field = Field::Handle(GetMetadataField(metaname)); |
10190 if (field.IsNull()) { | 10200 if (field.IsNull()) { |
10191 // There is no metadata for this object. | 10201 // There is no metadata for this object. |
10192 return Object::empty_array().raw(); | 10202 return Object::empty_array().raw(); |
10193 } | 10203 } |
10194 Object& metadata = Object::Handle(); | 10204 Object& metadata = Object::Handle(); |
10195 metadata = field.StaticValue(); | 10205 metadata = field.StaticValue(); |
10196 if (field.StaticValue() == Object::empty_array().raw()) { | 10206 if (field.StaticValue() == Object::empty_array().raw()) { |
10197 if (field.kernel_field() != NULL) { | 10207 if (field.kernel_offset() > 0) { |
10198 metadata = kernel::EvaluateMetadata(field); | 10208 metadata = kernel::EvaluateMetadata(field); |
10199 } else { | 10209 } else { |
10200 metadata = Parser::ParseMetadata(field); | 10210 metadata = Parser::ParseMetadata(field); |
10201 } | 10211 } |
10202 if (metadata.IsArray()) { | 10212 if (metadata.IsArray()) { |
10203 ASSERT(Array::Cast(metadata).raw() != Object::empty_array().raw()); | 10213 ASSERT(Array::Cast(metadata).raw() != Object::empty_array().raw()); |
10204 field.SetStaticValue(Array::Cast(metadata), true); | 10214 field.SetStaticValue(Array::Cast(metadata), true); |
10205 } | 10215 } |
10206 } | 10216 } |
10207 return metadata.raw(); | 10217 return metadata.raw(); |
(...skipping 13126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
23334 return UserTag::null(); | 23344 return UserTag::null(); |
23335 } | 23345 } |
23336 | 23346 |
23337 | 23347 |
23338 const char* UserTag::ToCString() const { | 23348 const char* UserTag::ToCString() const { |
23339 const String& tag_label = String::Handle(label()); | 23349 const String& tag_label = String::Handle(label()); |
23340 return tag_label.ToCString(); | 23350 return tag_label.ToCString(); |
23341 } | 23351 } |
23342 | 23352 |
23343 } // namespace dart | 23353 } // namespace dart |
OLD | NEW |