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

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

Issue 2657943003: [parser] Skipping inner funcs: add variable names into the data for test purposes. (Closed)
Patch Set: code review (vogelheim@) 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/ast/scopes.cc ('k') | src/parsing/preparsed-scope-data.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef V8_PARSING_PREPARSED_SCOPE_DATA_H_ 5 #ifndef V8_PARSING_PREPARSED_SCOPE_DATA_H_
6 #define V8_PARSING_PREPARSED_SCOPE_DATA_H_ 6 #define V8_PARSING_PREPARSED_SCOPE_DATA_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "src/globals.h" 10 #include "src/globals.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 14
15 class PreParsedScopeData { 15 class PreParsedScopeData {
16 public: 16 public:
17 PreParsedScopeData() {} 17 PreParsedScopeData() {}
18 ~PreParsedScopeData() {} 18 ~PreParsedScopeData() {}
19 19
20 class ScopeScope { 20 class ScopeScope {
21 public: 21 public:
22 ScopeScope(PreParsedScopeData* data, ScopeType scope_type, 22 ScopeScope(PreParsedScopeData* data, ScopeType scope_type,
23 int start_position, int end_position); 23 int start_position, int end_position);
24 ~ScopeScope(); 24 ~ScopeScope();
25 25
26 void AddVariable(VariableLocation location, bool maybe_assigned); 26 void MaybeAddVariable(Variable* var);
27 27
28 private: 28 private:
29 PreParsedScopeData* data_; 29 PreParsedScopeData* data_;
30 size_t index_in_data_; 30 size_t index_in_data_;
31 ScopeScope* previous_scope_; 31 ScopeScope* previous_scope_;
32 32
33 int inner_scope_count_; 33 int inner_scope_count_;
34 int variable_count_; 34 int variable_count_;
35 DISALLOW_COPY_AND_ASSIGN(ScopeScope); 35 DISALLOW_COPY_AND_ASSIGN(ScopeScope);
36 }; 36 };
37 37
38 private: 38 private:
39 friend class ScopeTestHelper; 39 friend class ScopeTestHelper;
40 40
41 // TODO(marja): Make the backing store more efficient once we know exactly 41 // TODO(marja): Make the backing store more efficient once we know exactly
42 // what data is needed. 42 // what data is needed.
43 std::vector<int> backing_store_; 43 std::vector<int> backing_store_;
44 ScopeScope* current_scope_ = nullptr; 44 ScopeScope* current_scope_ = nullptr;
45 45
46 DISALLOW_COPY_AND_ASSIGN(PreParsedScopeData); 46 DISALLOW_COPY_AND_ASSIGN(PreParsedScopeData);
47 }; 47 };
48 48
49 } // namespace internal 49 } // namespace internal
50 } // namespace v8 50 } // namespace v8
51 51
52 #endif // V8_PARSING_PREPARSED_SCOPE_DATA_H_ 52 #endif // V8_PARSING_PREPARSED_SCOPE_DATA_H_
OLDNEW
« no previous file with comments | « src/ast/scopes.cc ('k') | src/parsing/preparsed-scope-data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698