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

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

Issue 11085003: Convert String to a class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merged to tip of bleeding_edge. Updated test expecteation Created 8 years, 1 month 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 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 type = Type::NewNonParameterizedType(cls); 828 type = Type::NewNonParameterizedType(cls);
829 object_store->set_int_type(type); 829 object_store->set_int_type(type);
830 830
831 name = Symbols::New("double"); 831 name = Symbols::New("double");
832 cls = Class::New<Instance>(name, script, Scanner::kDummyTokenIndex); 832 cls = Class::New<Instance>(name, script, Scanner::kDummyTokenIndex);
833 RegisterClass(cls, name, core_lib); 833 RegisterClass(cls, name, core_lib);
834 pending_classes.Add(cls, Heap::kOld); 834 pending_classes.Add(cls, Heap::kOld);
835 type = Type::NewNonParameterizedType(cls); 835 type = Type::NewNonParameterizedType(cls);
836 object_store->set_double_type(type); 836 object_store->set_double_type(type);
837 837
838 cls = CreateAndRegisterInterface("String", script, core_lib); 838 name = Symbols::New("String");
839 cls = Class::New<Instance>(name, script, Scanner::kDummyTokenIndex);
840 RegisterClass(cls, name, core_lib);
839 pending_classes.Add(cls, Heap::kOld); 841 pending_classes.Add(cls, Heap::kOld);
840 type = Type::NewNonParameterizedType(cls); 842 type = Type::NewNonParameterizedType(cls);
841 object_store->set_string_interface(type); 843 object_store->set_string_type(type);
842 844
843 cls = CreateAndRegisterInterface("List", script, core_lib); 845 cls = CreateAndRegisterInterface("List", script, core_lib);
844 pending_classes.Add(cls, Heap::kOld); 846 pending_classes.Add(cls, Heap::kOld);
845 type = Type::NewNonParameterizedType(cls); 847 type = Type::NewNonParameterizedType(cls);
846 object_store->set_list_interface(type); 848 object_store->set_list_interface(type);
847 849
848 cls = object_store->bool_class(); 850 cls = object_store->bool_class();
849 type = Type::NewNonParameterizedType(cls); 851 type = Type::NewNonParameterizedType(cls);
850 object_store->set_bool_type(type); 852 object_store->set_bool_type(type);
851 853
(...skipping 7615 matching lines...) Expand 10 before | Expand all | Expand 10 after
8467 (type_class() == Type::Handle(Type::Double()).type_class()); 8469 (type_class() == Type::Handle(Type::Double()).type_class());
8468 } 8470 }
8469 8471
8470 8472
8471 bool AbstractType::IsNumberType() const { 8473 bool AbstractType::IsNumberType() const {
8472 return HasResolvedTypeClass() && 8474 return HasResolvedTypeClass() &&
8473 (type_class() == Type::Handle(Type::Number()).type_class()); 8475 (type_class() == Type::Handle(Type::Number()).type_class());
8474 } 8476 }
8475 8477
8476 8478
8477 bool AbstractType::IsStringInterface() const { 8479 bool AbstractType::IsStringType() const {
8478 return HasResolvedTypeClass() && 8480 return HasResolvedTypeClass() &&
8479 (type_class() == Type::Handle(Type::StringInterface()).type_class()); 8481 (type_class() == Type::Handle(Type::StringType()).type_class());
8480 } 8482 }
8481 8483
8482 8484
8483 bool AbstractType::IsFunctionType() const { 8485 bool AbstractType::IsFunctionType() const {
8484 return HasResolvedTypeClass() && 8486 return HasResolvedTypeClass() &&
8485 (type_class() == Type::Handle(Type::Function()).type_class()); 8487 (type_class() == Type::Handle(Type::Function()).type_class());
8486 } 8488 }
8487 8489
8488 8490
8489 bool AbstractType::IsListInterface() const { 8491 bool AbstractType::IsListInterface() const {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
8606 RawType* Type::Double() { 8608 RawType* Type::Double() {
8607 return Isolate::Current()->object_store()->double_type(); 8609 return Isolate::Current()->object_store()->double_type();
8608 } 8610 }
8609 8611
8610 8612
8611 RawType* Type::Number() { 8613 RawType* Type::Number() {
8612 return Isolate::Current()->object_store()->number_type(); 8614 return Isolate::Current()->object_store()->number_type();
8613 } 8615 }
8614 8616
8615 8617
8616 RawType* Type::StringInterface() { 8618 RawType* Type::StringType() {
8617 return Isolate::Current()->object_store()->string_interface(); 8619 return Isolate::Current()->object_store()->string_type();
8618 } 8620 }
8619 8621
8620 8622
8621 RawType* Type::Function() { 8623 RawType* Type::Function() {
8622 return Isolate::Current()->object_store()->function_type(); 8624 return Isolate::Current()->object_store()->function_type();
8623 } 8625 }
8624 8626
8625 8627
8626 RawType* Type::ListInterface() { 8628 RawType* Type::ListInterface() {
8627 return Isolate::Current()->object_store()->list_interface(); 8629 return Isolate::Current()->object_store()->list_interface();
(...skipping 3347 matching lines...) Expand 10 before | Expand all | Expand 10 after
11975 } 11977 }
11976 return result.raw(); 11978 return result.raw();
11977 } 11979 }
11978 11980
11979 11981
11980 const char* WeakProperty::ToCString() const { 11982 const char* WeakProperty::ToCString() const {
11981 return "_WeakProperty"; 11983 return "_WeakProperty";
11982 } 11984 }
11983 11985
11984 } // namespace dart 11986 } // 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