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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
754 bool Object::IsDeoptimizationOutputData() const { | 754 bool Object::IsDeoptimizationOutputData() const { |
755 if (!IsFixedArray()) return false; | 755 if (!IsFixedArray()) return false; |
756 // There's actually no way to see the difference between a fixed array and | 756 // There's actually no way to see the difference between a fixed array and |
757 // a deoptimization data array. Since this is used for asserts we can check | 757 // a deoptimization data array. Since this is used for asserts we can check |
758 // that the length is plausible though. | 758 // that the length is plausible though. |
759 if (FixedArray::cast(this)->length() % 2 != 0) return false; | 759 if (FixedArray::cast(this)->length() % 2 != 0) return false; |
760 return true; | 760 return true; |
761 } | 761 } |
762 | 762 |
763 | 763 |
764 bool Object::IsHandlerTable() const { | |
765 if (!IsFixedArray()) return false; | |
766 // There's actually no way to see the difference between a fixed array and | |
767 // a handler table array. | |
Yang
2015/03/17 10:21:22
Maybe we want to introduce a special fixed array m
Michael Starzinger
2015/03/18 10:42:35
Acknowledged. As discussed offline, Benedikt and I
| |
768 return true; | |
769 } | |
770 | |
771 | |
764 bool Object::IsDependentCode() const { | 772 bool Object::IsDependentCode() const { |
765 if (!IsFixedArray()) return false; | 773 if (!IsFixedArray()) return false; |
766 // There's actually no way to see the difference between a fixed array and | 774 // There's actually no way to see the difference between a fixed array and |
767 // a dependent codes array. | 775 // a dependent codes array. |
768 return true; | 776 return true; |
769 } | 777 } |
770 | 778 |
771 | 779 |
772 bool Object::IsContext() const { | 780 bool Object::IsContext() const { |
773 if (!Object::IsHeapObject()) return false; | 781 if (!Object::IsHeapObject()) return false; |
(...skipping 2575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3349 CAST_ACCESSOR(ExternalUint16Array) | 3357 CAST_ACCESSOR(ExternalUint16Array) |
3350 CAST_ACCESSOR(ExternalUint32Array) | 3358 CAST_ACCESSOR(ExternalUint32Array) |
3351 CAST_ACCESSOR(ExternalUint8Array) | 3359 CAST_ACCESSOR(ExternalUint8Array) |
3352 CAST_ACCESSOR(ExternalUint8ClampedArray) | 3360 CAST_ACCESSOR(ExternalUint8ClampedArray) |
3353 CAST_ACCESSOR(FixedArray) | 3361 CAST_ACCESSOR(FixedArray) |
3354 CAST_ACCESSOR(FixedArrayBase) | 3362 CAST_ACCESSOR(FixedArrayBase) |
3355 CAST_ACCESSOR(FixedDoubleArray) | 3363 CAST_ACCESSOR(FixedDoubleArray) |
3356 CAST_ACCESSOR(FixedTypedArrayBase) | 3364 CAST_ACCESSOR(FixedTypedArrayBase) |
3357 CAST_ACCESSOR(Foreign) | 3365 CAST_ACCESSOR(Foreign) |
3358 CAST_ACCESSOR(GlobalObject) | 3366 CAST_ACCESSOR(GlobalObject) |
3367 CAST_ACCESSOR(HandlerTable) | |
3359 CAST_ACCESSOR(HeapObject) | 3368 CAST_ACCESSOR(HeapObject) |
3360 CAST_ACCESSOR(JSArray) | 3369 CAST_ACCESSOR(JSArray) |
3361 CAST_ACCESSOR(JSArrayBuffer) | 3370 CAST_ACCESSOR(JSArrayBuffer) |
3362 CAST_ACCESSOR(JSArrayBufferView) | 3371 CAST_ACCESSOR(JSArrayBufferView) |
3363 CAST_ACCESSOR(JSBuiltinsObject) | 3372 CAST_ACCESSOR(JSBuiltinsObject) |
3364 CAST_ACCESSOR(JSDataView) | 3373 CAST_ACCESSOR(JSDataView) |
3365 CAST_ACCESSOR(JSDate) | 3374 CAST_ACCESSOR(JSDate) |
3366 CAST_ACCESSOR(JSFunction) | 3375 CAST_ACCESSOR(JSFunction) |
3367 CAST_ACCESSOR(JSFunctionProxy) | 3376 CAST_ACCESSOR(JSFunctionProxy) |
3368 CAST_ACCESSOR(JSFunctionResultCache) | 3377 CAST_ACCESSOR(JSFunctionResultCache) |
(...skipping 2866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6235 void Foreign::set_foreign_address(Address value) { | 6244 void Foreign::set_foreign_address(Address value) { |
6236 WRITE_INTPTR_FIELD(this, kForeignAddressOffset, OffsetFrom(value)); | 6245 WRITE_INTPTR_FIELD(this, kForeignAddressOffset, OffsetFrom(value)); |
6237 } | 6246 } |
6238 | 6247 |
6239 | 6248 |
6240 ACCESSORS(JSGeneratorObject, function, JSFunction, kFunctionOffset) | 6249 ACCESSORS(JSGeneratorObject, function, JSFunction, kFunctionOffset) |
6241 ACCESSORS(JSGeneratorObject, context, Context, kContextOffset) | 6250 ACCESSORS(JSGeneratorObject, context, Context, kContextOffset) |
6242 ACCESSORS(JSGeneratorObject, receiver, Object, kReceiverOffset) | 6251 ACCESSORS(JSGeneratorObject, receiver, Object, kReceiverOffset) |
6243 SMI_ACCESSORS(JSGeneratorObject, continuation, kContinuationOffset) | 6252 SMI_ACCESSORS(JSGeneratorObject, continuation, kContinuationOffset) |
6244 ACCESSORS(JSGeneratorObject, operand_stack, FixedArray, kOperandStackOffset) | 6253 ACCESSORS(JSGeneratorObject, operand_stack, FixedArray, kOperandStackOffset) |
6245 SMI_ACCESSORS(JSGeneratorObject, stack_handler_index, kStackHandlerIndexOffset) | |
6246 | 6254 |
6247 bool JSGeneratorObject::is_suspended() { | 6255 bool JSGeneratorObject::is_suspended() { |
6248 DCHECK_LT(kGeneratorExecuting, kGeneratorClosed); | 6256 DCHECK_LT(kGeneratorExecuting, kGeneratorClosed); |
6249 DCHECK_EQ(kGeneratorClosed, 0); | 6257 DCHECK_EQ(kGeneratorClosed, 0); |
6250 return continuation() > 0; | 6258 return continuation() > 0; |
6251 } | 6259 } |
6252 | 6260 |
6253 bool JSGeneratorObject::is_closed() { | 6261 bool JSGeneratorObject::is_closed() { |
6254 return continuation() == kGeneratorClosed; | 6262 return continuation() == kGeneratorClosed; |
6255 } | 6263 } |
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7517 #undef READ_SHORT_FIELD | 7525 #undef READ_SHORT_FIELD |
7518 #undef WRITE_SHORT_FIELD | 7526 #undef WRITE_SHORT_FIELD |
7519 #undef READ_BYTE_FIELD | 7527 #undef READ_BYTE_FIELD |
7520 #undef WRITE_BYTE_FIELD | 7528 #undef WRITE_BYTE_FIELD |
7521 #undef NOBARRIER_READ_BYTE_FIELD | 7529 #undef NOBARRIER_READ_BYTE_FIELD |
7522 #undef NOBARRIER_WRITE_BYTE_FIELD | 7530 #undef NOBARRIER_WRITE_BYTE_FIELD |
7523 | 7531 |
7524 } } // namespace v8::internal | 7532 } } // namespace v8::internal |
7525 | 7533 |
7526 #endif // V8_OBJECTS_INL_H_ | 7534 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |