Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Side by Side Diff: runtime/vm/object.h

Issue 2572423004: Reapply "Save and restore feedback from JIT." (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 Precompiler; 1509 friend class ProgramVisitor;
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
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) const; 1977 const Function& target,
1978 intptr_t count = 1) const;
1978 // Adds sorted so that Smi is the first class-id. Use only for 1979 // Adds sorted so that Smi is the first class-id. Use only for
1979 // num_args_tested == 1. 1980 // num_args_tested == 1.
1980 void AddReceiverCheck(intptr_t receiver_class_id, 1981 void AddReceiverCheck(intptr_t receiver_class_id,
1981 const Function& target, 1982 const Function& target,
1982 intptr_t count = 1) const; 1983 intptr_t count = 1) const;
1983 1984
1984 // Does entry |index| contain the sentinel value? 1985 // Does entry |index| contain the sentinel value?
1985 bool IsSentinelAt(intptr_t index) const; 1986 bool IsSentinelAt(intptr_t index) const;
1986 1987
1987 // Retrieving checks. 1988 // Retrieving checks.
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after
3540 intptr_t* token_len = NULL) const; 3541 intptr_t* token_len = NULL) const;
3541 3542
3542 // Returns index of first and last token on the given line. Returns both 3543 // Returns index of first and last token on the given line. Returns both
3543 // indices < 0 if no token exists on or after the line. If a token exists 3544 // indices < 0 if no token exists on or after the line. If a token exists
3544 // after, but not on given line, returns in *first_token_index the index of 3545 // after, but not on given line, returns in *first_token_index the index of
3545 // the first token after the line, and a negative value in *last_token_index. 3546 // the first token after the line, and a negative value in *last_token_index.
3546 void TokenRangeAtLine(intptr_t line_number, 3547 void TokenRangeAtLine(intptr_t line_number,
3547 TokenPosition* first_token_index, 3548 TokenPosition* first_token_index,
3548 TokenPosition* last_token_index) const; 3549 TokenPosition* last_token_index) const;
3549 3550
3551 int32_t SourceFingerprint() const;
3552 int32_t SourceFingerprint(TokenPosition start, TokenPosition end) const;
3553
3550 static intptr_t InstanceSize() { 3554 static intptr_t InstanceSize() {
3551 return RoundedAllocationSize(sizeof(RawScript)); 3555 return RoundedAllocationSize(sizeof(RawScript));
3552 } 3556 }
3553 3557
3554 static RawScript* New(const String& url, 3558 static RawScript* New(const String& url,
3555 const String& source, 3559 const String& source,
3556 RawScript::Kind kind); 3560 RawScript::Kind kind);
3557 3561
3558 static RawScript* New(const String& url, 3562 static RawScript* New(const String& url,
3559 const String& resolved_url, 3563 const String& resolved_url,
(...skipping 3335 matching lines...) Expand 10 before | Expand all | Expand 10 after
6895 6899
6896 static RawString* Transform(int32_t (*mapping)(int32_t ch), 6900 static RawString* Transform(int32_t (*mapping)(int32_t ch),
6897 const String& str, 6901 const String& str,
6898 Heap::Space space = Heap::kNew); 6902 Heap::Space space = Heap::kNew);
6899 6903
6900 static RawString* ToUpperCase(const String& str, 6904 static RawString* ToUpperCase(const String& str,
6901 Heap::Space space = Heap::kNew); 6905 Heap::Space space = Heap::kNew);
6902 static RawString* ToLowerCase(const String& str, 6906 static RawString* ToLowerCase(const String& str,
6903 Heap::Space space = Heap::kNew); 6907 Heap::Space space = Heap::kNew);
6904 6908
6909 static RawString* RemovePrivateKey(const String& name);
6910
6905 static RawString* ScrubName(const String& name); 6911 static RawString* ScrubName(const String& name);
6906 static RawString* ScrubNameRetainPrivate(const String& name); 6912 static RawString* ScrubNameRetainPrivate(const String& name);
6907 6913
6908 static bool EqualsIgnoringPrivateKey(const String& str1, const String& str2); 6914 static bool EqualsIgnoringPrivateKey(const String& str1, const String& str2);
6909 6915
6910 static RawString* NewFormatted(const char* format, ...) 6916 static RawString* NewFormatted(const char* format, ...)
6911 PRINTF_ATTRIBUTE(1, 2); 6917 PRINTF_ATTRIBUTE(1, 2);
6912 static RawString* NewFormatted(Heap::Space space, const char* format, ...) 6918 static RawString* NewFormatted(Heap::Space space, const char* format, ...)
6913 PRINTF_ATTRIBUTE(2, 3); 6919 PRINTF_ATTRIBUTE(2, 3);
6914 static RawString* NewFormattedV(const char* format, 6920 static RawString* NewFormattedV(const char* format,
(...skipping 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after
8898 8904
8899 inline void TypeArguments::SetHash(intptr_t value) const { 8905 inline void TypeArguments::SetHash(intptr_t value) const {
8900 // This is only safe because we create a new Smi, which does not cause 8906 // This is only safe because we create a new Smi, which does not cause
8901 // heap allocation. 8907 // heap allocation.
8902 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8908 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8903 } 8909 }
8904 8910
8905 } // namespace dart 8911 } // namespace dart
8906 8912
8907 #endif // RUNTIME_VM_OBJECT_H_ 8913 #endif // RUNTIME_VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698