| 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 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1673 bool is_visible() const { | 1673 bool is_visible() const { |
| 1674 return VisibleBit::decode(raw_ptr()->kind_tag_); | 1674 return VisibleBit::decode(raw_ptr()->kind_tag_); |
| 1675 } | 1675 } |
| 1676 void set_is_visible(bool value) const; | 1676 void set_is_visible(bool value) const; |
| 1677 | 1677 |
| 1678 bool is_intrinsic() const { | 1678 bool is_intrinsic() const { |
| 1679 return IntrinsicBit::decode(raw_ptr()->kind_tag_); | 1679 return IntrinsicBit::decode(raw_ptr()->kind_tag_); |
| 1680 } | 1680 } |
| 1681 void set_is_intrinsic(bool value) const; | 1681 void set_is_intrinsic(bool value) const; |
| 1682 | 1682 |
| 1683 bool is_recognized() const { |
| 1684 return RecognizedBit::decode(raw_ptr()->kind_tag_); |
| 1685 } |
| 1686 void set_is_recognized(bool value) const; |
| 1687 |
| 1683 bool HasOptimizedCode() const; | 1688 bool HasOptimizedCode() const; |
| 1684 | 1689 |
| 1685 // Returns true if the argument counts are valid for calling this function. | 1690 // Returns true if the argument counts are valid for calling this function. |
| 1686 // Otherwise, it returns false and the reason (if error_message is not NULL). | 1691 // Otherwise, it returns false and the reason (if error_message is not NULL). |
| 1687 bool AreValidArgumentCounts(intptr_t num_arguments, | 1692 bool AreValidArgumentCounts(intptr_t num_arguments, |
| 1688 intptr_t num_named_arguments, | 1693 intptr_t num_named_arguments, |
| 1689 String* error_message) const; | 1694 String* error_message) const; |
| 1690 | 1695 |
| 1691 // Returns true if the total argument count and the names of optional | 1696 // Returns true if the total argument count and the names of optional |
| 1692 // arguments are valid for calling this function. | 1697 // arguments are valid for calling this function. |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1831 kStaticBit = 0, | 1836 kStaticBit = 0, |
| 1832 kConstBit = 1, | 1837 kConstBit = 1, |
| 1833 kOptimizableBit = 2, | 1838 kOptimizableBit = 2, |
| 1834 kInlinableBit = 3, | 1839 kInlinableBit = 3, |
| 1835 kHasFinallyBit = 4, | 1840 kHasFinallyBit = 4, |
| 1836 kNativeBit = 5, | 1841 kNativeBit = 5, |
| 1837 kAbstractBit = 6, | 1842 kAbstractBit = 6, |
| 1838 kExternalBit = 7, | 1843 kExternalBit = 7, |
| 1839 kVisibleBit = 8, | 1844 kVisibleBit = 8, |
| 1840 kIntrinsicBit = 9, | 1845 kIntrinsicBit = 9, |
| 1841 kKindTagBit = 10, | 1846 kRecognizedBit = 10, |
| 1847 kKindTagBit = 11, |
| 1842 kKindTagSize = 4, | 1848 kKindTagSize = 4, |
| 1843 }; | 1849 }; |
| 1844 class StaticBit : public BitField<bool, kStaticBit, 1> {}; | 1850 class StaticBit : public BitField<bool, kStaticBit, 1> {}; |
| 1845 class ConstBit : public BitField<bool, kConstBit, 1> {}; | 1851 class ConstBit : public BitField<bool, kConstBit, 1> {}; |
| 1846 class OptimizableBit : public BitField<bool, kOptimizableBit, 1> {}; | 1852 class OptimizableBit : public BitField<bool, kOptimizableBit, 1> {}; |
| 1847 class InlinableBit : public BitField<bool, kInlinableBit, 1> {}; | 1853 class InlinableBit : public BitField<bool, kInlinableBit, 1> {}; |
| 1848 class HasFinallyBit : public BitField<bool, kHasFinallyBit, 1> {}; | 1854 class HasFinallyBit : public BitField<bool, kHasFinallyBit, 1> {}; |
| 1849 class NativeBit : public BitField<bool, kNativeBit, 1> {}; | 1855 class NativeBit : public BitField<bool, kNativeBit, 1> {}; |
| 1850 class AbstractBit : public BitField<bool, kAbstractBit, 1> {}; | 1856 class AbstractBit : public BitField<bool, kAbstractBit, 1> {}; |
| 1851 class ExternalBit : public BitField<bool, kExternalBit, 1> {}; | 1857 class ExternalBit : public BitField<bool, kExternalBit, 1> {}; |
| 1852 class VisibleBit : public BitField<bool, kVisibleBit, 1> {}; | 1858 class VisibleBit : public BitField<bool, kVisibleBit, 1> {}; |
| 1853 class IntrinsicBit : public BitField<bool, kIntrinsicBit, 1> {}; | 1859 class IntrinsicBit : public BitField<bool, kIntrinsicBit, 1> {}; |
| 1860 class RecognizedBit : public BitField<bool, kRecognizedBit, 1> {}; |
| 1854 class KindBits : | 1861 class KindBits : |
| 1855 public BitField<RawFunction::Kind, kKindTagBit, kKindTagSize> {}; // NOLINT | 1862 public BitField<RawFunction::Kind, kKindTagBit, kKindTagSize> {}; // NOLINT |
| 1856 | 1863 |
| 1857 void set_name(const String& value) const; | 1864 void set_name(const String& value) const; |
| 1858 void set_kind(RawFunction::Kind value) const; | 1865 void set_kind(RawFunction::Kind value) const; |
| 1859 void set_is_static(bool value) const; | 1866 void set_is_static(bool value) const; |
| 1860 void set_is_const(bool value) const; | 1867 void set_is_const(bool value) const; |
| 1861 void set_is_external(bool value) const; | 1868 void set_is_external(bool value) const; |
| 1862 void set_parent_function(const Function& value) const; | 1869 void set_parent_function(const Function& value) const; |
| 1863 void set_owner(const Object& value) const; | 1870 void set_owner(const Object& value) const; |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2492 | 2499 |
| 2493 // Eagerly compile all classes and functions in the library. | 2500 // Eagerly compile all classes and functions in the library. |
| 2494 static RawError* CompileAll(); | 2501 static RawError* CompileAll(); |
| 2495 | 2502 |
| 2496 // Checks function fingerprints. Prints mismatches and aborts if | 2503 // Checks function fingerprints. Prints mismatches and aborts if |
| 2497 // mismatch found. | 2504 // mismatch found. |
| 2498 static void CheckFunctionFingerprints(); | 2505 static void CheckFunctionFingerprints(); |
| 2499 | 2506 |
| 2500 static bool IsPrivate(const String& name); | 2507 static bool IsPrivate(const String& name); |
| 2501 | 2508 |
| 2509 // Return Function::null() if function does not exist in libs. |
| 2510 static RawFunction* GetFunction(const GrowableArray<Library*>& libs, |
| 2511 const char* class_name, |
| 2512 const char* function_name); |
| 2513 |
| 2502 private: | 2514 private: |
| 2503 static const int kInitialImportsCapacity = 4; | 2515 static const int kInitialImportsCapacity = 4; |
| 2504 static const int kImportsCapacityIncrement = 8; | 2516 static const int kImportsCapacityIncrement = 8; |
| 2505 static RawLibrary* New(); | 2517 static RawLibrary* New(); |
| 2506 | 2518 |
| 2507 void set_num_imports(intptr_t value) const { | 2519 void set_num_imports(intptr_t value) const { |
| 2508 raw_ptr()->num_imports_ = value; | 2520 raw_ptr()->num_imports_ = value; |
| 2509 } | 2521 } |
| 2510 RawArray* imports() const { return raw_ptr()->imports_; } | 2522 RawArray* imports() const { return raw_ptr()->imports_; } |
| 2511 RawArray* exports() const { return raw_ptr()->exports_; } | 2523 RawArray* exports() const { return raw_ptr()->exports_; } |
| (...skipping 3685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6197 | 6209 |
| 6198 | 6210 |
| 6199 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6211 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6200 intptr_t index) { | 6212 intptr_t index) { |
| 6201 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6213 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6202 } | 6214 } |
| 6203 | 6215 |
| 6204 } // namespace dart | 6216 } // namespace dart |
| 6205 | 6217 |
| 6206 #endif // VM_OBJECT_H_ | 6218 #endif // VM_OBJECT_H_ |
| OLD | NEW |