| 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 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 // map-word). | 1470 // map-word). |
| 1471 if (((type & kIsIndirectStringMask) != kIsIndirectStringTag)) | 1471 if (((type & kIsIndirectStringMask) != kIsIndirectStringTag)) |
| 1472 return HeapObjectContents::kRawValues; | 1472 return HeapObjectContents::kRawValues; |
| 1473 else | 1473 else |
| 1474 return HeapObjectContents::kTaggedValues; | 1474 return HeapObjectContents::kTaggedValues; |
| 1475 #if 0 | 1475 #if 0 |
| 1476 // TODO(jochen): Enable eventually. | 1476 // TODO(jochen): Enable eventually. |
| 1477 } else if (type == JS_FUNCTION_TYPE) { | 1477 } else if (type == JS_FUNCTION_TYPE) { |
| 1478 return HeapObjectContents::kMixedValues; | 1478 return HeapObjectContents::kMixedValues; |
| 1479 #endif | 1479 #endif |
| 1480 } else if (type == BYTECODE_ARRAY_TYPE) { |
| 1481 return HeapObjectContents::kMixedValues; |
| 1480 } else if (type >= FIRST_FIXED_TYPED_ARRAY_TYPE && | 1482 } else if (type >= FIRST_FIXED_TYPED_ARRAY_TYPE && |
| 1481 type <= LAST_FIXED_TYPED_ARRAY_TYPE) { | 1483 type <= LAST_FIXED_TYPED_ARRAY_TYPE) { |
| 1482 return HeapObjectContents::kMixedValues; | 1484 return HeapObjectContents::kMixedValues; |
| 1483 } else if (type <= LAST_DATA_TYPE) { | 1485 } else if (type <= LAST_DATA_TYPE) { |
| 1484 // TODO(jochen): Why do we claim that Code and Map contain only raw values? | 1486 // TODO(jochen): Why do we claim that Code and Map contain only raw values? |
| 1485 return HeapObjectContents::kRawValues; | 1487 return HeapObjectContents::kRawValues; |
| 1486 } else { | 1488 } else { |
| 1487 if (FLAG_unbox_double_fields) { | 1489 if (FLAG_unbox_double_fields) { |
| 1488 LayoutDescriptorHelper helper(map()); | 1490 LayoutDescriptorHelper helper(map()); |
| 1489 if (!helper.all_fields_tagged()) return HeapObjectContents::kMixedValues; | 1491 if (!helper.all_fields_tagged()) return HeapObjectContents::kMixedValues; |
| (...skipping 2531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4021 | 4023 |
| 4022 | 4024 |
| 4023 int ByteArray::ByteArraySize() { return SizeFor(this->length()); } | 4025 int ByteArray::ByteArraySize() { return SizeFor(this->length()); } |
| 4024 | 4026 |
| 4025 | 4027 |
| 4026 Address ByteArray::GetDataStartAddress() { | 4028 Address ByteArray::GetDataStartAddress() { |
| 4027 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; | 4029 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; |
| 4028 } | 4030 } |
| 4029 | 4031 |
| 4030 | 4032 |
| 4033 void BytecodeArray::BytecodeArrayIterateBody(ObjectVisitor* v) { |
| 4034 IteratePointer(v, kConstantPoolOffset); |
| 4035 } |
| 4036 |
| 4037 |
| 4031 byte BytecodeArray::get(int index) { | 4038 byte BytecodeArray::get(int index) { |
| 4032 DCHECK(index >= 0 && index < this->length()); | 4039 DCHECK(index >= 0 && index < this->length()); |
| 4033 return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize); | 4040 return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize); |
| 4034 } | 4041 } |
| 4035 | 4042 |
| 4036 | 4043 |
| 4037 void BytecodeArray::set(int index, byte value) { | 4044 void BytecodeArray::set(int index, byte value) { |
| 4038 DCHECK(index >= 0 && index < this->length()); | 4045 DCHECK(index >= 0 && index < this->length()); |
| 4039 WRITE_BYTE_FIELD(this, kHeaderSize + index * kCharSize, value); | 4046 WRITE_BYTE_FIELD(this, kHeaderSize + index * kCharSize, value); |
| 4040 } | 4047 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 4057 WRITE_INT_FIELD(this, kParameterSizeOffset, | 4064 WRITE_INT_FIELD(this, kParameterSizeOffset, |
| 4058 (number_of_parameters << kPointerSizeLog2)); | 4065 (number_of_parameters << kPointerSizeLog2)); |
| 4059 } | 4066 } |
| 4060 | 4067 |
| 4061 | 4068 |
| 4062 int BytecodeArray::parameter_count() const { | 4069 int BytecodeArray::parameter_count() const { |
| 4063 return READ_INT_FIELD(this, kParameterSizeOffset) >> kPointerSizeLog2; | 4070 return READ_INT_FIELD(this, kParameterSizeOffset) >> kPointerSizeLog2; |
| 4064 } | 4071 } |
| 4065 | 4072 |
| 4066 | 4073 |
| 4074 ACCESSORS(BytecodeArray, constant_pool, FixedArray, kConstantPoolOffset) |
| 4075 |
| 4076 |
| 4067 Address BytecodeArray::GetFirstBytecodeAddress() { | 4077 Address BytecodeArray::GetFirstBytecodeAddress() { |
| 4068 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; | 4078 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; |
| 4069 } | 4079 } |
| 4070 | 4080 |
| 4071 | 4081 |
| 4072 int BytecodeArray::BytecodeArraySize() { return SizeFor(this->length()); } | 4082 int BytecodeArray::BytecodeArraySize() { return SizeFor(this->length()); } |
| 4073 | 4083 |
| 4074 | 4084 |
| 4075 ACCESSORS(FixedTypedArrayBase, base_pointer, Object, kBasePointerOffset) | 4085 ACCESSORS(FixedTypedArrayBase, base_pointer, Object, kBasePointerOffset) |
| 4076 | 4086 |
| (...skipping 3787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7864 #undef READ_INT64_FIELD | 7874 #undef READ_INT64_FIELD |
| 7865 #undef WRITE_INT64_FIELD | 7875 #undef WRITE_INT64_FIELD |
| 7866 #undef READ_BYTE_FIELD | 7876 #undef READ_BYTE_FIELD |
| 7867 #undef WRITE_BYTE_FIELD | 7877 #undef WRITE_BYTE_FIELD |
| 7868 #undef NOBARRIER_READ_BYTE_FIELD | 7878 #undef NOBARRIER_READ_BYTE_FIELD |
| 7869 #undef NOBARRIER_WRITE_BYTE_FIELD | 7879 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7870 | 7880 |
| 7871 } } // namespace v8::internal | 7881 } } // namespace v8::internal |
| 7872 | 7882 |
| 7873 #endif // V8_OBJECTS_INL_H_ | 7883 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |