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

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

Issue 1134623004: - Use conditional code inclusion for the dart_no_snapshot and dart executables using the MACRO DART… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 7 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/vm.gypi » ('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/cpu.h" 10 #include "vm/cpu.h"
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 ASSERT(public_class_name.CharAt(0) == '_'); 920 ASSERT(public_class_name.CharAt(0) == '_');
921 String& str = String::Handle(); 921 String& str = String::Handle();
922 str = lib.PrivateName(public_class_name); 922 str = lib.PrivateName(public_class_name);
923 cls.set_name(str); 923 cls.set_name(str);
924 lib.AddClass(cls); 924 lib.AddClass(cls);
925 } 925 }
926 926
927 927
928 RawError* Object::Init(Isolate* isolate) { 928 RawError* Object::Init(Isolate* isolate) {
929 TIMERSCOPE(isolate, time_bootstrap); 929 TIMERSCOPE(isolate, time_bootstrap);
930
931 #if defined(DART_NO_SNAPSHOT)
932 // Object::Init version when we are running in a version of dart that does
933 // not have a full snapshot linked in.
930 ObjectStore* object_store = isolate->object_store(); 934 ObjectStore* object_store = isolate->object_store();
931 935
932 Class& cls = Class::Handle(isolate); 936 Class& cls = Class::Handle(isolate);
933 Type& type = Type::Handle(isolate); 937 Type& type = Type::Handle(isolate);
934 Array& array = Array::Handle(isolate); 938 Array& array = Array::Handle(isolate);
935 Library& lib = Library::Handle(isolate); 939 Library& lib = Library::Handle(isolate);
936 940
937 // All RawArray fields will be initialized to an empty array, therefore 941 // All RawArray fields will be initialized to an empty array, therefore
938 // initialize array class first. 942 // initialize array class first.
939 cls = Class::New<Array>(); 943 cls = Class::New<Array>();
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1419 field.set_value(value); \ 1423 field.set_value(value); \
1420 field.set_type(Type::Handle(Type::IntType())); \ 1424 field.set_type(Type::Handle(Type::IntType())); \
1421 cls.AddField(field); \ 1425 cls.AddField(field); \
1422 1426
1423 CLASS_LIST_WITH_NULL(ADD_SET_FIELD) 1427 CLASS_LIST_WITH_NULL(ADD_SET_FIELD)
1424 #undef ADD_SET_FIELD 1428 #undef ADD_SET_FIELD
1425 1429
1426 isolate->object_store()->InitKnownObjects(); 1430 isolate->object_store()->InitKnownObjects();
1427 1431
1428 return Error::null(); 1432 return Error::null();
1429 } 1433 #else // defined(DART_NO_SNAPSHOT).
1430 1434 // Object::Init version when we are running in a version of dart that has
1431 1435 // a full snapshot linked in and an isolate is initialized using the full
1432 void Object::InitFromSnapshot(Isolate* isolate) { 1436 // snapshot.
1433 TIMERSCOPE(isolate, time_bootstrap);
1434 ObjectStore* object_store = isolate->object_store(); 1437 ObjectStore* object_store = isolate->object_store();
1435 1438
1436 Class& cls = Class::Handle(); 1439 Class& cls = Class::Handle();
1437 1440
1438 // Set up empty classes in the object store, these will get 1441 // Set up empty classes in the object store, these will get
1439 // initialized correctly when we read from the snapshot. 1442 // initialized correctly when we read from the snapshot.
1440 // This is done to allow bootstrapping of reading classes from the snapshot. 1443 // This is done to allow bootstrapping of reading classes from the snapshot.
1441 // Some classes are not stored in the object store. Yet we still need to 1444 // Some classes are not stored in the object store. Yet we still need to
1442 // create their Class object so that they get put into the class_table 1445 // create their Class object so that they get put into the class_table
1443 // (as a side effect of Class::New()). 1446 // (as a side effect of Class::New()).
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 object_store->set_weak_property_class(cls); 1536 object_store->set_weak_property_class(cls);
1534 1537
1535 cls = Class::New<MirrorReference>(); 1538 cls = Class::New<MirrorReference>();
1536 cls = Class::New<UserTag>(); 1539 cls = Class::New<UserTag>();
1537 1540
1538 const Context& context = Context::Handle(isolate, 1541 const Context& context = Context::Handle(isolate,
1539 Context::New(0, Heap::kOld)); 1542 Context::New(0, Heap::kOld));
1540 object_store->set_empty_context(context); 1543 object_store->set_empty_context(context);
1541 1544
1542 StubCode::InitBootstrapStubs(isolate); 1545 StubCode::InitBootstrapStubs(isolate);
1546 #endif // defined(DART_NO_SNAPSHOT).
1547
1548 return Error::null();
1543 } 1549 }
1544 1550
1545 1551
1546 void Object::Print() const { 1552 void Object::Print() const {
1547 OS::Print("%s\n", ToCString()); 1553 OS::Print("%s\n", ToCString());
1548 } 1554 }
1549 1555
1550 1556
1551 static void AddNameProperties(JSONObject* jsobj, 1557 static void AddNameProperties(JSONObject* jsobj,
1552 const String& name, 1558 const String& name,
(...skipping 19171 matching lines...) Expand 10 before | Expand all | Expand 10 after
20724 return tag_label.ToCString(); 20730 return tag_label.ToCString();
20725 } 20731 }
20726 20732
20727 20733
20728 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 20734 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
20729 Instance::PrintJSONImpl(stream, ref); 20735 Instance::PrintJSONImpl(stream, ref);
20730 } 20736 }
20731 20737
20732 20738
20733 } // namespace dart 20739 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/vm.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698