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

Unified Diff: runtime/vm/code_descriptors.h

Issue 1128183007: Delta encode pc descriptors, and combine pc kind and try index into single field. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/block_scheduler.cc ('k') | runtime/vm/code_descriptors.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_descriptors.h
diff --git a/runtime/vm/code_descriptors.h b/runtime/vm/code_descriptors.h
index 796f2901d45a0e7441999c5ae2f4d68e92917a88..ebe15cf913797ff453338972b5d99ad75db95556 100644
--- a/runtime/vm/code_descriptors.h
+++ b/runtime/vm/code_descriptors.h
@@ -15,59 +15,29 @@ namespace dart {
class DescriptorList : public ZoneAllocated {
public:
- struct PcDesc {
- intptr_t pc_offset; // PC offset value of the descriptor.
- RawPcDescriptors::Kind kind; // Descriptor kind (kDeopt, kOther).
- intptr_t deopt_id; // Deoptimization id.
- intptr_t data; // Token position or deopt reason.
- intptr_t try_index; // Try block index of PC or deopt array index.
- void SetTokenPos(intptr_t value) { data = value; }
- intptr_t TokenPos() const { return data; }
- void SetDeoptReason(ICData::DeoptReasonId value) { data = value; }
- ICData::DeoptReasonId DeoptReason() const {
- ASSERT((0 <= data) && (data < ICData::kDeoptNumReasons));
- return static_cast<ICData::DeoptReasonId>(data);
- }
- };
-
explicit DescriptorList(intptr_t initial_capacity)
- : list_(initial_capacity), has_try_index_(false) {}
- ~DescriptorList() { }
+ : encoded_data_(initial_capacity),
+ prev_pc_offset(0),
+ prev_deopt_id(0),
+ prev_token_pos(0) {}
- intptr_t Length() const {
- return list_.length();
- }
-
- intptr_t PcOffset(intptr_t index) const {
- return list_[index].pc_offset;
- }
- RawPcDescriptors::Kind Kind(intptr_t index) const {
- return list_[index].kind;
- }
- intptr_t DeoptId(intptr_t index) const {
- return list_[index].deopt_id;
- }
- intptr_t TokenPos(intptr_t index) const {
- return list_[index].TokenPos();
- }
- ICData::DeoptReasonId DeoptReason(intptr_t index) const {
- return list_[index].DeoptReason();
- }
- intptr_t TryIndex(intptr_t index) const {
- return (has_try_index_) ? list_[index].try_index : -1;
- }
+ ~DescriptorList() { }
void AddDescriptor(RawPcDescriptors::Kind kind,
intptr_t pc_offset,
intptr_t deopt_id,
- intptr_t token_index,
+ intptr_t token_pos,
intptr_t try_index);
RawPcDescriptors* FinalizePcDescriptors(uword entry_point);
private:
- GrowableArray<struct PcDesc> list_;
- bool has_try_index_;
+ GrowableArray<uint8_t> encoded_data_;
+
+ intptr_t prev_pc_offset;
+ intptr_t prev_deopt_id;
+ intptr_t prev_token_pos;
+
DISALLOW_COPY_AND_ASSIGN(DescriptorList);
};
« no previous file with comments | « runtime/vm/block_scheduler.cc ('k') | runtime/vm/code_descriptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698