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

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

Issue 1229283002: VM: Share some stub code between isolates. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 years, 5 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
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/stub_code.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/cpu.h" 10 #include "vm/cpu.h"
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 cls = Class::New<Bigint>(); 622 cls = Class::New<Bigint>();
623 isolate->object_store()->set_bigint_class(cls); 623 isolate->object_store()->set_bigint_class(cls);
624 cls = Class::New<Double>(); 624 cls = Class::New<Double>();
625 isolate->object_store()->set_double_class(cls); 625 isolate->object_store()->set_double_class(cls);
626 626
627 // Ensure that class kExternalTypedDataUint8ArrayCid is registered as we 627 // Ensure that class kExternalTypedDataUint8ArrayCid is registered as we
628 // need it when reading in the token stream of bootstrap classes in the VM 628 // need it when reading in the token stream of bootstrap classes in the VM
629 // isolate. 629 // isolate.
630 Class::NewExternalTypedDataClass(kExternalTypedDataUint8ArrayCid); 630 Class::NewExternalTypedDataClass(kExternalTypedDataUint8ArrayCid);
631 631
632 // Needed for object pools of VM isolate stubs.
633 Class::NewTypedDataClass(kTypedDataInt8ArrayCid);
634
632 // Allocate and initialize the empty_array instance. 635 // Allocate and initialize the empty_array instance.
633 { 636 {
634 uword address = heap->Allocate(Array::InstanceSize(0), Heap::kOld); 637 uword address = heap->Allocate(Array::InstanceSize(0), Heap::kOld);
635 InitializeObject(address, kArrayCid, Array::InstanceSize(0)); 638 InitializeObject(address, kArrayCid, Array::InstanceSize(0));
636 Array::initializeHandle( 639 Array::initializeHandle(
637 empty_array_, 640 empty_array_,
638 reinterpret_cast<RawArray*>(address + kHeapObjectTag)); 641 reinterpret_cast<RawArray*>(address + kHeapObjectTag));
639 empty_array_->StoreSmi(&empty_array_->raw_ptr()->length_, Smi::New(0)); 642 empty_array_->StoreSmi(&empty_array_->raw_ptr()->length_, Smi::New(0));
640 } 643 }
641 644
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 cls = object_store->null_class(); 1438 cls = object_store->null_class();
1436 type = Type::NewNonParameterizedType(cls); 1439 type = Type::NewNonParameterizedType(cls);
1437 object_store->set_null_type(type); 1440 object_store->set_null_type(type);
1438 1441
1439 // Consider removing when/if Null becomes an ordinary class. 1442 // Consider removing when/if Null becomes an ordinary class.
1440 type = object_store->object_type(); 1443 type = object_store->object_type();
1441 cls.set_super_type(type); 1444 cls.set_super_type(type);
1442 1445
1443 // Finish the initialization by compiling the bootstrap scripts containing the 1446 // Finish the initialization by compiling the bootstrap scripts containing the
1444 // base interfaces and the implementation of the internal classes. 1447 // base interfaces and the implementation of the internal classes.
1445 StubCode::InitBootstrapStubs(isolate);
1446 const Error& error = Error::Handle(Bootstrap::LoadandCompileScripts()); 1448 const Error& error = Error::Handle(Bootstrap::LoadandCompileScripts());
1447 if (!error.IsNull()) { 1449 if (!error.IsNull()) {
1448 return error.raw(); 1450 return error.raw();
1449 } 1451 }
1450 1452
1451 ClassFinalizer::VerifyBootstrapClasses(); 1453 ClassFinalizer::VerifyBootstrapClasses();
1452 1454
1453 // Set up the intrinsic state of all functions (core, math and typed data). 1455 // Set up the intrinsic state of all functions (core, math and typed data).
1454 Intrinsifier::InitializeState(); 1456 Intrinsifier::InitializeState();
1455 1457
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1588 cls = Class::New<WeakProperty>(); 1590 cls = Class::New<WeakProperty>();
1589 object_store->set_weak_property_class(cls); 1591 object_store->set_weak_property_class(cls);
1590 1592
1591 cls = Class::New<MirrorReference>(); 1593 cls = Class::New<MirrorReference>();
1592 cls = Class::New<UserTag>(); 1594 cls = Class::New<UserTag>();
1593 1595
1594 const Context& context = Context::Handle(isolate, 1596 const Context& context = Context::Handle(isolate,
1595 Context::New(0, Heap::kOld)); 1597 Context::New(0, Heap::kOld));
1596 object_store->set_empty_context(context); 1598 object_store->set_empty_context(context);
1597 1599
1598 StubCode::InitBootstrapStubs(isolate);
1599 #endif // defined(DART_NO_SNAPSHOT). 1600 #endif // defined(DART_NO_SNAPSHOT).
1600 1601
1601 return Error::null(); 1602 return Error::null();
1602 } 1603 }
1603 1604
1604 1605
1605 void Object::Print() const { 1606 void Object::Print() const {
1606 OS::Print("%s\n", ToCString()); 1607 OS::Print("%s\n", ToCString());
1607 } 1608 }
1608 1609
(...skipping 19584 matching lines...) Expand 10 before | Expand all | Expand 10 after
21193 return tag_label.ToCString(); 21194 return tag_label.ToCString();
21194 } 21195 }
21195 21196
21196 21197
21197 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 21198 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
21198 Instance::PrintJSONImpl(stream, ref); 21199 Instance::PrintJSONImpl(stream, ref);
21199 } 21200 }
21200 21201
21201 21202
21202 } // namespace dart 21203 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/stub_code.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698