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

Unified Diff: src/parsing/parser.cc

Issue 2268513002: Cleanup: Move ParseInfo to a separate file. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index 7b082338a713f0b344597e98f833fdc12a627fe2..565a361eff5077582ab398facf171d5c7ae0be8c 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -7,19 +7,16 @@
#include <memory>
#include "src/api.h"
-#include "src/ast/ast.h"
#include "src/ast/ast-expression-rewriter.h"
#include "src/ast/ast-literal-reindexer.h"
#include "src/ast/ast-traversal-visitor.h"
+#include "src/ast/ast.h"
#include "src/bailout-reason.h"
#include "src/base/platform/platform.h"
-#include "src/bootstrapper.h"
#include "src/char-predicates-inl.h"
-#include "src/codegen.h"
-#include "src/compiler.h"
#include "src/messages.h"
#include "src/parsing/parameter-initializer-rewriter.h"
-#include "src/parsing/parser-base.h"
+#include "src/parsing/parse-info.h"
#include "src/parsing/rewriter.h"
#include "src/parsing/scanner-character-streams.h"
#include "src/runtime/runtime.h"
@@ -40,91 +37,6 @@ ScriptData::ScriptData(const byte* data, int length)
}
}
-ParseInfo::ParseInfo(Zone* zone)
- : zone_(zone),
- flags_(0),
- source_stream_(nullptr),
- source_stream_encoding_(ScriptCompiler::StreamedSource::ONE_BYTE),
- character_stream_(nullptr),
- extension_(nullptr),
- compile_options_(ScriptCompiler::kNoCompileOptions),
- script_scope_(nullptr),
- unicode_cache_(nullptr),
- stack_limit_(0),
- hash_seed_(0),
- compiler_hints_(0),
- start_position_(0),
- end_position_(0),
- isolate_(nullptr),
- cached_data_(nullptr),
- ast_value_factory_(nullptr),
- function_name_(nullptr),
- literal_(nullptr) {}
-
-ParseInfo::ParseInfo(Zone* zone, Handle<JSFunction> function)
- : ParseInfo(zone, Handle<SharedFunctionInfo>(function->shared())) {
- set_context(Handle<Context>(function->context()));
-}
-
-
-ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared)
- : ParseInfo(zone) {
- isolate_ = shared->GetIsolate();
-
- set_lazy();
- set_hash_seed(isolate_->heap()->HashSeed());
- set_is_named_expression(shared->is_named_expression());
- set_calls_eval(shared->scope_info()->CallsEval());
- set_compiler_hints(shared->compiler_hints());
- set_start_position(shared->start_position());
- set_end_position(shared->end_position());
- set_stack_limit(isolate_->stack_guard()->real_climit());
- set_unicode_cache(isolate_->unicode_cache());
- set_language_mode(shared->language_mode());
- set_shared_info(shared);
-
- Handle<Script> script(Script::cast(shared->script()));
- set_script(script);
- if (!script.is_null() && script->type() == Script::TYPE_NATIVE) {
- set_native();
- }
-}
-
-
-ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) {
- isolate_ = script->GetIsolate();
-
- set_hash_seed(isolate_->heap()->HashSeed());
- set_stack_limit(isolate_->stack_guard()->real_climit());
- set_unicode_cache(isolate_->unicode_cache());
- set_script(script);
-
- if (script->type() == Script::TYPE_NATIVE) {
- set_native();
- }
-}
-
-bool ParseInfo::is_declaration() const {
- return (compiler_hints_ & (1 << SharedFunctionInfo::kIsDeclaration)) != 0;
-}
-
-bool ParseInfo::is_arrow() const {
- return (compiler_hints_ & (1 << SharedFunctionInfo::kIsArrow)) != 0;
-}
-
-bool ParseInfo::is_async() const {
- return (compiler_hints_ & (1 << SharedFunctionInfo::kIsAsyncFunction)) != 0;
-}
-
-bool ParseInfo::is_default_constructor() const {
- return (compiler_hints_ & (1 << SharedFunctionInfo::kIsDefaultConstructor)) !=
- 0;
-}
-
-FunctionKind ParseInfo::function_kind() const {
- return SharedFunctionInfo::FunctionKindBits::decode(compiler_hints_);
-}
-
FunctionEntry ParseData::GetFunctionEntry(int start) {
// The current pre-data entry must be a FunctionEntry with the given
// start position.
« src/parsing/parse-info.cc ('K') | « src/parsing/parser.h ('k') | src/parsing/rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698