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

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

Issue 1387613003: Dedup stackmaps. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/precompiler.h » ('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 3937 matching lines...) Expand 10 before | Expand all | Expand 10 after
3948 ASSERT(value <= kMaxUint32); 3948 ASSERT(value <= kMaxUint32);
3949 StoreNonPointer(&raw_ptr()->pc_offset_, value); 3949 StoreNonPointer(&raw_ptr()->pc_offset_, value);
3950 } 3950 }
3951 3951
3952 intptr_t RegisterBitCount() const { return raw_ptr()->register_bit_count_; } 3952 intptr_t RegisterBitCount() const { return raw_ptr()->register_bit_count_; }
3953 void SetRegisterBitCount(intptr_t register_bit_count) const { 3953 void SetRegisterBitCount(intptr_t register_bit_count) const {
3954 ASSERT(register_bit_count < kMaxInt32); 3954 ASSERT(register_bit_count < kMaxInt32);
3955 StoreNonPointer(&raw_ptr()->register_bit_count_, register_bit_count); 3955 StoreNonPointer(&raw_ptr()->register_bit_count_, register_bit_count);
3956 } 3956 }
3957 3957
3958 bool Equals(const Stackmap& other) const {
3959 if (Length() != other.Length()) {
3960 return false;
3961 }
3962 NoSafepointScope no_safepoint;
3963 return memcmp(raw_ptr(), other.raw_ptr(), InstanceSize(Length())) == 0;
3964 }
3965
3958 static const intptr_t kMaxLengthInBytes = kSmiMax; 3966 static const intptr_t kMaxLengthInBytes = kSmiMax;
3959 3967
3960 static intptr_t InstanceSize() { 3968 static intptr_t InstanceSize() {
3961 ASSERT(sizeof(RawStackmap) == OFFSET_OF_RETURNED_VALUE(RawStackmap, data)); 3969 ASSERT(sizeof(RawStackmap) == OFFSET_OF_RETURNED_VALUE(RawStackmap, data));
3962 return 0; 3970 return 0;
3963 } 3971 }
3964 static intptr_t InstanceSize(intptr_t length) { 3972 static intptr_t InstanceSize(intptr_t length) {
3965 ASSERT(length >= 0); 3973 ASSERT(length >= 0);
3966 // The stackmap payload is in an array of bytes. 3974 // The stackmap payload is in an array of bytes.
3967 intptr_t payload_size = 3975 intptr_t payload_size =
(...skipping 4183 matching lines...) Expand 10 before | Expand all | Expand 10 after
8151 8159
8152 8160
8153 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 8161 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
8154 intptr_t index) { 8162 intptr_t index) {
8155 return array.At((index * kEntryLength) + kTargetFunctionIndex); 8163 return array.At((index * kEntryLength) + kTargetFunctionIndex);
8156 } 8164 }
8157 8165
8158 } // namespace dart 8166 } // namespace dart
8159 8167
8160 #endif // VM_OBJECT_H_ 8168 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/precompiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698