Chromium Code Reviews| Index: src/parsing/preparsed-scope-data.h |
| diff --git a/src/parsing/preparsed-scope-data.h b/src/parsing/preparsed-scope-data.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fb41f37e761d8da2dc6ead4761b916ab9796fe8b |
| --- /dev/null |
| +++ b/src/parsing/preparsed-scope-data.h |
| @@ -0,0 +1,53 @@ |
| +// Copyright 2017 the V8 project authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef V8_PARSING_PREPARSED_SCOPE_DATA_H_ |
| +#define V8_PARSING_PREPARSED_SCOPE_DATA_H_ |
| + |
| +#include <vector> |
| + |
| +#include "src/globals.h" |
|
jochen (gone - plz use gerrit)
2017/01/25 11:16:01
for DISALLOW_COPY_AND_ASSIGN, you only need src/ba
marja
2017/01/25 11:50:29
For ScopeType I need globals.h.
|
| + |
| +namespace v8 { |
| +namespace internal { |
| + |
| +class PreParsedScopeData { |
| + public: |
| + PreParsedScopeData() : current_scope_(nullptr) {} |
|
jochen (gone - plz use gerrit)
2017/01/25 11:16:01
nit. don't inline non-trivial ctors, and add a dto
marja
2017/01/25 11:50:29
Confused about this comment (in the context of one
|
| + |
| + class ScopeScope { |
| + public: |
| + ScopeScope(PreParsedScopeData* data, ScopeType scope_type, |
| + int start_position, int end_position); |
| + ~ScopeScope(); |
| + |
| + // TODO(marja): The functions for adding information about local variables |
| + // will appear here. |
| + |
| + private: |
| + PreParsedScopeData* data_; |
| + size_t index_in_data_; |
| + ScopeScope* previous_scope_; |
| + |
| + int inner_scope_count_; |
| + int variable_count_; |
| + DISALLOW_COPY_AND_ASSIGN(ScopeScope); |
| + }; |
| + |
| + private: |
| + friend class ScopeScope; |
|
jochen (gone - plz use gerrit)
2017/01/25 11:16:01
nit, you don't need to friend inner classes
marja
2017/01/25 11:50:29
Done.
|
| + friend class ScopeTestHelper; |
| + |
| + // TODO(marja): Make the backing store more efficient once we know exactly |
| + // what data is needed. |
| + std::vector<int> backing_store_; |
| + ScopeScope* current_scope_; |
|
jochen (gone - plz use gerrit)
2017/01/25 11:16:01
you can just declare this as ScopeScope* current_s
marja
2017/01/25 11:50:28
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(PreParsedScopeData); |
| +}; |
| + |
| +} // namespace internal |
| +} // namespace v8 |
| + |
| +#endif // V8_PARSING_PREPARSED_SCOPE_DATA_H_ |