OLD | NEW |
1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/parsing/preparsed-scope-data.h" | 5 #include "src/parsing/preparsed-scope-data.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 | 9 |
10 PreParsedScopeData::ScopeScope::ScopeScope(PreParsedScopeData* data, | 10 PreParsedScopeData::ScopeScope::ScopeScope(PreParsedScopeData* data, |
(...skipping 17 matching lines...) Expand all Loading... |
28 data->backing_store_.push_back(-1); | 28 data->backing_store_.push_back(-1); |
29 data->backing_store_.push_back(-1); | 29 data->backing_store_.push_back(-1); |
30 } | 30 } |
31 | 31 |
32 PreParsedScopeData::ScopeScope::~ScopeScope() { | 32 PreParsedScopeData::ScopeScope::~ScopeScope() { |
33 data_->current_scope_ = previous_scope_; | 33 data_->current_scope_ = previous_scope_; |
34 data_->backing_store_[index_in_data_] = inner_scope_count_; | 34 data_->backing_store_[index_in_data_] = inner_scope_count_; |
35 data_->backing_store_[index_in_data_ + 1] = variable_count_; | 35 data_->backing_store_[index_in_data_ + 1] = variable_count_; |
36 } | 36 } |
37 | 37 |
| 38 void PreParsedScopeData::ScopeScope::AddVariable(VariableLocation location, |
| 39 bool maybe_assigned) { |
| 40 data_->backing_store_.push_back(location); |
| 41 data_->backing_store_.push_back(maybe_assigned); |
| 42 ++variable_count_; |
| 43 } |
| 44 |
38 } // namespace internal | 45 } // namespace internal |
39 } // namespace v8 | 46 } // namespace v8 |
OLD | NEW |