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

Unified Diff: runtime/vm/code_descriptors.cc

Issue 1584393003: Precompilation: omit pc descriptors without a try index. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | 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 adc78537f6630d148a74ff0fb6d6635f1ab89222..b70f6e074998d36a61cf5d01a02b81409f41e897 100644
--- a/runtime/vm/code_descriptors.cc
+++ b/runtime/vm/code_descriptors.cc
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
#include "vm/code_descriptors.h"
+#include "vm/compiler.h"
namespace dart {
@@ -15,21 +16,27 @@ void DescriptorList::AddDescriptor(RawPcDescriptors::Kind kind,
(kind == RawPcDescriptors::kOther) ||
(deopt_id != Thread::kNoDeoptId));
- intptr_t merged_kind_try =
- RawPcDescriptors::MergedKindTry::Encode(kind, try_index);
+ // When precompiling, we only use pc descriptors for exceptions.
+ if (Compiler::allow_recompilation() || try_index != -1) {
Florian Schneider 2016/01/19 20:19:47 if (!Compiler::always_optimize() It seems we use
+ 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);
+ 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;
+ prev_pc_offset = pc_offset;
+ prev_deopt_id = deopt_id;
+ prev_token_pos = token_pos;
+ }
}
RawPcDescriptors* DescriptorList::FinalizePcDescriptors(uword entry_point) {
+ if (encoded_data_.length() == 0) {
+ return Object::empty_descriptors().raw();
+ }
return PcDescriptors::New(&encoded_data_);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698