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

Unified Diff: runtime/vm/kernel_binary.cc

Issue 2750013002: [kernel] Debugging of switch statement (Closed)
Patch Set: Take #2: Update switch case to include list of positions Created 3 years, 9 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
Index: runtime/vm/kernel_binary.cc
diff --git a/runtime/vm/kernel_binary.cc b/runtime/vm/kernel_binary.cc
index a7f85598be4769c585137f54119ff12d14d70789..ff5c3d6eb6ee64f8a40e9e8d46b84fcb9b43d544 100644
--- a/runtime/vm/kernel_binary.cc
+++ b/runtime/vm/kernel_binary.cc
@@ -1595,6 +1595,13 @@ SwitchStatement* SwitchStatement::ReadFrom(Reader* reader) {
SwitchCase* SwitchCase::ReadFrom(Reader* reader) {
TRACE_READ_OFFSET();
expressions_.ReadFromStatic<Expression>(reader);
+ // List of expression offsets of same length as expressions_: This serves as
Kevin Millikin (Google) 2017/03/20 12:29:47 I think it's obvious that it serves as the positio
jensj 2017/03/21 10:06:19 Comment removed.
+ // positions of the expressions, especially useful if the expressions
+ // doesn't have a position (e.g. int literal).
+ int length = reader->ReadListLength();
+ for (intptr_t i = 0; i < length; ++i) {
+ expressions_[i]->set_position(reader->ReadPosition());
+ }
is_default_ = reader->ReadBool();
body_ = Statement::ReadFrom(reader);
return this;

Powered by Google App Engine
This is Rietveld 408576698