OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 6302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6313 | 6313 |
6314 | 6314 |
6315 class JSGeneratorObject: public JSObject { | 6315 class JSGeneratorObject: public JSObject { |
6316 public: | 6316 public: |
6317 // [function]: The function corresponding to this generator object. | 6317 // [function]: The function corresponding to this generator object. |
6318 DECL_ACCESSORS(function, JSFunction) | 6318 DECL_ACCESSORS(function, JSFunction) |
6319 | 6319 |
6320 // [context]: The context of the suspended computation. | 6320 // [context]: The context of the suspended computation. |
6321 DECL_ACCESSORS(context, Context) | 6321 DECL_ACCESSORS(context, Context) |
6322 | 6322 |
| 6323 // [receiver]: The receiver of the suspended computation. |
| 6324 DECL_ACCESSORS(receiver, Object) |
| 6325 |
6323 // [continuation]: Offset into code of continuation. | 6326 // [continuation]: Offset into code of continuation. |
6324 // | 6327 // |
6325 // A positive offset indicates a suspended generator. The special | 6328 // A positive offset indicates a suspended generator. The special |
6326 // kGeneratorExecuting and kGeneratorClosed values indicate that a generator | 6329 // kGeneratorExecuting and kGeneratorClosed values indicate that a generator |
6327 // cannot be resumed. | 6330 // cannot be resumed. |
6328 inline int continuation(); | 6331 inline int continuation(); |
6329 inline void set_continuation(int continuation); | 6332 inline void set_continuation(int continuation); |
6330 | 6333 |
6331 // [operands]: Saved operand stack. | 6334 // [operands]: Saved operand stack. |
6332 DECL_ACCESSORS(operand_stack, FixedArray) | 6335 DECL_ACCESSORS(operand_stack, FixedArray) |
6333 | 6336 |
6334 // Casting. | 6337 // Casting. |
6335 static inline JSGeneratorObject* cast(Object* obj); | 6338 static inline JSGeneratorObject* cast(Object* obj); |
6336 | 6339 |
6337 // Dispatched behavior. | 6340 // Dispatched behavior. |
6338 DECLARE_PRINTER(JSGeneratorObject) | 6341 DECLARE_PRINTER(JSGeneratorObject) |
6339 DECLARE_VERIFIER(JSGeneratorObject) | 6342 DECLARE_VERIFIER(JSGeneratorObject) |
6340 | 6343 |
6341 // Magic sentinel values for the continuation. | 6344 // Magic sentinel values for the continuation. |
6342 static const int kGeneratorExecuting = -1; | 6345 static const int kGeneratorExecuting = -1; |
6343 static const int kGeneratorClosed = 0; | 6346 static const int kGeneratorClosed = 0; |
6344 | 6347 |
6345 // Layout description. | 6348 // Layout description. |
6346 static const int kFunctionOffset = JSObject::kHeaderSize; | 6349 static const int kFunctionOffset = JSObject::kHeaderSize; |
6347 static const int kContextOffset = kFunctionOffset + kPointerSize; | 6350 static const int kContextOffset = kFunctionOffset + kPointerSize; |
6348 static const int kContinuationOffset = kContextOffset + kPointerSize; | 6351 static const int kReceiverOffset = kContextOffset + kPointerSize; |
| 6352 static const int kContinuationOffset = kReceiverOffset + kPointerSize; |
6349 static const int kOperandStackOffset = kContinuationOffset + kPointerSize; | 6353 static const int kOperandStackOffset = kContinuationOffset + kPointerSize; |
6350 static const int kSize = kOperandStackOffset + kPointerSize; | 6354 static const int kSize = kOperandStackOffset + kPointerSize; |
6351 | 6355 |
6352 // Resume mode, for use by runtime functions. | 6356 // Resume mode, for use by runtime functions. |
6353 enum ResumeMode { SEND, THROW }; | 6357 enum ResumeMode { SEND, THROW }; |
6354 | 6358 |
6355 private: | 6359 private: |
6356 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorObject); | 6360 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorObject); |
6357 }; | 6361 }; |
6358 | 6362 |
(...skipping 3093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9452 } else { | 9456 } else { |
9453 value &= ~(1 << bit_position); | 9457 value &= ~(1 << bit_position); |
9454 } | 9458 } |
9455 return value; | 9459 return value; |
9456 } | 9460 } |
9457 }; | 9461 }; |
9458 | 9462 |
9459 } } // namespace v8::internal | 9463 } } // namespace v8::internal |
9460 | 9464 |
9461 #endif // V8_OBJECTS_H_ | 9465 #endif // V8_OBJECTS_H_ |
OLD | NEW |