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 #ifndef RUNTIME_VM_OBJECT_H_ | 5 #ifndef RUNTIME_VM_OBJECT_H_ |
6 #define RUNTIME_VM_OBJECT_H_ | 6 #define RUNTIME_VM_OBJECT_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
(...skipping 3965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3976 // Character used to indicate a private identifier. | 3976 // Character used to indicate a private identifier. |
3977 static const char kPrivateIdentifierStart = '_'; | 3977 static const char kPrivateIdentifierStart = '_'; |
3978 | 3978 |
3979 // Character used to separate private identifiers from | 3979 // Character used to separate private identifiers from |
3980 // the library-specific key. | 3980 // the library-specific key. |
3981 static const char kPrivateKeySeparator = '@'; | 3981 static const char kPrivateKeySeparator = '@'; |
3982 | 3982 |
3983 void CheckReload(const Library& replacement, | 3983 void CheckReload(const Library& replacement, |
3984 IsolateReloadContext* context) const; | 3984 IsolateReloadContext* context) const; |
3985 | 3985 |
| 3986 // Returns a closure of top level function 'name' in the exported namespace |
| 3987 // of this library. If a top level function 'name' does not exist we look |
| 3988 // for a top level getter 'name' that returns a closure. |
| 3989 RawObject* GetFunctionClosure(const String& name) const; |
| 3990 |
3986 private: | 3991 private: |
3987 static const int kInitialImportsCapacity = 4; | 3992 static const int kInitialImportsCapacity = 4; |
3988 static const int kImportsCapacityIncrement = 8; | 3993 static const int kImportsCapacityIncrement = 8; |
3989 | 3994 |
3990 static RawLibrary* New(); | 3995 static RawLibrary* New(); |
3991 | 3996 |
3992 void set_num_imports(intptr_t value) const; | 3997 void set_num_imports(intptr_t value) const; |
3993 bool HasExports() const; | 3998 bool HasExports() const; |
3994 RawArray* loaded_scripts() const { return raw_ptr()->loaded_scripts_; } | 3999 RawArray* loaded_scripts() const { return raw_ptr()->loaded_scripts_; } |
3995 RawGrowableObjectArray* metadata() const { return raw_ptr()->metadata_; } | 4000 RawGrowableObjectArray* metadata() const { return raw_ptr()->metadata_; } |
(...skipping 5066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9062 | 9067 |
9063 inline void TypeArguments::SetHash(intptr_t value) const { | 9068 inline void TypeArguments::SetHash(intptr_t value) const { |
9064 // This is only safe because we create a new Smi, which does not cause | 9069 // This is only safe because we create a new Smi, which does not cause |
9065 // heap allocation. | 9070 // heap allocation. |
9066 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); | 9071 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); |
9067 } | 9072 } |
9068 | 9073 |
9069 } // namespace dart | 9074 } // namespace dart |
9070 | 9075 |
9071 #endif // RUNTIME_VM_OBJECT_H_ | 9076 #endif // RUNTIME_VM_OBJECT_H_ |
OLD | NEW |