Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: runtime/vm/object.cc

Issue 2357313003: AOT: Add a separate switchable call state for unlinked calls. (Closed)
Patch Set: . Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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 11582 matching lines...) Expand 10 before | Expand all | Expand 10 after
12593 result ^= raw; 12598 result ^= raw;
12594 } 12599 }
12595 result.set_target(Code::Handle()); 12600 result.set_target(Code::Handle());
12596 result.set_entry_point(0); 12601 result.set_entry_point(0);
12597 result.set_lower_limit(kIllegalCid); 12602 result.set_lower_limit(kIllegalCid);
12598 result.set_upper_limit(kIllegalCid); 12603 result.set_upper_limit(kIllegalCid);
12599 return result.raw(); 12604 return result.raw();
12600 } 12605 }
12601 12606
12602 12607
12608 void UnlinkedCall::set_target_name(const String& value) const {
12609 StorePointer(&raw_ptr()->target_name_, value.raw());
12610 }
12611
12612
12613 void UnlinkedCall::set_args_descriptor(const Array& value) const {
12614 StorePointer(&raw_ptr()->args_descriptor_, value.raw());
12615 }
12616
12617
12618 const char* UnlinkedCall::ToCString() const {
12619 return "UnlinkedCall";
12620 }
12621
12622
12623 RawUnlinkedCall* UnlinkedCall::New() {
Florian Schneider 2016/09/23 17:57:59 Since there is no initializing code, this could be
rmacnak 2016/09/26 17:32:53 Done.
12624 UnlinkedCall& result = UnlinkedCall::Handle();
12625 {
12626 // IC data objects are long living objects, allocate them in old generation.
12627 RawObject* raw = Object::Allocate(UnlinkedCall::kClassId,
12628 UnlinkedCall::InstanceSize(),
12629 Heap::kOld);
12630 NoSafepointScope no_safepoint;
12631 result ^= raw;
12632 }
12633 return result.raw();
12634 }
12635
12636
12603 void ICData::ResetSwitchable(Zone* zone) const { 12637 void ICData::ResetSwitchable(Zone* zone) const {
12604 ASSERT(NumArgsTested() == 1); 12638 ASSERT(NumArgsTested() == 1);
12605 set_ic_data_array(Array::Handle(zone, CachedEmptyICDataArray(1))); 12639 set_ic_data_array(Array::Handle(zone, CachedEmptyICDataArray(1)));
12606 } 12640 }
12607 12641
12608 12642
12609 const char* ICData::ToCString() const { 12643 const char* ICData::ToCString() const {
12610 const String& name = String::Handle(target_name()); 12644 const String& name = String::Handle(target_name());
12611 const intptr_t num_args = NumArgsTested(); 12645 const intptr_t num_args = NumArgsTested();
12612 const intptr_t num_checks = NumberOfChecks(); 12646 const intptr_t num_checks = NumberOfChecks();
(...skipping 10348 matching lines...) Expand 10 before | Expand all | Expand 10 after
22961 return UserTag::null(); 22995 return UserTag::null();
22962 } 22996 }
22963 22997
22964 22998
22965 const char* UserTag::ToCString() const { 22999 const char* UserTag::ToCString() const {
22966 const String& tag_label = String::Handle(label()); 23000 const String& tag_label = String::Handle(label());
22967 return tag_label.ToCString(); 23001 return tag_label.ToCString();
22968 } 23002 }
22969 23003
22970 } // namespace dart 23004 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_service.cc » ('j') | runtime/vm/stub_code_arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698