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

Unified Diff: src/ast/ast.h

Issue 2445993002: Drop unused end-position from VariableProxy (Closed)
Patch Set: Addressed comment Created 4 years, 2 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 | « no previous file | src/ast/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index 28004058f231dc30c93a7f26e9d1a2cf78dac17a..81a98b641d74498d8a7c554b451a2a1c5f48325e 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -1679,8 +1679,6 @@ class VariableProxy final : public Expression {
HoleCheckModeField::update(bit_field_, HoleCheckMode::kRequired);
}
- int end_position() const { return end_position_; }
-
// Bind this proxy to the variable var.
void BindTo(Variable* var);
@@ -1701,9 +1699,9 @@ class VariableProxy final : public Expression {
private:
friend class AstNodeFactory;
- VariableProxy(Variable* var, int start_position, int end_position);
+ VariableProxy(Variable* var, int start_position);
VariableProxy(const AstRawString* name, VariableKind variable_kind,
- int start_position, int end_position);
+ int start_position);
explicit VariableProxy(const VariableProxy* copy_from);
static int parent_num_ids() { return Expression::num_ids(); }
@@ -1717,10 +1715,6 @@ class VariableProxy final : public Expression {
class HoleCheckModeField
: public BitField<HoleCheckMode, IsNewTargetField::kNext, 1> {};
- // Position is stored in the AstNode superclass, but VariableProxy needs to
- // know its end position too (for error messages). It cannot be inferred from
- // the variable name length because it can contain escapes.
- int end_position_;
FeedbackVectorSlot variable_feedback_slot_;
union {
const AstRawString* raw_name_; // if !is_resolved_
@@ -3341,18 +3335,15 @@ class AstNodeFactory final BASE_EMBEDDED {
}
VariableProxy* NewVariableProxy(Variable* var,
- int start_position = kNoSourcePosition,
- int end_position = kNoSourcePosition) {
- return new (zone_) VariableProxy(var, start_position, end_position);
+ int start_position = kNoSourcePosition) {
+ return new (zone_) VariableProxy(var, start_position);
}
VariableProxy* NewVariableProxy(const AstRawString* name,
VariableKind variable_kind,
- int start_position = kNoSourcePosition,
- int end_position = kNoSourcePosition) {
+ int start_position = kNoSourcePosition) {
DCHECK_NOT_NULL(name);
- return new (zone_)
- VariableProxy(name, variable_kind, start_position, end_position);
+ return new (zone_) VariableProxy(name, variable_kind, start_position);
}
// Recreates the VariableProxy in this Zone.
« no previous file with comments | « no previous file | src/ast/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698