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

Side by Side Diff: vm/object.cc

Issue 10918213: - Move double and int implementations into dart:core and make them private. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
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 | « vm/intrinsifier.h ('k') | vm/symbols.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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 Context& context = Context::Handle(Context::New(0, Heap::kOld)); 562 Context& context = Context::Handle(Context::New(0, Heap::kOld));
563 object_store->set_empty_context(context); 563 object_store->set_empty_context(context);
564 564
565 // Now that the symbol table is initialized and that the core dictionary as 565 // Now that the symbol table is initialized and that the core dictionary as
566 // well as the core implementation dictionary have been setup, preallocate 566 // well as the core implementation dictionary have been setup, preallocate
567 // remaining classes and register them by name in the dictionaries. 567 // remaining classes and register them by name in the dictionaries.
568 const Script& impl_script = Script::Handle( 568 const Script& impl_script = Script::Handle(
569 Bootstrap::LoadCoreImplScript(false)); 569 Bootstrap::LoadCoreImplScript(false));
570 570
571 String& name = String::Handle(); 571 String& name = String::Handle();
572 cls = Class::New<Integer>();
573 object_store->set_integer_implementation_class(cls);
574 name = Symbols::IntegerImplementation();
575 RegisterClass(cls, name, core_impl_lib);
576 pending_classes.Add(cls, Heap::kOld);
577
578 cls = Class::New<Smi>();
579 object_store->set_smi_class(cls);
580 name = Symbols::Smi();
581 RegisterClass(cls, name, core_impl_lib);
582 pending_classes.Add(cls, Heap::kOld);
583
584 cls = Class::New<Mint>();
585 object_store->set_mint_class(cls);
586 name = Symbols::Mint();
587 RegisterClass(cls, name, core_impl_lib);
588 pending_classes.Add(cls, Heap::kOld);
589
590 cls = Class::New<Bigint>();
591 object_store->set_bigint_class(cls);
592 name = Symbols::Bigint();
593 RegisterClass(cls, name, core_impl_lib);
594 pending_classes.Add(cls, Heap::kOld);
595
596 cls = Class::New<Double>();
597 object_store->set_double_class(cls);
598 name = Symbols::Double();
599 RegisterClass(cls, name, core_impl_lib);
600 pending_classes.Add(cls, Heap::kOld);
601
602 cls = Class::New<Bool>(); 572 cls = Class::New<Bool>();
603 object_store->set_bool_class(cls); 573 object_store->set_bool_class(cls);
604 name = Symbols::Bool(); 574 name = Symbols::Bool();
605 RegisterClass(cls, name, core_lib); 575 RegisterClass(cls, name, core_lib);
606 pending_classes.Add(cls, Heap::kOld); 576 pending_classes.Add(cls, Heap::kOld);
607 577
608 cls = object_store->array_class(); // Was allocated above. 578 cls = object_store->array_class(); // Was allocated above.
609 name = Symbols::ObjectArray(); 579 name = Symbols::ObjectArray();
610 RegisterClass(cls, name, core_impl_lib); 580 RegisterClass(cls, name, core_impl_lib);
611 pending_classes.Add(cls, Heap::kOld); 581 pending_classes.Add(cls, Heap::kOld);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 637
668 cls = Class::New<JSRegExp>(); 638 cls = Class::New<JSRegExp>();
669 object_store->set_jsregexp_class(cls); 639 object_store->set_jsregexp_class(cls);
670 name = Symbols::JSSyntaxRegExp(); 640 name = Symbols::JSSyntaxRegExp();
671 RegisterClass(cls, name, core_impl_lib); 641 RegisterClass(cls, name, core_impl_lib);
672 pending_classes.Add(cls, Heap::kOld); 642 pending_classes.Add(cls, Heap::kOld);
673 643
674 // Initialize the base interfaces used by the core VM classes. 644 // Initialize the base interfaces used by the core VM classes.
675 const Script& script = Script::Handle(Bootstrap::LoadCoreScript(false)); 645 const Script& script = Script::Handle(Bootstrap::LoadCoreScript(false));
676 646
677 // Allocate and initialize the Object class and type. The Object 647 // Allocate and initialize the pre-allocated classes in the core library.
678 // class and ByteArray subclasses are the only pre-allocated,
679 // non-interface classes in the core library.
680 cls = Class::New<Instance>(kInstanceCid); 648 cls = Class::New<Instance>(kInstanceCid);
681 object_store->set_object_class(cls); 649 object_store->set_object_class(cls);
682 name = Symbols::Object(); 650 name = Symbols::Object();
683 cls.set_name(name); 651 cls.set_name(name);
684 cls.set_script(script); 652 cls.set_script(script);
685 cls.set_is_prefinalized(); 653 cls.set_is_prefinalized();
686 core_lib.AddClass(cls); 654 core_lib.AddClass(cls);
687 pending_classes.Add(cls, Heap::kOld); 655 pending_classes.Add(cls, Heap::kOld);
688 type = Type::NewNonParameterizedType(cls); 656 type = Type::NewNonParameterizedType(cls);
689 object_store->set_object_type(type); 657 object_store->set_object_type(type);
690 658
659 cls = Class::New<Integer>();
660 object_store->set_integer_implementation_class(cls);
661 name = Symbols::IntegerImplementation();
662 RegisterPrivateClass(cls, name, core_lib);
663 pending_classes.Add(cls, Heap::kOld);
664
665 cls = Class::New<Smi>();
666 object_store->set_smi_class(cls);
667 name = Symbols::Smi();
668 RegisterPrivateClass(cls, name, core_lib);
669 pending_classes.Add(cls, Heap::kOld);
670
671 cls = Class::New<Mint>();
672 object_store->set_mint_class(cls);
673 name = Symbols::Mint();
674 RegisterPrivateClass(cls, name, core_lib);
675 pending_classes.Add(cls, Heap::kOld);
676
677 cls = Class::New<Bigint>();
678 object_store->set_bigint_class(cls);
679 name = Symbols::Bigint();
680 RegisterPrivateClass(cls, name, core_lib);
681 pending_classes.Add(cls, Heap::kOld);
682
683 cls = Class::New<Double>();
684 object_store->set_double_class(cls);
685 name = Symbols::Double();
686 RegisterPrivateClass(cls, name, core_lib);
687 pending_classes.Add(cls, Heap::kOld);
688
691 cls = Class::New<Int8Array>(); 689 cls = Class::New<Int8Array>();
692 object_store->set_int8_array_class(cls); 690 object_store->set_int8_array_class(cls);
693 name = Symbols::_Int8Array(); 691 name = Symbols::_Int8Array();
694 RegisterPrivateClass(cls, name, core_lib); 692 RegisterPrivateClass(cls, name, core_lib);
695 693
696 cls = Class::New<Uint8Array>(); 694 cls = Class::New<Uint8Array>();
697 object_store->set_uint8_array_class(cls); 695 object_store->set_uint8_array_class(cls);
698 name = Symbols::_Uint8Array(); 696 name = Symbols::_Uint8Array();
699 RegisterPrivateClass(cls, name, core_lib); 697 RegisterPrivateClass(cls, name, core_lib);
700 698
(...skipping 10914 matching lines...) Expand 10 before | Expand all | Expand 10 after
11615 } 11613 }
11616 return result.raw(); 11614 return result.raw();
11617 } 11615 }
11618 11616
11619 11617
11620 const char* WeakProperty::ToCString() const { 11618 const char* WeakProperty::ToCString() const {
11621 return "_WeakProperty"; 11619 return "_WeakProperty";
11622 } 11620 }
11623 11621
11624 } // namespace dart 11622 } // namespace dart
OLDNEW
« no previous file with comments | « vm/intrinsifier.h ('k') | vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698