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

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

Issue 1754813004: Add thread safe constant canonicalization. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Move allocation Created 4 years, 9 months 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
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 RawFunction* LookupFunction(const String& name) const; 1194 RawFunction* LookupFunction(const String& name) const;
1195 RawFunction* LookupFunctionAllowPrivate(const String& name) const; 1195 RawFunction* LookupFunctionAllowPrivate(const String& name) const;
1196 RawFunction* LookupGetterFunction(const String& name) const; 1196 RawFunction* LookupGetterFunction(const String& name) const;
1197 RawFunction* LookupSetterFunction(const String& name) const; 1197 RawFunction* LookupSetterFunction(const String& name) const;
1198 RawField* LookupInstanceField(const String& name) const; 1198 RawField* LookupInstanceField(const String& name) const;
1199 RawField* LookupStaticField(const String& name) const; 1199 RawField* LookupStaticField(const String& name) const;
1200 RawField* LookupField(const String& name) const; 1200 RawField* LookupField(const String& name) const;
1201 1201
1202 RawLibraryPrefix* LookupLibraryPrefix(const String& name) const; 1202 RawLibraryPrefix* LookupLibraryPrefix(const String& name) const;
1203 1203
1204 // Returns an instance of Double or Double::null().
1205 // 'index' points to either:
1206 // - constants_list_ position of found element, or
1207 // - constants_list_ position where new canonical can be inserted.
1208 RawDouble* LookupCanonicalDouble(Zone* zone,
1209 double value, intptr_t* index) const;
1210 RawMint* LookupCanonicalMint(Zone* zone,
1211 int64_t value, intptr_t* index) const;
1212 RawBigint* LookupCanonicalBigint(Zone* zone,
1213 const Bigint& value, intptr_t* index) const;
1214 // The methods above are more efficient than this generic one.
1215 RawInstance* LookupCanonicalInstance(Zone* zone,
1216 const Instance& value,
1217 intptr_t* index) const;
1218
1204 void InsertCanonicalConstant(intptr_t index, const Instance& constant) const; 1219 void InsertCanonicalConstant(intptr_t index, const Instance& constant) const;
1205 1220
1206 intptr_t FindCanonicalTypeIndex(const AbstractType& needle) const; 1221 intptr_t FindCanonicalTypeIndex(const AbstractType& needle) const;
1207 RawAbstractType* CanonicalTypeFromIndex(intptr_t idx) const; 1222 RawAbstractType* CanonicalTypeFromIndex(intptr_t idx) const;
1208 1223
1209 static intptr_t InstanceSize() { 1224 static intptr_t InstanceSize() {
1210 return RoundedAllocationSize(sizeof(RawClass)); 1225 return RoundedAllocationSize(sizeof(RawClass));
1211 } 1226 }
1212 1227
1213 bool is_implemented() const { 1228 bool is_implemented() const {
(...skipping 7264 matching lines...) Expand 10 before | Expand all | Expand 10 after
8478 8493
8479 8494
8480 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 8495 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
8481 intptr_t index) { 8496 intptr_t index) {
8482 return array.At((index * kEntryLength) + kTargetFunctionIndex); 8497 return array.At((index * kEntryLength) + kTargetFunctionIndex);
8483 } 8498 }
8484 8499
8485 } // namespace dart 8500 } // namespace dart
8486 8501
8487 #endif // VM_OBJECT_H_ 8502 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698