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

Side by Side Diff: src/parsing/preparsed-scope-data.cc

Issue 2650703003: [parser]: Skipping inner funcs / initial implemetation of storing scope analysis data from preparse… (Closed)
Patch Set: rebased - argh, forced to format build.gn Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/parsing/preparsed-scope-data.h ('k') | src/v8.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "src/parsing/preparsed-scope-data.h"
6
7 namespace v8 {
8 namespace internal {
9
10 PreParsedScopeData::ScopeScope::ScopeScope(PreParsedScopeData* data,
11 ScopeType scope_type,
12 int start_position, int end_position)
13 : data_(data),
14 previous_scope_(data->current_scope_),
15 inner_scope_count_(0),
16 variable_count_(0) {
17 data->current_scope_ = this;
18 if (previous_scope_ != nullptr) {
19 ++previous_scope_->inner_scope_count_;
20 }
21
22 data->backing_store_.push_back(scope_type);
23 data->backing_store_.push_back(start_position);
24 data->backing_store_.push_back(end_position);
25 // Reserve space for variable and inner scope count (we don't know yet how
26 // many will be added).
27 index_in_data_ = data->backing_store_.size();
28 data->backing_store_.push_back(-1);
29 data->backing_store_.push_back(-1);
30 }
31
32 PreParsedScopeData::ScopeScope::~ScopeScope() {
33 data_->current_scope_ = previous_scope_;
34 data_->backing_store_[index_in_data_] = inner_scope_count_;
35 data_->backing_store_[index_in_data_ + 1] = variable_count_;
36 }
37
38 } // namespace internal
39 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/preparsed-scope-data.h ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698