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