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

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

Issue 23788012: Fix an off-by-one error in deoptimization compression. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
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 2918 matching lines...) Expand 10 before | Expand all | Expand 10 after
2929 intptr_t FromIndex(intptr_t index) const; 2929 intptr_t FromIndex(intptr_t index) const;
2930 intptr_t ToIndex(intptr_t index) const { 2930 intptr_t ToIndex(intptr_t index) const {
2931 return index; 2931 return index;
2932 } 2932 }
2933 2933
2934 // Unpack the entire translation into an array of deoptimization 2934 // Unpack the entire translation into an array of deoptimization
2935 // instructions. This copies any shared suffixes into the array. 2935 // instructions. This copies any shared suffixes into the array.
2936 void ToInstructions(const Array& table, 2936 void ToInstructions(const Array& table,
2937 GrowableArray<DeoptInstr*>* instructions) const; 2937 GrowableArray<DeoptInstr*>* instructions) const;
2938 2938
2939
2940 // Returns true iff decompression yields the same instructions as the
2941 // original.
2942 bool VerifyDecompression(const GrowableArray<DeoptInstr*>& original,
2943 const Array& deopt_table) const;
2944
2939 private: 2945 private:
2940 intptr_t* EntryAddr(intptr_t index, intptr_t entry_offset) const { 2946 intptr_t* EntryAddr(intptr_t index, intptr_t entry_offset) const {
2941 ASSERT((index >=0) && (index < Length())); 2947 ASSERT((index >=0) && (index < Length()));
2942 intptr_t data_index = (index * kNumberOfEntries) + entry_offset; 2948 intptr_t data_index = (index * kNumberOfEntries) + entry_offset;
2943 return &raw_ptr()->data_[data_index]; 2949 return &raw_ptr()->data_[data_index];
2944 } 2950 }
2945 2951
2946 void SetLength(intptr_t value) const; 2952 void SetLength(intptr_t value) const;
2947 2953
2948 FINAL_HEAP_OBJECT_IMPLEMENTATION(DeoptInfo, Object); 2954 FINAL_HEAP_OBJECT_IMPLEMENTATION(DeoptInfo, Object);
(...skipping 3209 matching lines...) Expand 10 before | Expand all | Expand 10 after
6158 6164
6159 6165
6160 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6166 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6161 intptr_t index) { 6167 intptr_t index) {
6162 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6168 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6163 } 6169 }
6164 6170
6165 } // namespace dart 6171 } // namespace dart
6166 6172
6167 #endif // VM_OBJECT_H_ 6173 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698