Chromium Code Reviews| Index: src/interpreter/source-position-table.h |
| diff --git a/src/interpreter/source-position-table.h b/src/interpreter/source-position-table.h |
| index 9a80ead570eedfc02d9af7a6b56b064f80bb2d4e..6d381856ec6f6d811a62514f3ba27a33632d63c6 100644 |
| --- a/src/interpreter/source-position-table.h |
| +++ b/src/interpreter/source-position-table.h |
| @@ -42,21 +42,33 @@ class SourcePositionTableBuilder : public PositionsRecorder { |
| #ifdef ENABLE_SLOW_DCHECKS |
| raw_entries_(zone), |
| #endif |
| - previous_() { |
| + candidate_(kUninitializedCandidateOffset, 0, false) { |
| } |
| - void AddStatementPosition(size_t bytecode_offset, int source_position); |
| + enum OnDuplicateCodeOffset { |
|
vogelheim
2016/03/14 10:41:15
style nitpick: c++ style wants an enum declaration
Yang
2016/03/14 11:32:34
Done.
|
| + DISCARD_DUPLICATE, |
| + OVERWRITE_DUPLICATE, |
| + }; |
| + |
| + void AddStatementPosition( |
| + size_t bytecode_offset, int source_position, |
| + OnDuplicateCodeOffset on_duplicate = DISCARD_DUPLICATE); |
| void AddExpressionPosition(size_t bytecode_offset, int source_position); |
| Handle<ByteArray> ToSourcePositionTable(); |
| private: |
| - void AddEntry(const PositionTableEntry& entry); |
| + void AddEntry(const PositionTableEntry& entry, |
| + OnDuplicateCodeOffset on_duplicate = DISCARD_DUPLICATE); |
| + void CommitEntry(); |
| + |
| + static const int kUninitializedCandidateOffset = -1; |
|
vogelheim
2016/03/14 10:41:15
Also style nitpick: consts also go before methods.
Yang
2016/03/14 11:32:34
Done.
|
| Isolate* isolate_; |
| ZoneVector<byte> bytes_; |
| #ifdef ENABLE_SLOW_DCHECKS |
| ZoneVector<PositionTableEntry> raw_entries_; |
| #endif |
| + PositionTableEntry candidate_; |
|
vogelheim
2016/03/14 10:41:15
Maybe add mini-comments on what these do, e.g.:
.
Yang
2016/03/14 11:32:34
Done.
|
| PositionTableEntry previous_; |
| }; |