| 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 2537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4027 | 4029 |
| 4028 | 4030 |
| 4029 int ByteArray::ByteArraySize() { return SizeFor(this->length()); } | 4031 int ByteArray::ByteArraySize() { return SizeFor(this->length()); } |
| 4030 | 4032 |
| 4031 | 4033 |
| 4032 Address ByteArray::GetDataStartAddress() { | 4034 Address ByteArray::GetDataStartAddress() { |
| 4033 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; | 4035 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; |
| 4034 } | 4036 } |
| 4035 | 4037 |
| 4036 | 4038 |
| 4039 void BytecodeArray::BytecodeArrayIterateBody(ObjectVisitor* v) { |
| 4040 IteratePointer(v, kConstantPoolOffset); |
| 4041 } |
| 4042 |
| 4043 |
| 4037 byte BytecodeArray::get(int index) { | 4044 byte BytecodeArray::get(int index) { |
| 4038 DCHECK(index >= 0 && index < this->length()); | 4045 DCHECK(index >= 0 && index < this->length()); |
| 4039 return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize); | 4046 return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize); |
| 4040 } | 4047 } |
| 4041 | 4048 |
| 4042 | 4049 |
| 4043 void BytecodeArray::set(int index, byte value) { | 4050 void BytecodeArray::set(int index, byte value) { |
| 4044 DCHECK(index >= 0 && index < this->length()); | 4051 DCHECK(index >= 0 && index < this->length()); |
| 4045 WRITE_BYTE_FIELD(this, kHeaderSize + index * kCharSize, value); | 4052 WRITE_BYTE_FIELD(this, kHeaderSize + index * kCharSize, value); |
| 4046 } | 4053 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 4067 } | 4074 } |
| 4068 | 4075 |
| 4069 | 4076 |
| 4070 int BytecodeArray::parameter_count() const { | 4077 int BytecodeArray::parameter_count() const { |
| 4071 // Parameter count is stored as the size on stack of the parameters to allow | 4078 // Parameter count is stored as the size on stack of the parameters to allow |
| 4072 // it to be used directly by generated code. | 4079 // it to be used directly by generated code. |
| 4073 return READ_INT_FIELD(this, kParameterSizeOffset) >> kPointerSizeLog2; | 4080 return READ_INT_FIELD(this, kParameterSizeOffset) >> kPointerSizeLog2; |
| 4074 } | 4081 } |
| 4075 | 4082 |
| 4076 | 4083 |
| 4084 ACCESSORS(BytecodeArray, constant_pool, FixedArray, kConstantPoolOffset) |
| 4085 |
| 4086 |
| 4077 Address BytecodeArray::GetFirstBytecodeAddress() { | 4087 Address BytecodeArray::GetFirstBytecodeAddress() { |
| 4078 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; | 4088 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; |
| 4079 } | 4089 } |
| 4080 | 4090 |
| 4081 | 4091 |
| 4082 int BytecodeArray::BytecodeArraySize() { return SizeFor(this->length()); } | 4092 int BytecodeArray::BytecodeArraySize() { return SizeFor(this->length()); } |
| 4083 | 4093 |
| 4084 | 4094 |
| 4085 ACCESSORS(FixedTypedArrayBase, base_pointer, Object, kBasePointerOffset) | 4095 ACCESSORS(FixedTypedArrayBase, base_pointer, Object, kBasePointerOffset) |
| 4086 | 4096 |
| (...skipping 3787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7874 #undef READ_INT64_FIELD | 7884 #undef READ_INT64_FIELD |
| 7875 #undef WRITE_INT64_FIELD | 7885 #undef WRITE_INT64_FIELD |
| 7876 #undef READ_BYTE_FIELD | 7886 #undef READ_BYTE_FIELD |
| 7877 #undef WRITE_BYTE_FIELD | 7887 #undef WRITE_BYTE_FIELD |
| 7878 #undef NOBARRIER_READ_BYTE_FIELD | 7888 #undef NOBARRIER_READ_BYTE_FIELD |
| 7879 #undef NOBARRIER_WRITE_BYTE_FIELD | 7889 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7880 | 7890 |
| 7881 } } // namespace v8::internal | 7891 } } // namespace v8::internal |
| 7882 | 7892 |
| 7883 #endif // V8_OBJECTS_INL_H_ | 7893 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |