| 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 VM_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
| 6 #define VM_OBJECT_H_ | 6 #define 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 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2165 | 2165 |
| 2166 bool IsSyncGenerator() const { | 2166 bool IsSyncGenerator() const { |
| 2167 return modifier() == RawFunction::kSyncGen; | 2167 return modifier() == RawFunction::kSyncGen; |
| 2168 } | 2168 } |
| 2169 | 2169 |
| 2170 bool IsSyncGenClosure() const { | 2170 bool IsSyncGenClosure() const { |
| 2171 return is_generated_body() && | 2171 return is_generated_body() && |
| 2172 Function::Handle(parent_function()).IsSyncGenerator(); | 2172 Function::Handle(parent_function()).IsSyncGenerator(); |
| 2173 } | 2173 } |
| 2174 | 2174 |
| 2175 bool IsGeneratorClosure() const { |
| 2176 return is_generated_body() && |
| 2177 Function::Handle(parent_function()).IsGenerator(); |
| 2178 } |
| 2179 |
| 2180 bool IsAsyncGenerator() const { |
| 2181 return modifier() == RawFunction::kAsyncGen; |
| 2182 } |
| 2183 |
| 2184 bool IsAsyncGenClosure() const { |
| 2185 return is_generated_body() && |
| 2186 Function::Handle(parent_function()).IsAsyncGenerator(); |
| 2187 } |
| 2188 |
| 2175 bool IsAsyncOrGenerator() const { | 2189 bool IsAsyncOrGenerator() const { |
| 2176 return modifier() != RawFunction::kNoModifier; | 2190 return modifier() != RawFunction::kNoModifier; |
| 2177 } | 2191 } |
| 2178 | 2192 |
| 2179 static intptr_t InstanceSize() { | 2193 static intptr_t InstanceSize() { |
| 2180 return RoundedAllocationSize(sizeof(RawFunction)); | 2194 return RoundedAllocationSize(sizeof(RawFunction)); |
| 2181 } | 2195 } |
| 2182 | 2196 |
| 2183 static RawFunction* New(const String& name, | 2197 static RawFunction* New(const String& name, |
| 2184 RawFunction::Kind kind, | 2198 RawFunction::Kind kind, |
| (...skipping 5613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7798 | 7812 |
| 7799 | 7813 |
| 7800 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 7814 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 7801 intptr_t index) { | 7815 intptr_t index) { |
| 7802 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 7816 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 7803 } | 7817 } |
| 7804 | 7818 |
| 7805 } // namespace dart | 7819 } // namespace dart |
| 7806 | 7820 |
| 7807 #endif // VM_OBJECT_H_ | 7821 #endif // VM_OBJECT_H_ |
| OLD | NEW |