OLD | NEW |
---|---|
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 "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
650 Error& error = Error::Handle(); | 650 Error& error = Error::Handle(); |
651 error = Bootstrap::Compile(core_lib, script); | 651 error = Bootstrap::Compile(core_lib, script); |
652 if (!error.IsNull()) { | 652 if (!error.IsNull()) { |
653 return error.raw(); | 653 return error.raw(); |
654 } | 654 } |
655 error = Bootstrap::Compile(core_impl_lib, impl_script); | 655 error = Bootstrap::Compile(core_impl_lib, impl_script); |
656 if (!error.IsNull()) { | 656 if (!error.IsNull()) { |
657 return error.raw(); | 657 return error.raw(); |
658 } | 658 } |
659 | 659 |
660 // Load other libraries, such as dart:isolate. | |
661 error = Bootstrap::InitAdditionalLibraries(); | |
662 if (!error.IsNull()) { | |
663 return error.raw(); | |
664 } | |
665 | |
666 Library& isolate_lib = Library::Handle(Library::IsolateLibrary()); | |
667 ASSERT(!isolate_lib.IsNull()); | |
siva
2012/02/22 00:58:20
I noticed that these changes are similar to the on
Siggi Cherem (dart-lang)
2012/02/22 19:18:50
I'm happy to do so, but since Todd is on vacation,
siva
2012/02/22 23:18:14
I think we should probably have Todd reconcile whe
| |
668 | |
660 Bootstrap::SetupNativeResolver(); | 669 Bootstrap::SetupNativeResolver(); |
661 | 670 |
662 // Remove the Object superclass cycle by setting the super type to null (not | 671 // Remove the Object superclass cycle by setting the super type to null (not |
663 // to the type of null). | 672 // to the type of null). |
664 cls = object_store->object_class(); | 673 cls = object_store->object_class(); |
665 cls.set_super_type(Type::Handle()); | 674 cls.set_super_type(Type::Handle()); |
666 | 675 |
667 ClassFinalizer::VerifyBootstrapClasses(); | 676 ClassFinalizer::VerifyBootstrapClasses(); |
668 return Error::null(); | 677 return Error::null(); |
669 } | 678 } |
(...skipping 4051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4721 RawLibrary* Library::CoreLibrary() { | 4730 RawLibrary* Library::CoreLibrary() { |
4722 return Isolate::Current()->object_store()->core_library(); | 4731 return Isolate::Current()->object_store()->core_library(); |
4723 } | 4732 } |
4724 | 4733 |
4725 | 4734 |
4726 RawLibrary* Library::CoreImplLibrary() { | 4735 RawLibrary* Library::CoreImplLibrary() { |
4727 return Isolate::Current()->object_store()->core_impl_library(); | 4736 return Isolate::Current()->object_store()->core_impl_library(); |
4728 } | 4737 } |
4729 | 4738 |
4730 | 4739 |
4740 RawLibrary* Library::IsolateLibrary() { | |
4741 return Isolate::Current()->object_store()->isolate_library(); | |
4742 } | |
4743 | |
4744 | |
4731 RawLibrary* Library::NativeWrappersLibrary() { | 4745 RawLibrary* Library::NativeWrappersLibrary() { |
4732 return Isolate::Current()->object_store()->native_wrappers_library(); | 4746 return Isolate::Current()->object_store()->native_wrappers_library(); |
4733 } | 4747 } |
4734 | 4748 |
4735 | 4749 |
4736 const char* Library::ToCString() const { | 4750 const char* Library::ToCString() const { |
4737 const char* kFormat = "Library:'%s'"; | 4751 const char* kFormat = "Library:'%s'"; |
4738 const String& name = String::Handle(url()); | 4752 const String& name = String::Handle(url()); |
4739 intptr_t len = OS::SNPrint(NULL, 0, kFormat, name.ToCString()) + 1; | 4753 intptr_t len = OS::SNPrint(NULL, 0, kFormat, name.ToCString()) + 1; |
4740 char* chars = reinterpret_cast<char*>( | 4754 char* chars = reinterpret_cast<char*>( |
(...skipping 3453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8194 const String& str = String::Handle(pattern()); | 8208 const String& str = String::Handle(pattern()); |
8195 const char* format = "JSRegExp: pattern=%s flags=%s"; | 8209 const char* format = "JSRegExp: pattern=%s flags=%s"; |
8196 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); | 8210 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); |
8197 char* chars = reinterpret_cast<char*>( | 8211 char* chars = reinterpret_cast<char*>( |
8198 Isolate::Current()->current_zone()->Allocate(len + 1)); | 8212 Isolate::Current()->current_zone()->Allocate(len + 1)); |
8199 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); | 8213 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); |
8200 return chars; | 8214 return chars; |
8201 } | 8215 } |
8202 | 8216 |
8203 } // namespace dart | 8217 } // namespace dart |
OLD | NEW |