5 #include "src/unoptimized-compilation-info.h" 7 #include "src/ast/ast.h" 8 #include "src/ast/scopes.h" 9 #include "src/debug/debug.h" 10 #include "src/isolate.h" 11 #include "src/objects-inl.h" 12 #include "src/parsing/parse-info.h" 13 #include "src/source-position.h" 18 UnoptimizedCompilationInfo::UnoptimizedCompilationInfo(Zone* zone,
19 ParseInfo* parse_info,
20 FunctionLiteral* literal)
21 : flags_(FLAG_untrusted_code_mitigations ? kUntrustedCodeMitigations : 0),
23 feedback_vector_spec_(zone) {
30 DCHECK_NOT_NULL(literal);
32 source_range_map_ = parse_info->source_range_map();
34 if (parse_info->is_eval()) MarkAsEval();
35 if (parse_info->is_native()) MarkAsNative();
36 if (parse_info->collect_type_profile()) MarkAsCollectTypeProfile();
39 DeclarationScope* UnoptimizedCompilationInfo::scope()
const {
40 DCHECK_NOT_NULL(literal_);
41 return literal_->scope();
44 int UnoptimizedCompilationInfo::num_parameters()
const {
45 return scope()->num_parameters();
48 int UnoptimizedCompilationInfo::num_parameters_including_this()
const {
49 return scope()->num_parameters() + 1;
52 SourcePositionTableBuilder::RecordingMode
53 UnoptimizedCompilationInfo::SourcePositionRecordingMode()
const {
54 return is_native() ? SourcePositionTableBuilder::OMIT_SOURCE_POSITIONS
55 : SourcePositionTableBuilder::RECORD_SOURCE_POSITIONS;