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

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

Issue 10874071: Eliminate interface bool (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_store.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 553
554 cls = Class::New<Double>(); 554 cls = Class::New<Double>();
555 object_store->set_double_class(cls); 555 object_store->set_double_class(cls);
556 name = Symbols::Double(); 556 name = Symbols::Double();
557 RegisterClass(cls, name, core_impl_lib); 557 RegisterClass(cls, name, core_impl_lib);
558 pending_classes.Add(cls, Heap::kOld); 558 pending_classes.Add(cls, Heap::kOld);
559 559
560 cls = Class::New<Bool>(); 560 cls = Class::New<Bool>();
561 object_store->set_bool_class(cls); 561 object_store->set_bool_class(cls);
562 name = Symbols::Bool(); 562 name = Symbols::Bool();
563 RegisterClass(cls, name, core_impl_lib); 563 RegisterClass(cls, name, core_lib);
564 pending_classes.Add(cls, Heap::kOld); 564 pending_classes.Add(cls, Heap::kOld);
565 565
566 cls = object_store->array_class(); // Was allocated above. 566 cls = object_store->array_class(); // Was allocated above.
567 name = Symbols::ObjectArray(); 567 name = Symbols::ObjectArray();
568 RegisterClass(cls, name, core_impl_lib); 568 RegisterClass(cls, name, core_impl_lib);
569 pending_classes.Add(cls, Heap::kOld); 569 pending_classes.Add(cls, Heap::kOld);
570 570
571 cls = object_store->growable_object_array_class(); // Was allocated above. 571 cls = object_store->growable_object_array_class(); // Was allocated above.
572 name = Symbols::GrowableObjectArray(); 572 name = Symbols::GrowableObjectArray();
573 RegisterClass(cls, name, core_impl_lib); 573 RegisterClass(cls, name, core_impl_lib);
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 cls = CreateAndRegisterInterface("double", script, core_lib); 780 cls = CreateAndRegisterInterface("double", script, core_lib);
781 pending_classes.Add(cls, Heap::kOld); 781 pending_classes.Add(cls, Heap::kOld);
782 type = Type::NewNonParameterizedType(cls); 782 type = Type::NewNonParameterizedType(cls);
783 object_store->set_double_interface(type); 783 object_store->set_double_interface(type);
784 784
785 cls = CreateAndRegisterInterface("String", script, core_lib); 785 cls = CreateAndRegisterInterface("String", script, core_lib);
786 pending_classes.Add(cls, Heap::kOld); 786 pending_classes.Add(cls, Heap::kOld);
787 type = Type::NewNonParameterizedType(cls); 787 type = Type::NewNonParameterizedType(cls);
788 object_store->set_string_interface(type); 788 object_store->set_string_interface(type);
789 789
790 cls = CreateAndRegisterInterface("bool", script, core_lib); 790 cls = object_store->bool_class();
791 pending_classes.Add(cls, Heap::kOld);
792 type = Type::NewNonParameterizedType(cls); 791 type = Type::NewNonParameterizedType(cls);
793 object_store->set_bool_interface(type); 792 object_store->set_bool_type(type);
794 793
795 cls = CreateAndRegisterInterface("List", script, core_lib); 794 cls = CreateAndRegisterInterface("List", script, core_lib);
796 pending_classes.Add(cls, Heap::kOld); 795 pending_classes.Add(cls, Heap::kOld);
797 type = Type::NewNonParameterizedType(cls); 796 type = Type::NewNonParameterizedType(cls);
798 object_store->set_list_interface(type); 797 object_store->set_list_interface(type);
799 798
800 cls = CreateAndRegisterInterface("ByteArray", script, core_lib); 799 cls = CreateAndRegisterInterface("ByteArray", script, core_lib);
801 pending_classes.Add(cls, Heap::kOld); 800 pending_classes.Add(cls, Heap::kOld);
802 type = Type::NewNonParameterizedType(cls); 801 type = Type::NewNonParameterizedType(cls);
803 object_store->set_byte_array_interface(type); 802 object_store->set_byte_array_interface(type);
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 case kDoubleCid: 1158 case kDoubleCid:
1160 return Symbols::New("double"); 1159 return Symbols::New("double");
1161 case kOneByteStringCid: 1160 case kOneByteStringCid:
1162 case kTwoByteStringCid: 1161 case kTwoByteStringCid:
1163 case kFourByteStringCid: 1162 case kFourByteStringCid:
1164 case kExternalOneByteStringCid: 1163 case kExternalOneByteStringCid:
1165 case kExternalTwoByteStringCid: 1164 case kExternalTwoByteStringCid:
1166 case kExternalFourByteStringCid: 1165 case kExternalFourByteStringCid:
1167 return Symbols::New("String"); 1166 return Symbols::New("String");
1168 case kBoolCid: 1167 case kBoolCid:
1169 return Symbols::New("bool"); 1168 return Symbols::New("bool");
turnidge 2012/08/24 23:58:31 Do we still need this special case here?
hausner 2012/08/25 00:32:40 Apparently not. If I remove the case, I still get
1170 case kArrayCid: 1169 case kArrayCid:
1171 case kImmutableArrayCid: 1170 case kImmutableArrayCid:
1172 case kGrowableObjectArrayCid: 1171 case kGrowableObjectArrayCid:
1173 return Symbols::New("List"); 1172 return Symbols::New("List");
1174 case kInt8ArrayCid: 1173 case kInt8ArrayCid:
1175 case kExternalInt8ArrayCid: 1174 case kExternalInt8ArrayCid:
1176 return Symbols::New("Int8List"); 1175 return Symbols::New("Int8List");
1177 case kUint8ArrayCid: 1176 case kUint8ArrayCid:
1178 case kExternalUint8ArrayCid: 1177 case kExternalUint8ArrayCid:
1179 return Symbols::New("Uint8List"); 1178 return Symbols::New("Uint8List");
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
2548 2547
2549 RawString* AbstractType::ClassName() const { 2548 RawString* AbstractType::ClassName() const {
2550 if (HasResolvedTypeClass()) { 2549 if (HasResolvedTypeClass()) {
2551 return Class::Handle(type_class()).Name(); 2550 return Class::Handle(type_class()).Name();
2552 } else { 2551 } else {
2553 return UnresolvedClass::Handle(unresolved_class()).Name(); 2552 return UnresolvedClass::Handle(unresolved_class()).Name();
2554 } 2553 }
2555 } 2554 }
2556 2555
2557 2556
2558 bool AbstractType::IsBoolInterface() const { 2557 bool AbstractType::IsBoolType() const {
2559 return HasResolvedTypeClass() && 2558 return HasResolvedTypeClass() &&
2560 (type_class() == Type::Handle(Type::BoolInterface()).type_class()); 2559 (type_class() == Type::Handle(Type::BoolType()).type_class());
2561 } 2560 }
2562 2561
2563 2562
2564 bool AbstractType::IsIntInterface() const { 2563 bool AbstractType::IsIntInterface() const {
2565 return HasResolvedTypeClass() && 2564 return HasResolvedTypeClass() &&
2566 (type_class() == Type::Handle(Type::IntInterface()).type_class()); 2565 (type_class() == Type::Handle(Type::IntInterface()).type_class());
2567 } 2566 }
2568 2567
2569 2568
2570 bool AbstractType::IsDoubleInterface() const { 2569 bool AbstractType::IsDoubleInterface() const {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
2681 RawType* Type::VoidType() { 2680 RawType* Type::VoidType() {
2682 return Isolate::Current()->object_store()->void_type(); 2681 return Isolate::Current()->object_store()->void_type();
2683 } 2682 }
2684 2683
2685 2684
2686 RawType* Type::ObjectType() { 2685 RawType* Type::ObjectType() {
2687 return Isolate::Current()->object_store()->object_type(); 2686 return Isolate::Current()->object_store()->object_type();
2688 } 2687 }
2689 2688
2690 2689
2691 RawType* Type::BoolInterface() { 2690 RawType* Type::BoolType() {
2692 return Isolate::Current()->object_store()->bool_interface(); 2691 return Isolate::Current()->object_store()->bool_type();
2693 } 2692 }
2694 2693
2695 2694
2696 RawType* Type::IntInterface() { 2695 RawType* Type::IntInterface() {
2697 return Isolate::Current()->object_store()->int_interface(); 2696 return Isolate::Current()->object_store()->int_interface();
2698 } 2697 }
2699 2698
2700 2699
2701 RawType* Type::SmiType() { 2700 RawType* Type::SmiType() {
2702 return Isolate::Current()->object_store()->smi_type(); 2701 return Isolate::Current()->object_store()->smi_type();
(...skipping 8479 matching lines...) Expand 10 before | Expand all | Expand 10 after
11182 } 11181 }
11183 return result.raw(); 11182 return result.raw();
11184 } 11183 }
11185 11184
11186 11185
11187 const char* WeakProperty::ToCString() const { 11186 const char* WeakProperty::ToCString() const {
11188 return "_WeakProperty"; 11187 return "_WeakProperty";
11189 } 11188 }
11190 11189
11191 } // namespace dart 11190 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698