| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 reinterpret_cast<RawClass*>(RAW_NULL); | 146 reinterpret_cast<RawClass*>(RAW_NULL); |
| 147 RawClass* Object::stackmap_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 147 RawClass* Object::stackmap_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 148 RawClass* Object::var_descriptors_class_ = | 148 RawClass* Object::var_descriptors_class_ = |
| 149 reinterpret_cast<RawClass*>(RAW_NULL); | 149 reinterpret_cast<RawClass*>(RAW_NULL); |
| 150 RawClass* Object::exception_handlers_class_ = | 150 RawClass* Object::exception_handlers_class_ = |
| 151 reinterpret_cast<RawClass*>(RAW_NULL); | 151 reinterpret_cast<RawClass*>(RAW_NULL); |
| 152 RawClass* Object::context_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 152 RawClass* Object::context_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 153 RawClass* Object::context_scope_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 153 RawClass* Object::context_scope_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 154 RawClass* Object::singletargetcache_class_ = | 154 RawClass* Object::singletargetcache_class_ = |
| 155 reinterpret_cast<RawClass*>(RAW_NULL); | 155 reinterpret_cast<RawClass*>(RAW_NULL); |
| 156 RawClass* Object::unlinkedcall_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 156 RawClass* Object::icdata_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 157 RawClass* Object::icdata_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 157 RawClass* Object::megamorphic_cache_class_ = | 158 RawClass* Object::megamorphic_cache_class_ = |
| 158 reinterpret_cast<RawClass*>(RAW_NULL); | 159 reinterpret_cast<RawClass*>(RAW_NULL); |
| 159 RawClass* Object::subtypetestcache_class_ = | 160 RawClass* Object::subtypetestcache_class_ = |
| 160 reinterpret_cast<RawClass*>(RAW_NULL); | 161 reinterpret_cast<RawClass*>(RAW_NULL); |
| 161 RawClass* Object::api_error_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 162 RawClass* Object::api_error_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 162 RawClass* Object::language_error_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 163 RawClass* Object::language_error_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 163 RawClass* Object::unhandled_exception_class_ = | 164 RawClass* Object::unhandled_exception_class_ = |
| 164 reinterpret_cast<RawClass*>(RAW_NULL); | 165 reinterpret_cast<RawClass*>(RAW_NULL); |
| 165 RawClass* Object::unwind_error_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 166 RawClass* Object::unwind_error_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 | 650 |
| 650 cls = Class::New<Context>(); | 651 cls = Class::New<Context>(); |
| 651 context_class_ = cls.raw(); | 652 context_class_ = cls.raw(); |
| 652 | 653 |
| 653 cls = Class::New<ContextScope>(); | 654 cls = Class::New<ContextScope>(); |
| 654 context_scope_class_ = cls.raw(); | 655 context_scope_class_ = cls.raw(); |
| 655 | 656 |
| 656 cls = Class::New<SingleTargetCache>(); | 657 cls = Class::New<SingleTargetCache>(); |
| 657 singletargetcache_class_ = cls.raw(); | 658 singletargetcache_class_ = cls.raw(); |
| 658 | 659 |
| 660 cls = Class::New<UnlinkedCall>(); |
| 661 unlinkedcall_class_ = cls.raw(); |
| 662 |
| 659 cls = Class::New<ICData>(); | 663 cls = Class::New<ICData>(); |
| 660 icdata_class_ = cls.raw(); | 664 icdata_class_ = cls.raw(); |
| 661 | 665 |
| 662 cls = Class::New<MegamorphicCache>(); | 666 cls = Class::New<MegamorphicCache>(); |
| 663 megamorphic_cache_class_ = cls.raw(); | 667 megamorphic_cache_class_ = cls.raw(); |
| 664 | 668 |
| 665 cls = Class::New<SubtypeTestCache>(); | 669 cls = Class::New<SubtypeTestCache>(); |
| 666 subtypetestcache_class_ = cls.raw(); | 670 subtypetestcache_class_ = cls.raw(); |
| 667 | 671 |
| 668 cls = Class::New<ApiError>(); | 672 cls = Class::New<ApiError>(); |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 991 SET_CLASS_NAME(instructions, Instructions); | 995 SET_CLASS_NAME(instructions, Instructions); |
| 992 SET_CLASS_NAME(object_pool, ObjectPool); | 996 SET_CLASS_NAME(object_pool, ObjectPool); |
| 993 SET_CLASS_NAME(code_source_map, CodeSourceMap); | 997 SET_CLASS_NAME(code_source_map, CodeSourceMap); |
| 994 SET_CLASS_NAME(pc_descriptors, PcDescriptors); | 998 SET_CLASS_NAME(pc_descriptors, PcDescriptors); |
| 995 SET_CLASS_NAME(stackmap, Stackmap); | 999 SET_CLASS_NAME(stackmap, Stackmap); |
| 996 SET_CLASS_NAME(var_descriptors, LocalVarDescriptors); | 1000 SET_CLASS_NAME(var_descriptors, LocalVarDescriptors); |
| 997 SET_CLASS_NAME(exception_handlers, ExceptionHandlers); | 1001 SET_CLASS_NAME(exception_handlers, ExceptionHandlers); |
| 998 SET_CLASS_NAME(context, Context); | 1002 SET_CLASS_NAME(context, Context); |
| 999 SET_CLASS_NAME(context_scope, ContextScope); | 1003 SET_CLASS_NAME(context_scope, ContextScope); |
| 1000 SET_CLASS_NAME(singletargetcache, SingleTargetCache); | 1004 SET_CLASS_NAME(singletargetcache, SingleTargetCache); |
| 1005 SET_CLASS_NAME(unlinkedcall, UnlinkedCall); |
| 1001 SET_CLASS_NAME(icdata, ICData); | 1006 SET_CLASS_NAME(icdata, ICData); |
| 1002 SET_CLASS_NAME(megamorphic_cache, MegamorphicCache); | 1007 SET_CLASS_NAME(megamorphic_cache, MegamorphicCache); |
| 1003 SET_CLASS_NAME(subtypetestcache, SubtypeTestCache); | 1008 SET_CLASS_NAME(subtypetestcache, SubtypeTestCache); |
| 1004 SET_CLASS_NAME(api_error, ApiError); | 1009 SET_CLASS_NAME(api_error, ApiError); |
| 1005 SET_CLASS_NAME(language_error, LanguageError); | 1010 SET_CLASS_NAME(language_error, LanguageError); |
| 1006 SET_CLASS_NAME(unhandled_exception, UnhandledException); | 1011 SET_CLASS_NAME(unhandled_exception, UnhandledException); |
| 1007 SET_CLASS_NAME(unwind_error, UnwindError); | 1012 SET_CLASS_NAME(unwind_error, UnwindError); |
| 1008 | 1013 |
| 1009 // Set up names for object array and one byte string class which are | 1014 // Set up names for object array and one byte string class which are |
| 1010 // pre-allocated in the vm isolate also. | 1015 // pre-allocated in the vm isolate also. |
| (...skipping 11630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12641 result ^= raw; | 12646 result ^= raw; |
| 12642 } | 12647 } |
| 12643 result.set_target(Code::Handle()); | 12648 result.set_target(Code::Handle()); |
| 12644 result.set_entry_point(0); | 12649 result.set_entry_point(0); |
| 12645 result.set_lower_limit(kIllegalCid); | 12650 result.set_lower_limit(kIllegalCid); |
| 12646 result.set_upper_limit(kIllegalCid); | 12651 result.set_upper_limit(kIllegalCid); |
| 12647 return result.raw(); | 12652 return result.raw(); |
| 12648 } | 12653 } |
| 12649 | 12654 |
| 12650 | 12655 |
| 12656 void UnlinkedCall::set_target_name(const String& value) const { |
| 12657 StorePointer(&raw_ptr()->target_name_, value.raw()); |
| 12658 } |
| 12659 |
| 12660 |
| 12661 void UnlinkedCall::set_args_descriptor(const Array& value) const { |
| 12662 StorePointer(&raw_ptr()->args_descriptor_, value.raw()); |
| 12663 } |
| 12664 |
| 12665 |
| 12666 const char* UnlinkedCall::ToCString() const { |
| 12667 return "UnlinkedCall"; |
| 12668 } |
| 12669 |
| 12670 |
| 12671 RawUnlinkedCall* UnlinkedCall::New() { |
| 12672 RawObject* raw = Object::Allocate(UnlinkedCall::kClassId, |
| 12673 UnlinkedCall::InstanceSize(), |
| 12674 Heap::kOld); |
| 12675 return reinterpret_cast<RawUnlinkedCall*>(raw); |
| 12676 } |
| 12677 |
| 12678 |
| 12651 void ICData::ResetSwitchable(Zone* zone) const { | 12679 void ICData::ResetSwitchable(Zone* zone) const { |
| 12652 ASSERT(NumArgsTested() == 1); | 12680 ASSERT(NumArgsTested() == 1); |
| 12653 set_ic_data_array(Array::Handle(zone, CachedEmptyICDataArray(1))); | 12681 set_ic_data_array(Array::Handle(zone, CachedEmptyICDataArray(1))); |
| 12654 } | 12682 } |
| 12655 | 12683 |
| 12656 | 12684 |
| 12657 const char* ICData::ToCString() const { | 12685 const char* ICData::ToCString() const { |
| 12658 const String& name = String::Handle(target_name()); | 12686 const String& name = String::Handle(target_name()); |
| 12659 const intptr_t num_args = NumArgsTested(); | 12687 const intptr_t num_args = NumArgsTested(); |
| 12660 const intptr_t num_checks = NumberOfChecks(); | 12688 const intptr_t num_checks = NumberOfChecks(); |
| (...skipping 10348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 23009 return UserTag::null(); | 23037 return UserTag::null(); |
| 23010 } | 23038 } |
| 23011 | 23039 |
| 23012 | 23040 |
| 23013 const char* UserTag::ToCString() const { | 23041 const char* UserTag::ToCString() const { |
| 23014 const String& tag_label = String::Handle(label()); | 23042 const String& tag_label = String::Handle(label()); |
| 23015 return tag_label.ToCString(); | 23043 return tag_label.ToCString(); |
| 23016 } | 23044 } |
| 23017 | 23045 |
| 23018 } // namespace dart | 23046 } // namespace dart |
| OLD | NEW |