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 2275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2286 intptr_t* function_level) const; | 2286 intptr_t* function_level) const; |
2287 | 2287 |
2288 // Return true if this function declares type parameters. | 2288 // Return true if this function declares type parameters. |
2289 bool IsGeneric() const { return NumTypeParameters(Thread::Current()) > 0; } | 2289 bool IsGeneric() const { return NumTypeParameters(Thread::Current()) > 0; } |
2290 | 2290 |
2291 // Return true if any parent function of this function is generic. | 2291 // Return true if any parent function of this function is generic. |
2292 bool HasGenericParent() const; | 2292 bool HasGenericParent() const; |
2293 | 2293 |
2294 // Not thread-safe; must be called in the main thread. | 2294 // Not thread-safe; must be called in the main thread. |
2295 // Sets function's code and code's function. | 2295 // Sets function's code and code's function. |
2296 void InstallOptimizedCode(const Code& code, bool is_osr) const; | 2296 void InstallOptimizedCode(const Code& code) const; |
2297 void AttachCode(const Code& value) const; | 2297 void AttachCode(const Code& value) const; |
2298 void SetInstructions(const Code& value) const; | 2298 void SetInstructions(const Code& value) const; |
2299 void ClearCode() const; | 2299 void ClearCode() const; |
2300 | 2300 |
2301 // Disables optimized code and switches to unoptimized code. | 2301 // Disables optimized code and switches to unoptimized code. |
2302 void SwitchToUnoptimizedCode() const; | 2302 void SwitchToUnoptimizedCode() const; |
2303 | 2303 |
2304 RawCode* EnsureHasCode() const; | |
Vyacheslav Egorov (Google)
2017/03/30 13:25:01
Write a comment about what this function does.
erikcorry
2017/03/30 13:33:33
Done.
| |
2305 | |
2304 // Disables optimized code and switches to unoptimized code (or the lazy | 2306 // Disables optimized code and switches to unoptimized code (or the lazy |
2305 // compilation stub). | 2307 // compilation stub). |
2306 void SwitchToLazyCompiledUnoptimizedCode() const; | 2308 void SwitchToLazyCompiledUnoptimizedCode() const; |
2307 | 2309 |
2308 // Compiles unoptimized code (if necessary) and attaches it to the function. | 2310 // Compiles unoptimized code (if necessary) and attaches it to the function. |
2309 void EnsureHasCompiledUnoptimizedCode() const; | 2311 void EnsureHasCompiledUnoptimizedCode() const; |
2310 | 2312 |
2311 // Return the most recently compiled and installed code for this function. | 2313 // Return the most recently compiled and installed code for this function. |
2312 // It is not the only Code object that points to this function. | 2314 // It is not the only Code object that points to this function. |
2313 RawCode* CurrentCode() const { return raw_ptr()->code_; } | 2315 RawCode* CurrentCode() const { return raw_ptr()->code_; } |
(...skipping 6636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8950 | 8952 |
8951 inline void TypeArguments::SetHash(intptr_t value) const { | 8953 inline void TypeArguments::SetHash(intptr_t value) const { |
8952 // This is only safe because we create a new Smi, which does not cause | 8954 // This is only safe because we create a new Smi, which does not cause |
8953 // heap allocation. | 8955 // heap allocation. |
8954 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); | 8956 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); |
8955 } | 8957 } |
8956 | 8958 |
8957 } // namespace dart | 8959 } // namespace dart |
8958 | 8960 |
8959 #endif // RUNTIME_VM_OBJECT_H_ | 8961 #endif // RUNTIME_VM_OBJECT_H_ |
OLD | NEW |