| 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/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 7138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7149 public: | 7149 public: |
| 7150 // [function]: The function corresponding to this generator object. | 7150 // [function]: The function corresponding to this generator object. |
| 7151 DECL_ACCESSORS(function, JSFunction) | 7151 DECL_ACCESSORS(function, JSFunction) |
| 7152 | 7152 |
| 7153 // [context]: The context of the suspended computation. | 7153 // [context]: The context of the suspended computation. |
| 7154 DECL_ACCESSORS(context, Context) | 7154 DECL_ACCESSORS(context, Context) |
| 7155 | 7155 |
| 7156 // [receiver]: The receiver of the suspended computation. | 7156 // [receiver]: The receiver of the suspended computation. |
| 7157 DECL_ACCESSORS(receiver, Object) | 7157 DECL_ACCESSORS(receiver, Object) |
| 7158 | 7158 |
| 7159 // [input]: The most recent input value. |
| 7160 DECL_ACCESSORS(input, Object) |
| 7161 |
| 7159 // [continuation]: Offset into code of continuation. | 7162 // [continuation]: Offset into code of continuation. |
| 7160 // | 7163 // |
| 7161 // A positive offset indicates a suspended generator. The special | 7164 // A positive offset indicates a suspended generator. The special |
| 7162 // kGeneratorExecuting and kGeneratorClosed values indicate that a generator | 7165 // kGeneratorExecuting and kGeneratorClosed values indicate that a generator |
| 7163 // cannot be resumed. | 7166 // cannot be resumed. |
| 7164 inline int continuation() const; | 7167 inline int continuation() const; |
| 7165 inline void set_continuation(int continuation); | 7168 inline void set_continuation(int continuation); |
| 7166 inline bool is_closed(); | 7169 inline bool is_closed(); |
| 7167 inline bool is_executing(); | 7170 inline bool is_executing(); |
| 7168 inline bool is_suspended(); | 7171 inline bool is_suspended(); |
| 7169 | 7172 |
| 7170 // [operand_stack]: Saved operand stack. | 7173 // [operand_stack]: Saved operand stack. |
| 7171 DECL_ACCESSORS(operand_stack, FixedArray) | 7174 DECL_ACCESSORS(operand_stack, FixedArray) |
| 7172 | 7175 |
| 7173 DECLARE_CAST(JSGeneratorObject) | 7176 DECLARE_CAST(JSGeneratorObject) |
| 7174 | 7177 |
| 7175 // Dispatched behavior. | 7178 // Dispatched behavior. |
| 7176 DECLARE_PRINTER(JSGeneratorObject) | 7179 DECLARE_PRINTER(JSGeneratorObject) |
| 7177 DECLARE_VERIFIER(JSGeneratorObject) | 7180 DECLARE_VERIFIER(JSGeneratorObject) |
| 7178 | 7181 |
| 7179 // Magic sentinel values for the continuation. | 7182 // Magic sentinel values for the continuation. |
| 7180 static const int kGeneratorExecuting = -1; | 7183 static const int kGeneratorExecuting = -1; |
| 7181 static const int kGeneratorClosed = 0; | 7184 static const int kGeneratorClosed = 0; |
| 7182 | 7185 |
| 7183 // Layout description. | 7186 // Layout description. |
| 7184 static const int kFunctionOffset = JSObject::kHeaderSize; | 7187 static const int kFunctionOffset = JSObject::kHeaderSize; |
| 7185 static const int kContextOffset = kFunctionOffset + kPointerSize; | 7188 static const int kContextOffset = kFunctionOffset + kPointerSize; |
| 7186 static const int kReceiverOffset = kContextOffset + kPointerSize; | 7189 static const int kReceiverOffset = kContextOffset + kPointerSize; |
| 7187 static const int kContinuationOffset = kReceiverOffset + kPointerSize; | 7190 static const int kInputOffset = kReceiverOffset + kPointerSize; |
| 7191 static const int kContinuationOffset = kInputOffset + kPointerSize; |
| 7188 static const int kOperandStackOffset = kContinuationOffset + kPointerSize; | 7192 static const int kOperandStackOffset = kContinuationOffset + kPointerSize; |
| 7189 static const int kSize = kOperandStackOffset + kPointerSize; | 7193 static const int kSize = kOperandStackOffset + kPointerSize; |
| 7190 | 7194 |
| 7191 // Resume mode, for use by runtime functions. | 7195 // Resume mode, for use by runtime functions. |
| 7192 enum ResumeMode { NEXT, THROW }; | 7196 enum ResumeMode { NEXT, THROW }; |
| 7193 | 7197 |
| 7194 private: | 7198 private: |
| 7195 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorObject); | 7199 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorObject); |
| 7196 }; | 7200 }; |
| 7197 | 7201 |
| (...skipping 3532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10730 } | 10734 } |
| 10731 return value; | 10735 return value; |
| 10732 } | 10736 } |
| 10733 }; | 10737 }; |
| 10734 | 10738 |
| 10735 | 10739 |
| 10736 } // NOLINT, false-positive due to second-order macros. | 10740 } // NOLINT, false-positive due to second-order macros. |
| 10737 } // NOLINT, false-positive due to second-order macros. | 10741 } // NOLINT, false-positive due to second-order macros. |
| 10738 | 10742 |
| 10739 #endif // V8_OBJECTS_H_ | 10743 #endif // V8_OBJECTS_H_ |
| OLD | NEW |