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 3596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3607 } | 3607 } |
3608 | 3608 |
3609 | 3609 |
3610 void BytecodeArray::set(int index, byte value) { | 3610 void BytecodeArray::set(int index, byte value) { |
3611 DCHECK(index >= 0 && index < this->length()); | 3611 DCHECK(index >= 0 && index < this->length()); |
3612 WRITE_BYTE_FIELD(this, kHeaderSize + index * kCharSize, value); | 3612 WRITE_BYTE_FIELD(this, kHeaderSize + index * kCharSize, value); |
3613 } | 3613 } |
3614 | 3614 |
3615 | 3615 |
3616 void BytecodeArray::set_frame_size(int frame_size) { | 3616 void BytecodeArray::set_frame_size(int frame_size) { |
3617 // We need at least one stack slot for the return register. | 3617 DCHECK_GE(frame_size, 0); |
3618 DCHECK_GE(frame_size, kPointerSize); | |
3619 DCHECK(IsAligned(frame_size, static_cast<unsigned>(kPointerSize))); | 3618 DCHECK(IsAligned(frame_size, static_cast<unsigned>(kPointerSize))); |
3620 WRITE_INT_FIELD(this, kFrameSizeOffset, frame_size); | 3619 WRITE_INT_FIELD(this, kFrameSizeOffset, frame_size); |
3621 } | 3620 } |
3622 | 3621 |
3623 | 3622 |
3624 int BytecodeArray::frame_size() const { | 3623 int BytecodeArray::frame_size() const { |
3625 return READ_INT_FIELD(this, kFrameSizeOffset); | 3624 return READ_INT_FIELD(this, kFrameSizeOffset); |
3626 } | 3625 } |
3627 | 3626 |
3628 | 3627 |
(...skipping 3464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7093 #undef READ_SHORT_FIELD | 7092 #undef READ_SHORT_FIELD |
7094 #undef WRITE_SHORT_FIELD | 7093 #undef WRITE_SHORT_FIELD |
7095 #undef READ_BYTE_FIELD | 7094 #undef READ_BYTE_FIELD |
7096 #undef WRITE_BYTE_FIELD | 7095 #undef WRITE_BYTE_FIELD |
7097 #undef NOBARRIER_READ_BYTE_FIELD | 7096 #undef NOBARRIER_READ_BYTE_FIELD |
7098 #undef NOBARRIER_WRITE_BYTE_FIELD | 7097 #undef NOBARRIER_WRITE_BYTE_FIELD |
7099 | 7098 |
7100 } } // namespace v8::internal | 7099 } } // namespace v8::internal |
7101 | 7100 |
7102 #endif // V8_OBJECTS_INL_H_ | 7101 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |