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

Unified Diff: src/parsing/preparsed-scope-data.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/preparsed-scope-data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5a553a9bcd94b3b906779e302691bf68f2d6abb3
--- /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"
+
+namespace v8 {
+namespace internal {
+
+class PreParsedScopeData {
+ public:
+ PreParsedScopeData() {}
+ ~PreParsedScopeData() {}
+
+ 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 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_ = nullptr;
+
+ DISALLOW_COPY_AND_ASSIGN(PreParsedScopeData);
+};
+
+} // namespace internal
+} // namespace v8
+
+#endif // V8_PARSING_PREPARSED_SCOPE_DATA_H_
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/preparsed-scope-data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698