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

Unified Diff: runtime/vm/code_descriptors.cc

Issue 1136953015: Revert "Delta encode pc descriptors." (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 cc5ad3eec6ef0e2a751aa508e0b99ad8d7249e94..233d1b68032eb373578737b57a739b08f3fb3201 100644
--- a/runtime/vm/code_descriptors.cc
+++ b/runtime/vm/code_descriptors.cc
@@ -9,31 +9,38 @@ namespace dart {
void DescriptorList::AddDescriptor(RawPcDescriptors::Kind kind,
intptr_t pc_offset,
intptr_t deopt_id,
- intptr_t token_pos,
+ intptr_t token_index,
intptr_t try_index) {
ASSERT((kind == RawPcDescriptors::kRuntimeCall) ||
(kind == RawPcDescriptors::kOther) ||
(deopt_id != Isolate::kNoDeoptId));
-
- PcDescriptors::EncodeInteger(&delta_encoded_data_,
- static_cast<intptr_t>(kind));
- PcDescriptors::EncodeInteger(&delta_encoded_data_,
- try_index);
- PcDescriptors::EncodeInteger(&delta_encoded_data_,
- pc_offset - prev_pc_offset);
- PcDescriptors::EncodeInteger(&delta_encoded_data_,
- deopt_id - prev_deopt_id);
- PcDescriptors::EncodeInteger(&delta_encoded_data_,
- token_pos - prev_token_pos);
-
- prev_pc_offset = pc_offset;
- prev_deopt_id = deopt_id;
- prev_token_pos = token_pos;
+ 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;
+ }
}
RawPcDescriptors* DescriptorList::FinalizePcDescriptors(uword entry_point) {
- return PcDescriptors::New(&delta_encoded_data_);
+ 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();
}
« 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