OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/parsing/parse-info.h" | 5 #include "src/parsing/parse-info.h" |
6 | 6 |
7 #include "src/ast/ast-value-factory.h" | 7 #include "src/ast/ast-value-factory.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 ast_value_factory_ = nullptr; | 82 ast_value_factory_ = nullptr; |
83 } | 83 } |
84 | 84 |
85 DeclarationScope* ParseInfo::scope() const { return literal()->scope(); } | 85 DeclarationScope* ParseInfo::scope() const { return literal()->scope(); } |
86 | 86 |
87 bool ParseInfo::is_declaration() const { | 87 bool ParseInfo::is_declaration() const { |
88 return (compiler_hints_ & (1 << SharedFunctionInfo::kIsDeclaration)) != 0; | 88 return (compiler_hints_ & (1 << SharedFunctionInfo::kIsDeclaration)) != 0; |
89 } | 89 } |
90 | 90 |
91 bool ParseInfo::is_arrow() const { | |
92 return (compiler_hints_ & (1 << SharedFunctionInfo::kIsArrow)) != 0; | |
93 } | |
94 | |
95 bool ParseInfo::is_async() const { | |
96 return (compiler_hints_ & (1 << SharedFunctionInfo::kIsAsyncFunction)) != 0; | |
97 } | |
98 | |
99 bool ParseInfo::is_default_constructor() const { | |
100 return (compiler_hints_ & (1 << SharedFunctionInfo::kIsDefaultConstructor)) != | |
101 0; | |
102 } | |
103 | |
104 bool ParseInfo::requires_class_field_init() const { | 91 bool ParseInfo::requires_class_field_init() const { |
105 return (compiler_hints_ & | 92 return (compiler_hints_ & |
106 (1 << SharedFunctionInfo::kRequiresClassFieldInit)) != 0; | 93 (1 << SharedFunctionInfo::kRequiresClassFieldInit)) != 0; |
107 } | 94 } |
108 bool ParseInfo::is_class_field_initializer() const { | 95 bool ParseInfo::is_class_field_initializer() const { |
109 return (compiler_hints_ & | 96 return (compiler_hints_ & |
110 (1 << SharedFunctionInfo::kIsClassFieldInitializer)) != 0; | 97 (1 << SharedFunctionInfo::kIsClassFieldInitializer)) != 0; |
111 } | 98 } |
112 | 99 |
113 FunctionKind ParseInfo::function_kind() const { | 100 FunctionKind ParseInfo::function_kind() const { |
114 return SharedFunctionInfo::FunctionKindBits::decode(compiler_hints_); | 101 return SharedFunctionInfo::FunctionKindBits::decode(compiler_hints_); |
115 } | 102 } |
116 | 103 |
117 #ifdef DEBUG | 104 #ifdef DEBUG |
118 bool ParseInfo::script_is_native() const { | 105 bool ParseInfo::script_is_native() const { |
119 return script_->type() == Script::TYPE_NATIVE; | 106 return script_->type() == Script::TYPE_NATIVE; |
120 } | 107 } |
121 #endif // DEBUG | 108 #endif // DEBUG |
122 | 109 |
123 } // namespace internal | 110 } // namespace internal |
124 } // namespace v8 | 111 } // namespace v8 |
OLD | NEW |