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 | 9 |
10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 7345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7356 public: | 7356 public: |
7357 // [function]: The function corresponding to this generator object. | 7357 // [function]: The function corresponding to this generator object. |
7358 DECL_ACCESSORS(function, JSFunction) | 7358 DECL_ACCESSORS(function, JSFunction) |
7359 | 7359 |
7360 // [context]: The context of the suspended computation. | 7360 // [context]: The context of the suspended computation. |
7361 DECL_ACCESSORS(context, Context) | 7361 DECL_ACCESSORS(context, Context) |
7362 | 7362 |
7363 // [receiver]: The receiver of the suspended computation. | 7363 // [receiver]: The receiver of the suspended computation. |
7364 DECL_ACCESSORS(receiver, Object) | 7364 DECL_ACCESSORS(receiver, Object) |
7365 | 7365 |
7366 // [input]: The most recent input value. | 7366 // [input]: For active generators: the most recent input value. |
| 7367 // (For suspended new-style generators, we abuse this field to store debug |
| 7368 // information.) |
7367 DECL_ACCESSORS(input, Object) | 7369 DECL_ACCESSORS(input, Object) |
7368 | 7370 |
7369 // [resume_mode]: The most recent resume mode. | 7371 // [resume_mode]: The most recent resume mode. |
7370 enum ResumeMode { kNext, kReturn, kThrow }; | 7372 enum ResumeMode { kNext, kReturn, kThrow }; |
7371 DECL_INT_ACCESSORS(resume_mode) | 7373 DECL_INT_ACCESSORS(resume_mode) |
7372 | 7374 |
7373 // [continuation]: Offset into code of continuation. | 7375 // [continuation] |
7374 // | 7376 // |
7375 // A positive offset indicates a suspended generator. The special | 7377 // A positive value indicates a suspended generator. The special |
7376 // kGeneratorExecuting and kGeneratorClosed values indicate that a generator | 7378 // kGeneratorExecuting and kGeneratorClosed values indicate that a generator |
7377 // cannot be resumed. | 7379 // cannot be resumed. |
7378 inline int continuation() const; | 7380 inline int continuation() const; |
7379 inline void set_continuation(int continuation); | 7381 inline void set_continuation(int continuation); |
7380 inline bool is_closed(); | 7382 inline bool is_closed() const; |
7381 inline bool is_executing(); | 7383 inline bool is_executing() const; |
7382 inline bool is_suspended(); | 7384 inline bool is_suspended() const; |
| 7385 |
| 7386 // For suspended generators: the source position at which the generator |
| 7387 // is suspended. |
| 7388 int source_position() const; |
7383 | 7389 |
7384 // [operand_stack]: Saved operand stack. | 7390 // [operand_stack]: Saved operand stack. |
7385 DECL_ACCESSORS(operand_stack, FixedArray) | 7391 DECL_ACCESSORS(operand_stack, FixedArray) |
7386 | 7392 |
7387 DECLARE_CAST(JSGeneratorObject) | 7393 DECLARE_CAST(JSGeneratorObject) |
7388 | 7394 |
7389 // Dispatched behavior. | 7395 // Dispatched behavior. |
7390 DECLARE_VERIFIER(JSGeneratorObject) | 7396 DECLARE_VERIFIER(JSGeneratorObject) |
7391 | 7397 |
7392 // Magic sentinel values for the continuation. | 7398 // Magic sentinel values for the continuation. |
(...skipping 3413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10806 } | 10812 } |
10807 return value; | 10813 return value; |
10808 } | 10814 } |
10809 }; | 10815 }; |
10810 | 10816 |
10811 | 10817 |
10812 } // NOLINT, false-positive due to second-order macros. | 10818 } // NOLINT, false-positive due to second-order macros. |
10813 } // NOLINT, false-positive due to second-order macros. | 10819 } // NOLINT, false-positive due to second-order macros. |
10814 | 10820 |
10815 #endif // V8_OBJECTS_H_ | 10821 #endif // V8_OBJECTS_H_ |
OLD | NEW |