Chromium Code Reviews| Index: runtime/vm/kernel.h |
| diff --git a/runtime/vm/kernel.h b/runtime/vm/kernel.h |
| index 15bf6336b7c147bc6f0a3c9b3f51dee1de7d77df..16631b5aa05492f3e023076a92181f0b391cc5ee 100644 |
| --- a/runtime/vm/kernel.h |
| +++ b/runtime/vm/kernel.h |
| @@ -311,29 +311,34 @@ class StringTable { |
| }; |
| -class LineStartingTable { |
| +class LineStartingTableAndSource { |
|
Kevin Millikin (Google)
2016/12/20 12:03:33
I'd just go with a name like SourceTable for this.
jensj
2016/12/20 13:30:23
Done.
|
| public: |
| void ReadFrom(Reader* reader); |
| void WriteTo(Writer* writer); |
| - ~LineStartingTable() { |
| + ~LineStartingTableAndSource() { |
| for (intptr_t i = 0; i < size_; ++i) { |
| - delete[] values_[i]; |
| + delete source_code_[i]; |
| + delete[] line_starts_[i]; |
| } |
| - delete[] values_; |
| + delete[] source_code_; |
| + delete[] line_starts_; |
| } |
| intptr_t size() { return size_; } |
| - intptr_t* valuesFor(int i) { return values_[i]; } |
| + String*& source_code_for(int i) { return source_code_[i]; } |
|
Kevin Millikin (Google)
2016/12/20 12:03:33
SourceFor(intptr_t i).
Dart VM style is to use in
jensj
2016/12/20 13:30:23
Done.
I think I added the '&' because I saw Growab
|
| + intptr_t* line_starts_for(int i) { return line_starts_[i]; } |
|
Kevin Millikin (Google)
2016/12/20 12:03:33
LineStartsFor(intptr_t i).
jensj
2016/12/20 13:30:23
Done.
|
| private: |
| - LineStartingTable() : values_(NULL), size_(0) {} |
| + LineStartingTableAndSource() |
| + : source_code_(NULL), line_starts_(NULL), size_(0) {} |
| friend class Program; |
| - intptr_t** values_; |
| + String** source_code_; |
| + intptr_t** line_starts_; |
| intptr_t size_; |
| - DISALLOW_COPY_AND_ASSIGN(LineStartingTable); |
| + DISALLOW_COPY_AND_ASSIGN(LineStartingTableAndSource); |
| }; |
| // Forward declare all classes. |
| @@ -2798,7 +2803,9 @@ class Program : public TreeNode { |
| StringTable& string_table() { return string_table_; } |
| StringTable& source_uri_table() { return source_uri_table_; } |
| - LineStartingTable& line_starting_table() { return line_starting_table_; } |
| + LineStartingTableAndSource& line_starting_table_and_source() { |
| + return line_starting_table_and_source_; |
| + } |
| List<Library>& libraries() { return libraries_; } |
| Procedure* main_method() { return main_method_; } |
| @@ -2809,7 +2816,7 @@ class Program : public TreeNode { |
| Ref<Procedure> main_method_; |
| StringTable string_table_; |
| StringTable source_uri_table_; |
| - LineStartingTable line_starting_table_; |
| + LineStartingTableAndSource line_starting_table_and_source_; |
| DISALLOW_COPY_AND_ASSIGN(Program); |
| }; |