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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 722243002: Indirectly dispatch all backtracking jumps through the same block. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: const Created 6 years, 1 month 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
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 250651e3bb61c3cee1b4fec56e64c5add6da63d7..3d739ba7649940ea394b9890dccca18ce25578a4 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -2530,6 +2530,39 @@ void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
+void IndirectGotoInstr::ComputeOffsetTable(Isolate* isolate) {
+ ASSERT(SuccessorCount() == offsets_.Capacity());
+ offsets_.SetLength(SuccessorCount());
+ for (intptr_t i = 0; i < SuccessorCount(); i++) {
+ TargetEntryInstr* target = SuccessorAt(i);
+
+ // Optimizations might have modified the immediate target block, but
+ // it must end with a goto to the indirect entry.
+ Instruction* instr = target;
Vyacheslav Egorov (Google) 2014/11/13 18:30:04 use target->last_instruction() instead of the loop
zerny-google 2014/11/14 13:29:29 No can do, since it is not set if the target is un
+ while (instr != NULL && !instr->IsGoto()) {
+ instr = instr->next();
+ }
+ ASSERT(instr->IsGoto());
+
+ IndirectEntryInstr* ientry =
+ instr->AsGoto()->successor()->AsIndirectEntry();
+ ASSERT(ientry != NULL);
+ ASSERT(ientry->indirect_id() == i);
+
+ // The intermediate block might be compacted, check both it and the
+ // final indirect entry for a valid offset. If neither are valid, then
+ // the indirect entry is unreachable.
+ intptr_t offset =
Vyacheslav Egorov (Google) 2014/11/13 18:30:04 when can the ientry be unreachable? if it is "unr
zerny-google 2014/11/14 13:29:28 It is possible that we never emit a backtracking p
+ (target->offset() > 0) ? target->offset() : ientry->offset();
+
+ if (offset > 0) {
+ offset -= Assembler::EntryPointToPcMarkerOffset();
+ offsets_.SetAt(i, Smi::ZoneHandle(isolate, Smi::New(offset)));
+ }
+ }
+}
+
+
LocationSummary* IndirectEntryInstr::MakeLocationSummary(
Isolate* isolate, bool optimizing) const {
return JoinEntryInstr::MakeLocationSummary(isolate, optimizing);

Powered by Google App Engine
This is Rietveld 408576698