Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: src/objects.h

Issue 13704010: Generator objects can suspend (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Address comments; Refactor VisitYield Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6246 matching lines...) Expand 10 before | Expand all | Expand 10 after
6257 private: 6257 private:
6258 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); 6258 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo);
6259 }; 6259 };
6260 6260
6261 6261
6262 class JSGeneratorObject: public JSObject { 6262 class JSGeneratorObject: public JSObject {
6263 public: 6263 public:
6264 // [function]: The function corresponding to this generator object. 6264 // [function]: The function corresponding to this generator object.
6265 DECL_ACCESSORS(function, JSFunction) 6265 DECL_ACCESSORS(function, JSFunction)
6266 6266
6267 // [context]: The context of the suspended computation, or undefined. 6267 // [context]: The context of the suspended computation.
6268 DECL_ACCESSORS(context, Object) 6268 DECL_ACCESSORS(context, Context)
6269 6269
6270 // [continuation]: Offset into code of continuation. 6270 // [continuation]: Offset into code of continuation.
6271 //
6272 // The sign of the offset corresponds to the generator state: positive is
6273 // "suspended", negative is "executing" and 0 is "closed".
6271 inline int continuation(); 6274 inline int continuation();
6272 inline void set_continuation(int continuation); 6275 inline void set_continuation(int continuation);
6273 6276
6274 // [operands]: Saved operand stack. 6277 // [operands]: Saved operand stack.
6275 DECL_ACCESSORS(operand_stack, FixedArray) 6278 DECL_ACCESSORS(operand_stack, FixedArray)
6276 6279
6277 // Casting. 6280 // Casting.
6278 static inline JSGeneratorObject* cast(Object* obj); 6281 static inline JSGeneratorObject* cast(Object* obj);
6279 6282
6280 // Dispatched behavior. 6283 // Dispatched behavior.
6281 DECLARE_PRINTER(JSGeneratorObject) 6284 DECLARE_PRINTER(JSGeneratorObject)
6282 DECLARE_VERIFIER(JSGeneratorObject) 6285 DECLARE_VERIFIER(JSGeneratorObject)
6283 6286
Michael Starzinger 2013/04/19 13:15:56 Can we add constants here for the magic sentinel v
wingo 2013/04/19 13:57:41 Good point; done.
6284 // Layout description. 6287 // Layout description.
6285 static const int kFunctionOffset = JSObject::kHeaderSize; 6288 static const int kFunctionOffset = JSObject::kHeaderSize;
6286 static const int kContextOffset = kFunctionOffset + kPointerSize; 6289 static const int kContextOffset = kFunctionOffset + kPointerSize;
6287 static const int kContinuationOffset = kContextOffset + kPointerSize; 6290 static const int kContinuationOffset = kContextOffset + kPointerSize;
6288 static const int kOperandStackOffset = kContinuationOffset + kPointerSize; 6291 static const int kOperandStackOffset = kContinuationOffset + kPointerSize;
6289 static const int kSize = kOperandStackOffset + kPointerSize; 6292 static const int kSize = kOperandStackOffset + kPointerSize;
6290 6293
6291 private: 6294 private:
6292 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorObject); 6295 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorObject);
6293 }; 6296 };
(...skipping 3062 matching lines...) Expand 10 before | Expand all | Expand 10 after
9356 } else { 9359 } else {
9357 value &= ~(1 << bit_position); 9360 value &= ~(1 << bit_position);
9358 } 9361 }
9359 return value; 9362 return value;
9360 } 9363 }
9361 }; 9364 };
9362 9365
9363 } } // namespace v8::internal 9366 } } // namespace v8::internal
9364 9367
9365 #endif // V8_OBJECTS_H_ 9368 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698