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

Unified Diff: runtime/vm/code_descriptors.cc

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/code_descriptors.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_descriptors.cc
diff --git a/runtime/vm/code_descriptors.cc b/runtime/vm/code_descriptors.cc
index 233d1b68032eb373578737b57a739b08f3fb3201..5a9ba10eb888e0b14f513c64d19054e983a7855e 100644
--- a/runtime/vm/code_descriptors.cc
+++ b/runtime/vm/code_descriptors.cc
@@ -9,38 +9,28 @@ namespace dart {
void DescriptorList::AddDescriptor(RawPcDescriptors::Kind kind,
intptr_t pc_offset,
intptr_t deopt_id,
- intptr_t token_index,
+ intptr_t token_pos,
intptr_t try_index) {
ASSERT((kind == RawPcDescriptors::kRuntimeCall) ||
(kind == RawPcDescriptors::kOther) ||
(deopt_id != Isolate::kNoDeoptId));
- struct PcDesc data;
- data.pc_offset = pc_offset;
- data.kind = kind;
- data.deopt_id = deopt_id;
- data.SetTokenPos(token_index);
- data.try_index = try_index;
- list_.Add(data);
- if (try_index >= 0) {
- has_try_index_ = true;
- }
+
+ intptr_t merged_kind_try =
+ RawPcDescriptors::MergedKindTry::Encode(kind, try_index);
+
+ PcDescriptors::EncodeInteger(&encoded_data_, merged_kind_try);
+ PcDescriptors::EncodeInteger(&encoded_data_, pc_offset - prev_pc_offset);
+ PcDescriptors::EncodeInteger(&encoded_data_, deopt_id - prev_deopt_id);
+ PcDescriptors::EncodeInteger(&encoded_data_, token_pos - prev_token_pos);
+
+ prev_pc_offset = pc_offset;
+ prev_deopt_id = deopt_id;
+ prev_token_pos = token_pos;
}
RawPcDescriptors* DescriptorList::FinalizePcDescriptors(uword entry_point) {
- intptr_t num_descriptors = Length();
- const PcDescriptors& descriptors =
- PcDescriptors::Handle(PcDescriptors::New(num_descriptors,
- has_try_index_));
- for (intptr_t i = 0; i < num_descriptors; i++) {
- descriptors.AddDescriptor(i,
- PcOffset(i),
- Kind(i),
- DeoptId(i),
- TokenPos(i),
- TryIndex(i));
- }
- return descriptors.raw();
+ return PcDescriptors::New(&encoded_data_);
}
« no previous file with comments | « runtime/vm/code_descriptors.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698