Chromium Code Reviews| Index: runtime/vm/kernel_binary.cc |
| diff --git a/runtime/vm/kernel_binary.cc b/runtime/vm/kernel_binary.cc |
| index 25b88997b7b66707f4b639afc011446e627fdaa7..16b07d50beb91c02af3c87ab0f3c39ea5f9cda9b 100644 |
| --- a/runtime/vm/kernel_binary.cc |
| +++ b/runtime/vm/kernel_binary.cc |
| @@ -828,10 +828,12 @@ void StringTable::WriteTo(Writer* writer) { |
| } |
| -void LineStartingTable::ReadFrom(Reader* reader) { |
| +void LineStartingTableAndSource::ReadFrom(Reader* reader) { |
| size_ = reader->helper()->program()->source_uri_table().strings().length(); |
| - values_ = new intptr_t*[size_]; |
| + source_code_ = new String*[size_]; |
| + line_starts_ = new intptr_t*[size_]; |
| for (intptr_t i = 0; i < size_; ++i) { |
| + source_code_[i] = StringImpl::ReadFrom(reader); |
| intptr_t line_count = reader->ReadUInt(); |
| intptr_t* line_starts = new intptr_t[line_count + 1]; |
|
Kevin Millikin (Google)
2016/12/20 12:03:33
I think we should define a simple class that conta
jensj
2016/12/20 13:30:23
I've done another change instead. Hopefully that'l
|
| line_starts[0] = line_count; |
| @@ -841,14 +843,15 @@ void LineStartingTable::ReadFrom(Reader* reader) { |
| line_starts[j + 1] = line_start; |
| previous_line_start = line_start; |
| } |
| - values_[i] = line_starts; |
| + line_starts_[i] = line_starts; |
| } |
| } |
| -void LineStartingTable::WriteTo(Writer* writer) { |
| +void LineStartingTableAndSource::WriteTo(Writer* writer) { |
| for (intptr_t i = 0; i < size_; ++i) { |
| - intptr_t* line_starts = values_[i]; |
| + StringImpl::WriteTo(writer, source_code_[i]); |
| + intptr_t* line_starts = line_starts_[i]; |
| intptr_t line_count = line_starts[0]; |
| writer->WriteUInt(line_count); |
| @@ -2828,7 +2831,7 @@ Program* Program::ReadFrom(Reader* reader) { |
| program->string_table_.ReadFrom(reader); |
| program->source_uri_table_.ReadFrom(reader); |
| - program->line_starting_table_.ReadFrom(reader); |
| + program->line_starting_table_and_source_.ReadFrom(reader); |
| int libraries = reader->ReadUInt(); |
| program->libraries().EnsureInitialized(libraries); |
| @@ -2853,7 +2856,7 @@ void Program::WriteTo(Writer* writer) { |
| // strings in nodes are present in [string_table_]. |
| string_table_.WriteTo(writer); |
| source_uri_table_.WriteTo(writer); |
| - line_starting_table_.WriteTo(writer); |
| + line_starting_table_and_source_.WriteTo(writer); |
| libraries_.WriteTo(writer); |
| Reference::WriteMemberTo(writer, main_method_); |