| 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 4040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4051 DCHECK(IsAligned(frame_size, static_cast<unsigned>(kPointerSize))); | 4051 DCHECK(IsAligned(frame_size, static_cast<unsigned>(kPointerSize))); |
| 4052 WRITE_INT_FIELD(this, kFrameSizeOffset, frame_size); | 4052 WRITE_INT_FIELD(this, kFrameSizeOffset, frame_size); |
| 4053 } | 4053 } |
| 4054 | 4054 |
| 4055 | 4055 |
| 4056 int BytecodeArray::frame_size() const { | 4056 int BytecodeArray::frame_size() const { |
| 4057 return READ_INT_FIELD(this, kFrameSizeOffset); | 4057 return READ_INT_FIELD(this, kFrameSizeOffset); |
| 4058 } | 4058 } |
| 4059 | 4059 |
| 4060 | 4060 |
| 4061 void BytecodeArray::set_parameter_count(int number_of_parameters) { |
| 4062 DCHECK_GE(number_of_parameters, 0); |
| 4063 // Parameter count is stored as the size on stack of the parameters to allow |
| 4064 // it to be used directly by generated code. |
| 4065 WRITE_INT_FIELD(this, kParameterSizeOffset, |
| 4066 (number_of_parameters << kPointerSizeLog2)); |
| 4067 } |
| 4068 |
| 4069 |
| 4070 int BytecodeArray::parameter_count() const { |
| 4071 // Parameter count is stored as the size on stack of the parameters to allow |
| 4072 // it to be used directly by generated code. |
| 4073 return READ_INT_FIELD(this, kParameterSizeOffset) >> kPointerSizeLog2; |
| 4074 } |
| 4075 |
| 4076 |
| 4061 Address BytecodeArray::GetFirstBytecodeAddress() { | 4077 Address BytecodeArray::GetFirstBytecodeAddress() { |
| 4062 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; | 4078 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; |
| 4063 } | 4079 } |
| 4064 | 4080 |
| 4065 | 4081 |
| 4066 int BytecodeArray::BytecodeArraySize() { return SizeFor(this->length()); } | 4082 int BytecodeArray::BytecodeArraySize() { return SizeFor(this->length()); } |
| 4067 | 4083 |
| 4068 | 4084 |
| 4069 ACCESSORS(FixedTypedArrayBase, base_pointer, Object, kBasePointerOffset) | 4085 ACCESSORS(FixedTypedArrayBase, base_pointer, Object, kBasePointerOffset) |
| 4070 | 4086 |
| (...skipping 3787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7858 #undef READ_INT64_FIELD | 7874 #undef READ_INT64_FIELD |
| 7859 #undef WRITE_INT64_FIELD | 7875 #undef WRITE_INT64_FIELD |
| 7860 #undef READ_BYTE_FIELD | 7876 #undef READ_BYTE_FIELD |
| 7861 #undef WRITE_BYTE_FIELD | 7877 #undef WRITE_BYTE_FIELD |
| 7862 #undef NOBARRIER_READ_BYTE_FIELD | 7878 #undef NOBARRIER_READ_BYTE_FIELD |
| 7863 #undef NOBARRIER_WRITE_BYTE_FIELD | 7879 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7864 | 7880 |
| 7865 } } // namespace v8::internal | 7881 } } // namespace v8::internal |
| 7866 | 7882 |
| 7867 #endif // V8_OBJECTS_INL_H_ | 7883 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |