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

Unified Diff: src/compiler/source-position.h

Issue 1109763002: [turbofan] Treat uninitialized source positions as unknown. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « src/compiler/pipeline.cc ('k') | src/compiler/source-position.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/source-position.h
diff --git a/src/compiler/source-position.h b/src/compiler/source-position.h
index 3033f74d173256d668dbdd351b460b932067de8d..81db1d2e3eff4f97d0f93e484b83d321b8115259 100644
--- a/src/compiler/source-position.h
+++ b/src/compiler/source-position.h
@@ -20,16 +20,12 @@ class SourcePosition final {
static SourcePosition Unknown() { return SourcePosition(kUnknownPosition); }
bool IsUnknown() const { return raw() == kUnknownPosition; }
-
- static SourcePosition Invalid() { return SourcePosition(kInvalidPosition); }
- bool IsInvalid() const { return raw() == kInvalidPosition; }
+ bool IsKnown() const { return raw() != kUnknownPosition; }
int raw() const { return raw_; }
private:
- static const int kInvalidPosition = -2;
static const int kUnknownPosition = RelocInfo::kNoPosition;
- STATIC_ASSERT(kInvalidPosition != kUnknownPosition);
int raw_;
};
@@ -61,9 +57,7 @@ class SourcePositionTable final {
private:
void Init(SourcePosition position) {
- if (!position.IsUnknown() || prev_position_.IsInvalid()) {
- source_positions_->current_position_ = position;
- }
+ if (position.IsKnown()) source_positions_->current_position_ = position;
}
SourcePositionTable* const source_positions_;
« no previous file with comments | « src/compiler/pipeline.cc ('k') | src/compiler/source-position.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698