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 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1499 Error* bound_error, | 1499 Error* bound_error, |
1500 TrailPtr bound_trail, | 1500 TrailPtr bound_trail, |
1501 Heap::Space space); | 1501 Heap::Space space); |
1502 | 1502 |
1503 FINAL_HEAP_OBJECT_IMPLEMENTATION(Class, Object); | 1503 FINAL_HEAP_OBJECT_IMPLEMENTATION(Class, Object); |
1504 friend class AbstractType; | 1504 friend class AbstractType; |
1505 friend class Instance; | 1505 friend class Instance; |
1506 friend class Object; | 1506 friend class Object; |
1507 friend class Type; | 1507 friend class Type; |
1508 friend class Intrinsifier; | 1508 friend class Intrinsifier; |
1509 friend class ProgramVisitor; | 1509 friend class Precompiler; |
1510 }; | 1510 }; |
1511 | 1511 |
1512 | 1512 |
1513 // Unresolved class is used for storing unresolved names which will be resolved | 1513 // Unresolved class is used for storing unresolved names which will be resolved |
1514 // to a class after all classes have been loaded and finalized. | 1514 // to a class after all classes have been loaded and finalized. |
1515 class UnresolvedClass : public Object { | 1515 class UnresolvedClass : public Object { |
1516 public: | 1516 public: |
1517 RawObject* library_or_library_prefix() const { | 1517 RawObject* library_or_library_prefix() const { |
1518 return raw_ptr()->library_or_library_prefix_; | 1518 return raw_ptr()->library_or_library_prefix_; |
1519 } | 1519 } |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1967 bool AddSmiSmiCheckForFastSmiStubs() const; | 1967 bool AddSmiSmiCheckForFastSmiStubs() const; |
1968 | 1968 |
1969 // Used for unoptimized static calls when no class-ids are checked. | 1969 // Used for unoptimized static calls when no class-ids are checked. |
1970 void AddTarget(const Function& target) const; | 1970 void AddTarget(const Function& target) const; |
1971 | 1971 |
1972 // Adding checks. | 1972 // Adding checks. |
1973 | 1973 |
1974 // Adds one more class test to ICData. Length of 'classes' must be equal to | 1974 // Adds one more class test to ICData. Length of 'classes' must be equal to |
1975 // the number of arguments tested. Use only for num_args_tested > 1. | 1975 // the number of arguments tested. Use only for num_args_tested > 1. |
1976 void AddCheck(const GrowableArray<intptr_t>& class_ids, | 1976 void AddCheck(const GrowableArray<intptr_t>& class_ids, |
1977 const Function& target, | 1977 const Function& target) const; |
1978 intptr_t count = 1) const; | |
1979 // Adds sorted so that Smi is the first class-id. Use only for | 1978 // Adds sorted so that Smi is the first class-id. Use only for |
1980 // num_args_tested == 1. | 1979 // num_args_tested == 1. |
1981 void AddReceiverCheck(intptr_t receiver_class_id, | 1980 void AddReceiverCheck(intptr_t receiver_class_id, |
1982 const Function& target, | 1981 const Function& target, |
1983 intptr_t count = 1) const; | 1982 intptr_t count = 1) const; |
1984 | 1983 |
1985 // Does entry |index| contain the sentinel value? | 1984 // Does entry |index| contain the sentinel value? |
1986 bool IsSentinelAt(intptr_t index) const; | 1985 bool IsSentinelAt(intptr_t index) const; |
1987 | 1986 |
1988 // Retrieving checks. | 1987 // Retrieving checks. |
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3541 intptr_t* token_len = NULL) const; | 3540 intptr_t* token_len = NULL) const; |
3542 | 3541 |
3543 // Returns index of first and last token on the given line. Returns both | 3542 // Returns index of first and last token on the given line. Returns both |
3544 // indices < 0 if no token exists on or after the line. If a token exists | 3543 // indices < 0 if no token exists on or after the line. If a token exists |
3545 // after, but not on given line, returns in *first_token_index the index of | 3544 // after, but not on given line, returns in *first_token_index the index of |
3546 // the first token after the line, and a negative value in *last_token_index. | 3545 // the first token after the line, and a negative value in *last_token_index. |
3547 void TokenRangeAtLine(intptr_t line_number, | 3546 void TokenRangeAtLine(intptr_t line_number, |
3548 TokenPosition* first_token_index, | 3547 TokenPosition* first_token_index, |
3549 TokenPosition* last_token_index) const; | 3548 TokenPosition* last_token_index) const; |
3550 | 3549 |
3551 int32_t SourceFingerprint() const; | |
3552 int32_t SourceFingerprint(TokenPosition start, TokenPosition end) const; | |
3553 | |
3554 static intptr_t InstanceSize() { | 3550 static intptr_t InstanceSize() { |
3555 return RoundedAllocationSize(sizeof(RawScript)); | 3551 return RoundedAllocationSize(sizeof(RawScript)); |
3556 } | 3552 } |
3557 | 3553 |
3558 static RawScript* New(const String& url, | 3554 static RawScript* New(const String& url, |
3559 const String& source, | 3555 const String& source, |
3560 RawScript::Kind kind); | 3556 RawScript::Kind kind); |
3561 | 3557 |
3562 static RawScript* New(const String& url, | 3558 static RawScript* New(const String& url, |
3563 const String& resolved_url, | 3559 const String& resolved_url, |
(...skipping 3335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6899 | 6895 |
6900 static RawString* Transform(int32_t (*mapping)(int32_t ch), | 6896 static RawString* Transform(int32_t (*mapping)(int32_t ch), |
6901 const String& str, | 6897 const String& str, |
6902 Heap::Space space = Heap::kNew); | 6898 Heap::Space space = Heap::kNew); |
6903 | 6899 |
6904 static RawString* ToUpperCase(const String& str, | 6900 static RawString* ToUpperCase(const String& str, |
6905 Heap::Space space = Heap::kNew); | 6901 Heap::Space space = Heap::kNew); |
6906 static RawString* ToLowerCase(const String& str, | 6902 static RawString* ToLowerCase(const String& str, |
6907 Heap::Space space = Heap::kNew); | 6903 Heap::Space space = Heap::kNew); |
6908 | 6904 |
6909 static RawString* RemovePrivateKey(const String& name); | |
6910 | |
6911 static RawString* ScrubName(const String& name); | 6905 static RawString* ScrubName(const String& name); |
6912 static RawString* ScrubNameRetainPrivate(const String& name); | 6906 static RawString* ScrubNameRetainPrivate(const String& name); |
6913 | 6907 |
6914 static bool EqualsIgnoringPrivateKey(const String& str1, const String& str2); | 6908 static bool EqualsIgnoringPrivateKey(const String& str1, const String& str2); |
6915 | 6909 |
6916 static RawString* NewFormatted(const char* format, ...) | 6910 static RawString* NewFormatted(const char* format, ...) |
6917 PRINTF_ATTRIBUTE(1, 2); | 6911 PRINTF_ATTRIBUTE(1, 2); |
6918 static RawString* NewFormatted(Heap::Space space, const char* format, ...) | 6912 static RawString* NewFormatted(Heap::Space space, const char* format, ...) |
6919 PRINTF_ATTRIBUTE(2, 3); | 6913 PRINTF_ATTRIBUTE(2, 3); |
6920 static RawString* NewFormattedV(const char* format, | 6914 static RawString* NewFormattedV(const char* format, |
(...skipping 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8904 | 8898 |
8905 inline void TypeArguments::SetHash(intptr_t value) const { | 8899 inline void TypeArguments::SetHash(intptr_t value) const { |
8906 // This is only safe because we create a new Smi, which does not cause | 8900 // This is only safe because we create a new Smi, which does not cause |
8907 // heap allocation. | 8901 // heap allocation. |
8908 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); | 8902 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); |
8909 } | 8903 } |
8910 | 8904 |
8911 } // namespace dart | 8905 } // namespace dart |
8912 | 8906 |
8913 #endif // RUNTIME_VM_OBJECT_H_ | 8907 #endif // RUNTIME_VM_OBJECT_H_ |
OLD | NEW |