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

Side by Side Diff: src/objects.h

Issue 14031028: Generators save and restore stack handlers (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Rebased before commit Created 7 years, 7 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/frames-inl.h ('k') | src/objects-debug.cc » ('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 6392 matching lines...) Expand 10 before | Expand all | Expand 10 after
6403 DECL_ACCESSORS(receiver, Object) 6403 DECL_ACCESSORS(receiver, Object)
6404 6404
6405 // [continuation]: Offset into code of continuation. 6405 // [continuation]: Offset into code of continuation.
6406 // 6406 //
6407 // A positive offset indicates a suspended generator. The special 6407 // A positive offset indicates a suspended generator. The special
6408 // kGeneratorExecuting and kGeneratorClosed values indicate that a generator 6408 // kGeneratorExecuting and kGeneratorClosed values indicate that a generator
6409 // cannot be resumed. 6409 // cannot be resumed.
6410 inline int continuation(); 6410 inline int continuation();
6411 inline void set_continuation(int continuation); 6411 inline void set_continuation(int continuation);
6412 6412
6413 // [operands]: Saved operand stack. 6413 // [operand_stack]: Saved operand stack.
6414 DECL_ACCESSORS(operand_stack, FixedArray) 6414 DECL_ACCESSORS(operand_stack, FixedArray)
6415 6415
6416 // [stack_handler_index]: Index of first stack handler in operand_stack, or -1
6417 // if the captured activation had no stack handler.
6418 inline int stack_handler_index();
6419 inline void set_stack_handler_index(int stack_handler_index);
6420
6416 // Casting. 6421 // Casting.
6417 static inline JSGeneratorObject* cast(Object* obj); 6422 static inline JSGeneratorObject* cast(Object* obj);
6418 6423
6419 // Dispatched behavior. 6424 // Dispatched behavior.
6420 DECLARE_PRINTER(JSGeneratorObject) 6425 DECLARE_PRINTER(JSGeneratorObject)
6421 DECLARE_VERIFIER(JSGeneratorObject) 6426 DECLARE_VERIFIER(JSGeneratorObject)
6422 6427
6423 // Magic sentinel values for the continuation. 6428 // Magic sentinel values for the continuation.
6424 static const int kGeneratorExecuting = -1; 6429 static const int kGeneratorExecuting = -1;
6425 static const int kGeneratorClosed = 0; 6430 static const int kGeneratorClosed = 0;
6426 6431
6427 // Layout description. 6432 // Layout description.
6428 static const int kFunctionOffset = JSObject::kHeaderSize; 6433 static const int kFunctionOffset = JSObject::kHeaderSize;
6429 static const int kContextOffset = kFunctionOffset + kPointerSize; 6434 static const int kContextOffset = kFunctionOffset + kPointerSize;
6430 static const int kReceiverOffset = kContextOffset + kPointerSize; 6435 static const int kReceiverOffset = kContextOffset + kPointerSize;
6431 static const int kContinuationOffset = kReceiverOffset + kPointerSize; 6436 static const int kContinuationOffset = kReceiverOffset + kPointerSize;
6432 static const int kOperandStackOffset = kContinuationOffset + kPointerSize; 6437 static const int kOperandStackOffset = kContinuationOffset + kPointerSize;
6433 static const int kSize = kOperandStackOffset + kPointerSize; 6438 static const int kStackHandlerIndexOffset =
6439 kOperandStackOffset + kPointerSize;
6440 static const int kSize = kStackHandlerIndexOffset + kPointerSize;
6434 6441
6435 // Resume mode, for use by runtime functions. 6442 // Resume mode, for use by runtime functions.
6436 enum ResumeMode { SEND, THROW }; 6443 enum ResumeMode { SEND, THROW };
6437 6444
6438 // Yielding from a generator returns an object with the following inobject 6445 // Yielding from a generator returns an object with the following inobject
6439 // properties. See Context::generator_result_map() for the map. 6446 // properties. See Context::generator_result_map() for the map.
6440 static const int kResultValuePropertyIndex = 0; 6447 static const int kResultValuePropertyIndex = 0;
6441 static const int kResultDonePropertyIndex = 1; 6448 static const int kResultDonePropertyIndex = 1;
6442 static const int kResultPropertyCount = 2; 6449 static const int kResultPropertyCount = 2;
6443 6450
(...skipping 3107 matching lines...) Expand 10 before | Expand all | Expand 10 after
9551 } else { 9558 } else {
9552 value &= ~(1 << bit_position); 9559 value &= ~(1 << bit_position);
9553 } 9560 }
9554 return value; 9561 return value;
9555 } 9562 }
9556 }; 9563 };
9557 9564
9558 } } // namespace v8::internal 9565 } } // namespace v8::internal
9559 9566
9560 #endif // V8_OBJECTS_H_ 9567 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/frames-inl.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698