Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 #ifndef V8_PARSING_PREPARSED_SCOPE_DATA_H_ | |
| 6 #define V8_PARSING_PREPARSED_SCOPE_DATA_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "src/globals.h" | |
| 11 | |
| 12 namespace v8 { | |
| 13 namespace internal { | |
| 14 | |
| 15 class PreParsedScopeData { | |
| 16 public: | |
| 17 PreParsedScopeData() : current_scope_data_(nullptr) {} | |
| 18 | |
| 19 class ScopeData { | |
|
vogelheim
2017/01/25 10:00:18
troll nitpick: V8 style calls objects that open+fi
vogelheim
2017/01/25 10:00:18
maybe: Have a PreParsedScopeData::AddScope(ScopeTy
marja
2017/01/25 10:21:26
Used this opportunity to rename it to ScopeScope w
marja
2017/01/25 10:21:26
Acknowledged.
Offline discussion: Won't do anythi
| |
| 20 public: | |
| 21 ScopeData(PreParsedScopeData* data, ScopeType scope_type, | |
| 22 int start_position, int end_position); | |
| 23 ~ScopeData(); | |
| 24 | |
| 25 // TODO(marja): The functions for adding information about local variables | |
| 26 // will appar here. | |
|
vogelheim
2017/01/25 10:00:18
nitpick: appar -> appear.
marja
2017/01/25 10:21:26
Done.
| |
| 27 | |
| 28 private: | |
| 29 PreParsedScopeData* data_; | |
| 30 size_t index_in_data_; | |
| 31 ScopeData* previous_scope_; | |
| 32 | |
| 33 int inner_scope_count_; | |
| 34 int variable_count_; | |
| 35 DISALLOW_COPY_AND_ASSIGN(ScopeData); | |
| 36 }; | |
| 37 | |
| 38 private: | |
| 39 friend class ScopeData; | |
| 40 friend class ScopeTestHelper; | |
| 41 | |
| 42 // TODO(marja): Make the backing store more efficient once we know exactly | |
| 43 // what data is needed. | |
| 44 std::vector<int> backing_store_; | |
| 45 ScopeData* current_scope_data_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(PreParsedScopeData); | |
| 48 }; | |
| 49 | |
| 50 } // namespace internal | |
| 51 } // namespace v8 | |
| 52 | |
| 53 #endif // PREPARSED_SCOPE_DATA_H_ | |
|
vogelheim
2017/01/25 10:00:18
nitpick: // V8_PARSING_PREPARSED_SCOPE_DATA_H_
marja
2017/01/25 10:21:26
Done.
| |
| OLD | NEW |