OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 7084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7095 // [compilation_type]: how the the script was compiled. Encoded in the | 7095 // [compilation_type]: how the the script was compiled. Encoded in the |
7096 // 'flags' field. | 7096 // 'flags' field. |
7097 inline CompilationType compilation_type(); | 7097 inline CompilationType compilation_type(); |
7098 inline void set_compilation_type(CompilationType type); | 7098 inline void set_compilation_type(CompilationType type); |
7099 | 7099 |
7100 // [compilation_state]: determines whether the script has already been | 7100 // [compilation_state]: determines whether the script has already been |
7101 // compiled. Encoded in the 'flags' field. | 7101 // compiled. Encoded in the 'flags' field. |
7102 inline CompilationState compilation_state(); | 7102 inline CompilationState compilation_state(); |
7103 inline void set_compilation_state(CompilationState state); | 7103 inline void set_compilation_state(CompilationState state); |
7104 | 7104 |
| 7105 // [hide_source]: determines whether the script source can be exposed as |
| 7106 // function source. Encoded in the 'flags' field. |
| 7107 inline bool hide_source(); |
| 7108 inline void set_hide_source(bool value); |
| 7109 |
7105 // [origin_options]: optional attributes set by the embedder via ScriptOrigin, | 7110 // [origin_options]: optional attributes set by the embedder via ScriptOrigin, |
7106 // and used by the embedder to make decisions about the script. V8 just passes | 7111 // and used by the embedder to make decisions about the script. V8 just passes |
7107 // this through. Encoded in the 'flags' field. | 7112 // this through. Encoded in the 'flags' field. |
7108 inline v8::ScriptOriginOptions origin_options(); | 7113 inline v8::ScriptOriginOptions origin_options(); |
7109 inline void set_origin_options(ScriptOriginOptions origin_options); | 7114 inline void set_origin_options(ScriptOriginOptions origin_options); |
7110 | 7115 |
7111 DECLARE_CAST(Script) | 7116 DECLARE_CAST(Script) |
7112 | 7117 |
7113 // If script source is an external string, check that the underlying | 7118 // If script source is an external string, check that the underlying |
7114 // resource is accessible. Otherwise, always return true. | 7119 // resource is accessible. Otherwise, always return true. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7195 kEvalFromPositionOffset + kPointerSize; | 7200 kEvalFromPositionOffset + kPointerSize; |
7196 static const int kFlagsOffset = kSharedFunctionInfosOffset + kPointerSize; | 7201 static const int kFlagsOffset = kSharedFunctionInfosOffset + kPointerSize; |
7197 static const int kSourceUrlOffset = kFlagsOffset + kPointerSize; | 7202 static const int kSourceUrlOffset = kFlagsOffset + kPointerSize; |
7198 static const int kSourceMappingUrlOffset = kSourceUrlOffset + kPointerSize; | 7203 static const int kSourceMappingUrlOffset = kSourceUrlOffset + kPointerSize; |
7199 static const int kSize = kSourceMappingUrlOffset + kPointerSize; | 7204 static const int kSize = kSourceMappingUrlOffset + kPointerSize; |
7200 | 7205 |
7201 private: | 7206 private: |
7202 // Bit positions in the flags field. | 7207 // Bit positions in the flags field. |
7203 static const int kCompilationTypeBit = 0; | 7208 static const int kCompilationTypeBit = 0; |
7204 static const int kCompilationStateBit = 1; | 7209 static const int kCompilationStateBit = 1; |
7205 static const int kOriginOptionsShift = 2; | 7210 static const int kHideSourceBit = 2; |
| 7211 static const int kOriginOptionsShift = 3; |
7206 static const int kOriginOptionsSize = 3; | 7212 static const int kOriginOptionsSize = 3; |
7207 static const int kOriginOptionsMask = ((1 << kOriginOptionsSize) - 1) | 7213 static const int kOriginOptionsMask = ((1 << kOriginOptionsSize) - 1) |
7208 << kOriginOptionsShift; | 7214 << kOriginOptionsShift; |
7209 | 7215 |
7210 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); | 7216 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); |
7211 }; | 7217 }; |
7212 | 7218 |
7213 | 7219 |
7214 // List of builtin functions we want to identify to improve code | 7220 // List of builtin functions we want to identify to improve code |
7215 // generation. | 7221 // generation. |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7711 | 7717 |
7712 // Stores opt_count and bailout_reason as bit-fields. | 7718 // Stores opt_count and bailout_reason as bit-fields. |
7713 inline void set_opt_count_and_bailout_reason(int value); | 7719 inline void set_opt_count_and_bailout_reason(int value); |
7714 inline int opt_count_and_bailout_reason() const; | 7720 inline int opt_count_and_bailout_reason() const; |
7715 | 7721 |
7716 inline void set_disable_optimization_reason(BailoutReason reason); | 7722 inline void set_disable_optimization_reason(BailoutReason reason); |
7717 | 7723 |
7718 // Tells whether this function should be subject to debugging. | 7724 // Tells whether this function should be subject to debugging. |
7719 inline bool IsSubjectToDebugging(); | 7725 inline bool IsSubjectToDebugging(); |
7720 | 7726 |
7721 // Whether this function is defined in user-provided JavaScript code. | 7727 // Whether this function is defined in native code or extensions. |
7722 inline bool IsUserJavaScript(); | 7728 inline bool IsBuiltin(); |
7723 | 7729 |
7724 // Check whether or not this function is inlineable. | 7730 // Check whether or not this function is inlineable. |
7725 bool IsInlineable(); | 7731 bool IsInlineable(); |
7726 | 7732 |
7727 // Source size of this function. | 7733 // Source size of this function. |
7728 int SourceSize(); | 7734 int SourceSize(); |
7729 | 7735 |
7730 // Returns `false` if formal parameters include rest parameters, optional | 7736 // Returns `false` if formal parameters include rest parameters, optional |
7731 // parameters, or destructuring parameters. | 7737 // parameters, or destructuring parameters. |
7732 // TODO(caitp): make this a flag set during parsing | 7738 // TODO(caitp): make this a flag set during parsing |
(...skipping 4125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11858 } | 11864 } |
11859 return value; | 11865 return value; |
11860 } | 11866 } |
11861 }; | 11867 }; |
11862 | 11868 |
11863 | 11869 |
11864 } // NOLINT, false-positive due to second-order macros. | 11870 } // NOLINT, false-positive due to second-order macros. |
11865 } // NOLINT, false-positive due to second-order macros. | 11871 } // NOLINT, false-positive due to second-order macros. |
11866 | 11872 |
11867 #endif // V8_OBJECTS_H_ | 11873 #endif // V8_OBJECTS_H_ |
OLD | NEW |