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

Unified Diff: src/ast/variables.h

Issue 2950993002: Make some functions that are hit during renderer startup available for inlining (Closed)
Patch Set: rebase Created 3 years, 6 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/ast/scopes.cc ('k') | src/ast/variables.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/variables.h
diff --git a/src/ast/variables.h b/src/ast/variables.h
index 786db2a07c202359cd836c1967b07ae9c99d78e6..09df57ad54e934dda38261a728254fb6f858d29a 100644
--- a/src/ast/variables.h
+++ b/src/ast/variables.h
@@ -20,7 +20,24 @@ class Variable final : public ZoneObject {
public:
Variable(Scope* scope, const AstRawString* name, VariableMode mode,
VariableKind kind, InitializationFlag initialization_flag,
- MaybeAssignedFlag maybe_assigned_flag = kNotAssigned);
+ MaybeAssignedFlag maybe_assigned_flag = kNotAssigned)
+ : scope_(scope),
+ name_(name),
+ local_if_not_shadowed_(nullptr),
+ next_(nullptr),
+ index_(-1),
+ initializer_position_(kNoSourcePosition),
+ bit_field_(MaybeAssignedFlagField::encode(maybe_assigned_flag) |
+ InitializationFlagField::encode(initialization_flag) |
+ VariableModeField::encode(mode) |
+ IsUsedField::encode(false) |
+ ForceContextAllocationField::encode(false) |
+ ForceHoleInitializationField::encode(false) |
+ LocationField::encode(VariableLocation::UNALLOCATED) |
+ VariableKindField::encode(kind)) {
+ // Var declared variables never need initialization.
+ DCHECK(!(mode == VAR && initialization_flag == kNeedsInitialization));
+ }
explicit Variable(Variable* other);
« no previous file with comments | « src/ast/scopes.cc ('k') | src/ast/variables.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698