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

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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 cls = CreateAndRegisterInterface("double", script, core_lib); 781 cls = CreateAndRegisterInterface("double", script, core_lib);
782 pending_classes.Add(cls, Heap::kOld); 782 pending_classes.Add(cls, Heap::kOld);
783 type = Type::NewNonParameterizedType(cls); 783 type = Type::NewNonParameterizedType(cls);
784 object_store->set_double_interface(type); 784 object_store->set_double_interface(type);
785 785
786 cls = CreateAndRegisterInterface("String", script, core_lib); 786 cls = CreateAndRegisterInterface("String", script, core_lib);
787 pending_classes.Add(cls, Heap::kOld); 787 pending_classes.Add(cls, Heap::kOld);
788 type = Type::NewNonParameterizedType(cls); 788 type = Type::NewNonParameterizedType(cls);
789 object_store->set_string_interface(type); 789 object_store->set_string_interface(type);
790 790
791 cls = CreateAndRegisterInterface("bool", script, core_lib); 791 cls = object_store->bool_class();
Ivan Posva 2012/08/27 20:47:51 Can you move this down together with the smi_class
hausner 2012/08/27 21:08:19 Done.
792 pending_classes.Add(cls, Heap::kOld);
793 type = Type::NewNonParameterizedType(cls); 792 type = Type::NewNonParameterizedType(cls);
794 object_store->set_bool_interface(type); 793 object_store->set_bool_type(type);
795 794
796 cls = CreateAndRegisterInterface("List", script, core_lib); 795 cls = CreateAndRegisterInterface("List", script, core_lib);
797 pending_classes.Add(cls, Heap::kOld); 796 pending_classes.Add(cls, Heap::kOld);
798 type = Type::NewNonParameterizedType(cls); 797 type = Type::NewNonParameterizedType(cls);
799 object_store->set_list_interface(type); 798 object_store->set_list_interface(type);
800 799
801 cls = CreateAndRegisterInterface("ByteArray", script, core_lib); 800 cls = CreateAndRegisterInterface("ByteArray", script, core_lib);
802 pending_classes.Add(cls, Heap::kOld); 801 pending_classes.Add(cls, Heap::kOld);
803 type = Type::NewNonParameterizedType(cls); 802 type = Type::NewNonParameterizedType(cls);
804 object_store->set_byte_array_interface(type); 803 object_store->set_byte_array_interface(type);
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 return Symbols::New("int"); 1158 return Symbols::New("int");
1160 case kDoubleCid: 1159 case kDoubleCid:
1161 return Symbols::New("double"); 1160 return Symbols::New("double");
1162 case kOneByteStringCid: 1161 case kOneByteStringCid:
1163 case kTwoByteStringCid: 1162 case kTwoByteStringCid:
1164 case kFourByteStringCid: 1163 case kFourByteStringCid:
1165 case kExternalOneByteStringCid: 1164 case kExternalOneByteStringCid:
1166 case kExternalTwoByteStringCid: 1165 case kExternalTwoByteStringCid:
1167 case kExternalFourByteStringCid: 1166 case kExternalFourByteStringCid:
1168 return Symbols::New("String"); 1167 return Symbols::New("String");
1169 case kBoolCid:
1170 return Symbols::New("bool");
1171 case kArrayCid: 1168 case kArrayCid:
1172 case kImmutableArrayCid: 1169 case kImmutableArrayCid:
1173 case kGrowableObjectArrayCid: 1170 case kGrowableObjectArrayCid:
1174 return Symbols::New("List"); 1171 return Symbols::New("List");
1175 case kInt8ArrayCid: 1172 case kInt8ArrayCid:
1176 case kExternalInt8ArrayCid: 1173 case kExternalInt8ArrayCid:
1177 return Symbols::New("Int8List"); 1174 return Symbols::New("Int8List");
1178 case kUint8ArrayCid: 1175 case kUint8ArrayCid:
1179 case kExternalUint8ArrayCid: 1176 case kExternalUint8ArrayCid:
1180 return Symbols::New("Uint8List"); 1177 return Symbols::New("Uint8List");
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
2549 2546
2550 RawString* AbstractType::ClassName() const { 2547 RawString* AbstractType::ClassName() const {
2551 if (HasResolvedTypeClass()) { 2548 if (HasResolvedTypeClass()) {
2552 return Class::Handle(type_class()).Name(); 2549 return Class::Handle(type_class()).Name();
2553 } else { 2550 } else {
2554 return UnresolvedClass::Handle(unresolved_class()).Name(); 2551 return UnresolvedClass::Handle(unresolved_class()).Name();
2555 } 2552 }
2556 } 2553 }
2557 2554
2558 2555
2559 bool AbstractType::IsBoolInterface() const { 2556 bool AbstractType::IsBoolType() const {
2560 return HasResolvedTypeClass() && 2557 return HasResolvedTypeClass() &&
2561 (type_class() == Type::Handle(Type::BoolInterface()).type_class()); 2558 (type_class() == Type::Handle(Type::BoolType()).type_class());
2562 } 2559 }
2563 2560
2564 2561
2565 bool AbstractType::IsIntInterface() const { 2562 bool AbstractType::IsIntInterface() const {
2566 return HasResolvedTypeClass() && 2563 return HasResolvedTypeClass() &&
2567 (type_class() == Type::Handle(Type::IntInterface()).type_class()); 2564 (type_class() == Type::Handle(Type::IntInterface()).type_class());
2568 } 2565 }
2569 2566
2570 2567
2571 bool AbstractType::IsDoubleInterface() const { 2568 bool AbstractType::IsDoubleInterface() const {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
2682 RawType* Type::VoidType() { 2679 RawType* Type::VoidType() {
2683 return Isolate::Current()->object_store()->void_type(); 2680 return Isolate::Current()->object_store()->void_type();
2684 } 2681 }
2685 2682
2686 2683
2687 RawType* Type::ObjectType() { 2684 RawType* Type::ObjectType() {
2688 return Isolate::Current()->object_store()->object_type(); 2685 return Isolate::Current()->object_store()->object_type();
2689 } 2686 }
2690 2687
2691 2688
2692 RawType* Type::BoolInterface() { 2689 RawType* Type::BoolType() {
2693 return Isolate::Current()->object_store()->bool_interface(); 2690 return Isolate::Current()->object_store()->bool_type();
2694 } 2691 }
2695 2692
2696 2693
2697 RawType* Type::IntInterface() { 2694 RawType* Type::IntInterface() {
2698 return Isolate::Current()->object_store()->int_interface(); 2695 return Isolate::Current()->object_store()->int_interface();
2699 } 2696 }
2700 2697
2701 2698
2702 RawType* Type::SmiType() { 2699 RawType* Type::SmiType() {
2703 return Isolate::Current()->object_store()->smi_type(); 2700 return Isolate::Current()->object_store()->smi_type();
(...skipping 8479 matching lines...) Expand 10 before | Expand all | Expand 10 after
11183 } 11180 }
11184 return result.raw(); 11181 return result.raw();
11185 } 11182 }
11186 11183
11187 11184
11188 const char* WeakProperty::ToCString() const { 11185 const char* WeakProperty::ToCString() const {
11189 return "_WeakProperty"; 11186 return "_WeakProperty";
11190 } 11187 }
11191 11188
11192 } // namespace dart 11189 } // 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