OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 5700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5711 SMI_ACCESSORS(JSGeneratorObject, continuation, kContinuationOffset) | 5711 SMI_ACCESSORS(JSGeneratorObject, continuation, kContinuationOffset) |
5712 ACCESSORS(JSGeneratorObject, operand_stack, FixedArray, kOperandStackOffset) | 5712 ACCESSORS(JSGeneratorObject, operand_stack, FixedArray, kOperandStackOffset) |
5713 SMI_ACCESSORS(JSGeneratorObject, stack_handler_index, kStackHandlerIndexOffset) | 5713 SMI_ACCESSORS(JSGeneratorObject, stack_handler_index, kStackHandlerIndexOffset) |
5714 | 5714 |
5715 bool JSGeneratorObject::is_suspended() { | 5715 bool JSGeneratorObject::is_suspended() { |
5716 ASSERT_LT(kGeneratorExecuting, kGeneratorClosed); | 5716 ASSERT_LT(kGeneratorExecuting, kGeneratorClosed); |
5717 ASSERT_EQ(kGeneratorClosed, 0); | 5717 ASSERT_EQ(kGeneratorClosed, 0); |
5718 return continuation() > 0; | 5718 return continuation() > 0; |
5719 } | 5719 } |
5720 | 5720 |
| 5721 bool JSGeneratorObject::is_closed() { |
| 5722 return continuation() == kGeneratorClosed; |
| 5723 } |
| 5724 |
| 5725 bool JSGeneratorObject::is_executing() { |
| 5726 return continuation() == kGeneratorExecuting; |
| 5727 } |
| 5728 |
5721 JSGeneratorObject* JSGeneratorObject::cast(Object* obj) { | 5729 JSGeneratorObject* JSGeneratorObject::cast(Object* obj) { |
5722 ASSERT(obj->IsJSGeneratorObject()); | 5730 ASSERT(obj->IsJSGeneratorObject()); |
5723 ASSERT(HeapObject::cast(obj)->Size() == JSGeneratorObject::kSize); | 5731 ASSERT(HeapObject::cast(obj)->Size() == JSGeneratorObject::kSize); |
5724 return reinterpret_cast<JSGeneratorObject*>(obj); | 5732 return reinterpret_cast<JSGeneratorObject*>(obj); |
5725 } | 5733 } |
5726 | 5734 |
5727 | 5735 |
5728 ACCESSORS(JSModule, context, Object, kContextOffset) | 5736 ACCESSORS(JSModule, context, Object, kContextOffset) |
5729 ACCESSORS(JSModule, scope_info, ScopeInfo, kScopeInfoOffset) | 5737 ACCESSORS(JSModule, scope_info, ScopeInfo, kScopeInfoOffset) |
5730 | 5738 |
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6856 #undef READ_SHORT_FIELD | 6864 #undef READ_SHORT_FIELD |
6857 #undef WRITE_SHORT_FIELD | 6865 #undef WRITE_SHORT_FIELD |
6858 #undef READ_BYTE_FIELD | 6866 #undef READ_BYTE_FIELD |
6859 #undef WRITE_BYTE_FIELD | 6867 #undef WRITE_BYTE_FIELD |
6860 #undef NOBARRIER_READ_BYTE_FIELD | 6868 #undef NOBARRIER_READ_BYTE_FIELD |
6861 #undef NOBARRIER_WRITE_BYTE_FIELD | 6869 #undef NOBARRIER_WRITE_BYTE_FIELD |
6862 | 6870 |
6863 } } // namespace v8::internal | 6871 } } // namespace v8::internal |
6864 | 6872 |
6865 #endif // V8_OBJECTS_INL_H_ | 6873 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |