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

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

Issue 1998263002: Include multiplication in the megamorphic cache hash to avoid cid ranges overlapping modulo table s… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | 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 4957 matching lines...) Expand 10 before | Expand all | Expand 10 after
4968 } 4968 }
4969 4969
4970 FINAL_HEAP_OBJECT_IMPLEMENTATION(ContextScope, Object); 4970 FINAL_HEAP_OBJECT_IMPLEMENTATION(ContextScope, Object);
4971 friend class Class; 4971 friend class Class;
4972 friend class Object; 4972 friend class Object;
4973 }; 4973 };
4974 4974
4975 4975
4976 class MegamorphicCache : public Object { 4976 class MegamorphicCache : public Object {
4977 public: 4977 public:
4978 static const int kInitialCapacity = 16; 4978 static const intptr_t kInitialCapacity = 16;
4979 static const intptr_t kSpreadFactor = 7;
4979 static const double kLoadFactor; 4980 static const double kLoadFactor;
4980 4981
4981 RawArray* buckets() const; 4982 RawArray* buckets() const;
4982 void set_buckets(const Array& buckets) const; 4983 void set_buckets(const Array& buckets) const;
4983 4984
4984 intptr_t mask() const; 4985 intptr_t mask() const;
4985 void set_mask(intptr_t mask) const; 4986 void set_mask(intptr_t mask) const;
4986 4987
4987 RawString* target_name() const { 4988 RawString* target_name() const {
4988 return raw_ptr()->target_name_; 4989 return raw_ptr()->target_name_;
(...skipping 3706 matching lines...) Expand 10 before | Expand all | Expand 10 after
8695 8696
8696 inline void TypeArguments::SetHash(intptr_t value) const { 8697 inline void TypeArguments::SetHash(intptr_t value) const {
8697 // This is only safe because we create a new Smi, which does not cause 8698 // This is only safe because we create a new Smi, which does not cause
8698 // heap allocation. 8699 // heap allocation.
8699 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8700 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8700 } 8701 }
8701 8702
8702 } // namespace dart 8703 } // namespace dart
8703 8704
8704 #endif // VM_OBJECT_H_ 8705 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698