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 4063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4074 DCHECK(IsAligned(frame_size, static_cast<unsigned>(kPointerSize))); | 4074 DCHECK(IsAligned(frame_size, static_cast<unsigned>(kPointerSize))); |
4075 WRITE_INT_FIELD(this, kFrameSizeOffset, frame_size); | 4075 WRITE_INT_FIELD(this, kFrameSizeOffset, frame_size); |
4076 } | 4076 } |
4077 | 4077 |
4078 | 4078 |
4079 int BytecodeArray::frame_size() const { | 4079 int BytecodeArray::frame_size() const { |
4080 return READ_INT_FIELD(this, kFrameSizeOffset); | 4080 return READ_INT_FIELD(this, kFrameSizeOffset); |
4081 } | 4081 } |
4082 | 4082 |
4083 | 4083 |
| 4084 int BytecodeArray::local_count() const { return frame_size() / kPointerSize; } |
| 4085 |
| 4086 |
4084 void BytecodeArray::set_parameter_count(int number_of_parameters) { | 4087 void BytecodeArray::set_parameter_count(int number_of_parameters) { |
4085 DCHECK_GE(number_of_parameters, 0); | 4088 DCHECK_GE(number_of_parameters, 0); |
4086 // Parameter count is stored as the size on stack of the parameters to allow | 4089 // Parameter count is stored as the size on stack of the parameters to allow |
4087 // it to be used directly by generated code. | 4090 // it to be used directly by generated code. |
4088 WRITE_INT_FIELD(this, kParameterSizeOffset, | 4091 WRITE_INT_FIELD(this, kParameterSizeOffset, |
4089 (number_of_parameters << kPointerSizeLog2)); | 4092 (number_of_parameters << kPointerSizeLog2)); |
4090 } | 4093 } |
4091 | 4094 |
4092 | 4095 |
4093 int BytecodeArray::parameter_count() const { | 4096 int BytecodeArray::parameter_count() const { |
(...skipping 3792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7886 #undef READ_INT64_FIELD | 7889 #undef READ_INT64_FIELD |
7887 #undef WRITE_INT64_FIELD | 7890 #undef WRITE_INT64_FIELD |
7888 #undef READ_BYTE_FIELD | 7891 #undef READ_BYTE_FIELD |
7889 #undef WRITE_BYTE_FIELD | 7892 #undef WRITE_BYTE_FIELD |
7890 #undef NOBARRIER_READ_BYTE_FIELD | 7893 #undef NOBARRIER_READ_BYTE_FIELD |
7891 #undef NOBARRIER_WRITE_BYTE_FIELD | 7894 #undef NOBARRIER_WRITE_BYTE_FIELD |
7892 | 7895 |
7893 } } // namespace v8::internal | 7896 } } // namespace v8::internal |
7894 | 7897 |
7895 #endif // V8_OBJECTS_INL_H_ | 7898 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |