| OLD | NEW |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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_SCRIPT_H_ | 5 #ifndef V8_OBJECTS_SCRIPT_H_ |
| 6 #define V8_OBJECTS_SCRIPT_H_ | 6 #define V8_OBJECTS_SCRIPT_H_ |
| 7 | 7 |
| 8 #include "src/objects.h" | 8 #include "src/objects.h" |
| 9 | 9 |
| 10 // Has to be the last include (doesn't have include guards): | 10 // Has to be the last include (doesn't have include guards): |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // compiled. Encoded in the 'flags' field. | 99 // compiled. Encoded in the 'flags' field. |
| 100 inline CompilationState compilation_state(); | 100 inline CompilationState compilation_state(); |
| 101 inline void set_compilation_state(CompilationState state); | 101 inline void set_compilation_state(CompilationState state); |
| 102 | 102 |
| 103 // [origin_options]: optional attributes set by the embedder via ScriptOrigin, | 103 // [origin_options]: optional attributes set by the embedder via ScriptOrigin, |
| 104 // and used by the embedder to make decisions about the script. V8 just passes | 104 // and used by the embedder to make decisions about the script. V8 just passes |
| 105 // this through. Encoded in the 'flags' field. | 105 // this through. Encoded in the 'flags' field. |
| 106 inline v8::ScriptOriginOptions origin_options(); | 106 inline v8::ScriptOriginOptions origin_options(); |
| 107 inline void set_origin_options(ScriptOriginOptions origin_options); | 107 inline void set_origin_options(ScriptOriginOptions origin_options); |
| 108 | 108 |
| 109 DECLARE_CAST(Script) | 109 DECL_CAST(Script) |
| 110 | 110 |
| 111 // If script source is an external string, check that the underlying | 111 // If script source is an external string, check that the underlying |
| 112 // resource is accessible. Otherwise, always return true. | 112 // resource is accessible. Otherwise, always return true. |
| 113 inline bool HasValidSource(); | 113 inline bool HasValidSource(); |
| 114 | 114 |
| 115 Object* GetNameOrSourceURL(); | 115 Object* GetNameOrSourceURL(); |
| 116 | 116 |
| 117 // Set eval origin for stack trace formatting. | 117 // Set eval origin for stack trace formatting. |
| 118 static void SetEvalOrigin(Handle<Script> script, | 118 static void SetEvalOrigin(Handle<Script> script, |
| 119 Handle<SharedFunctionInfo> outer, | 119 Handle<SharedFunctionInfo> outer, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 Script* Next(); | 172 Script* Next(); |
| 173 | 173 |
| 174 private: | 174 private: |
| 175 WeakFixedArray::Iterator iterator_; | 175 WeakFixedArray::Iterator iterator_; |
| 176 DISALLOW_COPY_AND_ASSIGN(Iterator); | 176 DISALLOW_COPY_AND_ASSIGN(Iterator); |
| 177 }; | 177 }; |
| 178 | 178 |
| 179 bool HasPreparsedScopeData() const; | 179 bool HasPreparsedScopeData() const; |
| 180 | 180 |
| 181 // Dispatched behavior. | 181 // Dispatched behavior. |
| 182 DECLARE_PRINTER(Script) | 182 DECL_PRINTER(Script) |
| 183 DECLARE_VERIFIER(Script) | 183 DECL_VERIFIER(Script) |
| 184 | 184 |
| 185 static const int kSourceOffset = HeapObject::kHeaderSize; | 185 static const int kSourceOffset = HeapObject::kHeaderSize; |
| 186 static const int kNameOffset = kSourceOffset + kPointerSize; | 186 static const int kNameOffset = kSourceOffset + kPointerSize; |
| 187 static const int kLineOffsetOffset = kNameOffset + kPointerSize; | 187 static const int kLineOffsetOffset = kNameOffset + kPointerSize; |
| 188 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; | 188 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; |
| 189 static const int kContextOffset = kColumnOffsetOffset + kPointerSize; | 189 static const int kContextOffset = kColumnOffsetOffset + kPointerSize; |
| 190 static const int kWrapperOffset = kContextOffset + kPointerSize; | 190 static const int kWrapperOffset = kContextOffset + kPointerSize; |
| 191 static const int kTypeOffset = kWrapperOffset + kPointerSize; | 191 static const int kTypeOffset = kWrapperOffset + kPointerSize; |
| 192 static const int kLineEndsOffset = kTypeOffset + kPointerSize; | 192 static const int kLineEndsOffset = kTypeOffset + kPointerSize; |
| 193 static const int kIdOffset = kLineEndsOffset + kPointerSize; | 193 static const int kIdOffset = kLineEndsOffset + kPointerSize; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 214 | 214 |
| 215 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); | 215 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); |
| 216 }; | 216 }; |
| 217 | 217 |
| 218 } // namespace internal | 218 } // namespace internal |
| 219 } // namespace v8 | 219 } // namespace v8 |
| 220 | 220 |
| 221 #include "src/objects/object-macros-undef.h" | 221 #include "src/objects/object-macros-undef.h" |
| 222 | 222 |
| 223 #endif // V8_OBJECTS_SCRIPT_H_ | 223 #endif // V8_OBJECTS_SCRIPT_H_ |
| OLD | NEW |