Chromium Code Reviews| Index: src/parsing/preparsed-scope-data.cc |
| diff --git a/src/parsing/preparsed-scope-data.cc b/src/parsing/preparsed-scope-data.cc |
| index 50a4e0b63c491090c3ca88e71d3c73dc4a75628d..9e7429d989c76aadde10db7aca53cd58bf53eb1c 100644 |
| --- a/src/parsing/preparsed-scope-data.cc |
| +++ b/src/parsing/preparsed-scope-data.cc |
| @@ -4,6 +4,9 @@ |
| #include "src/parsing/preparsed-scope-data.h" |
| +#include "src/ast/variables.h" |
| +#include "src/objects-inl.h" |
|
marja
2017/01/26 11:59:18
This is needed because by including variables.h, t
vogelheim
2017/01/26 12:14:07
Acknowledged.
|
| + |
| namespace v8 { |
| namespace internal { |
| @@ -35,11 +38,20 @@ PreParsedScopeData::ScopeScope::~ScopeScope() { |
| data_->backing_store_[index_in_data_ + 1] = variable_count_; |
| } |
| -void PreParsedScopeData::ScopeScope::AddVariable(VariableLocation location, |
| - bool maybe_assigned) { |
| - data_->backing_store_.push_back(location); |
| - data_->backing_store_.push_back(maybe_assigned); |
| - ++variable_count_; |
| +void PreParsedScopeData::ScopeScope::AddVariable(Variable* var) { |
|
vogelheim
2017/01/26 12:14:07
This is really MaybeAddVariable now. Or maybe some
marja
2017/01/26 12:22:21
Changed to MaybeAddVariable; not super fond of the
|
| + if (var->mode() == VAR || var->mode() == LET || var->mode() == CONST) { |
| +#ifdef DEBUG |
| + // For tests (which check that the data is about the same variables). |
| + const AstRawString* name = var->raw_name(); |
| + data_->backing_store_.push_back(name->length()); |
| + for (int i = 0; i < name->length(); ++i) { |
| + data_->backing_store_.push_back(name->raw_data()[i]); |
|
vogelheim
2017/01/26 12:14:07
fyi: I plan on abolishing AstRawString::raw_data..
marja
2017/01/26 12:22:21
That's cool, I suppose you'll still have at least
|
| + } |
| +#endif |
| + data_->backing_store_.push_back(var->location()); |
| + data_->backing_store_.push_back(var->maybe_assigned()); |
| + ++variable_count_; |
| + } |
| } |
| } // namespace internal |