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 4200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4211 int BytecodeArray::osr_loop_nesting_level() const { | 4211 int BytecodeArray::osr_loop_nesting_level() const { |
4212 return READ_INT8_FIELD(this, kOSRNestingLevelOffset); | 4212 return READ_INT8_FIELD(this, kOSRNestingLevelOffset); |
4213 } | 4213 } |
4214 | 4214 |
4215 void BytecodeArray::set_osr_loop_nesting_level(int depth) { | 4215 void BytecodeArray::set_osr_loop_nesting_level(int depth) { |
4216 DCHECK(0 <= depth && depth <= AbstractCode::kMaxLoopNestingMarker); | 4216 DCHECK(0 <= depth && depth <= AbstractCode::kMaxLoopNestingMarker); |
4217 STATIC_ASSERT(AbstractCode::kMaxLoopNestingMarker < kMaxInt8); | 4217 STATIC_ASSERT(AbstractCode::kMaxLoopNestingMarker < kMaxInt8); |
4218 WRITE_INT8_FIELD(this, kOSRNestingLevelOffset, depth); | 4218 WRITE_INT8_FIELD(this, kOSRNestingLevelOffset, depth); |
4219 } | 4219 } |
4220 | 4220 |
| 4221 BytecodeArray::Age BytecodeArray::bytecode_age() const { |
| 4222 return static_cast<Age>(READ_INT8_FIELD(this, kBytecodeAgeOffset)); |
| 4223 } |
| 4224 |
| 4225 void BytecodeArray::set_bytecode_age(BytecodeArray::Age age) { |
| 4226 DCHECK_GE(age, kFirstBytecodeAge); |
| 4227 DCHECK_LE(age, kLastBytecodeAge); |
| 4228 STATIC_ASSERT(kLastBytecodeAge <= kMaxInt8); |
| 4229 WRITE_INT8_FIELD(this, kBytecodeAgeOffset, static_cast<int8_t>(age)); |
| 4230 } |
| 4231 |
4221 int BytecodeArray::parameter_count() const { | 4232 int BytecodeArray::parameter_count() const { |
4222 // Parameter count is stored as the size on stack of the parameters to allow | 4233 // Parameter count is stored as the size on stack of the parameters to allow |
4223 // it to be used directly by generated code. | 4234 // it to be used directly by generated code. |
4224 return READ_INT_FIELD(this, kParameterSizeOffset) >> kPointerSizeLog2; | 4235 return READ_INT_FIELD(this, kParameterSizeOffset) >> kPointerSizeLog2; |
4225 } | 4236 } |
4226 | 4237 |
4227 | |
4228 ACCESSORS(BytecodeArray, constant_pool, FixedArray, kConstantPoolOffset) | 4238 ACCESSORS(BytecodeArray, constant_pool, FixedArray, kConstantPoolOffset) |
4229 ACCESSORS(BytecodeArray, handler_table, FixedArray, kHandlerTableOffset) | 4239 ACCESSORS(BytecodeArray, handler_table, FixedArray, kHandlerTableOffset) |
4230 ACCESSORS(BytecodeArray, source_position_table, ByteArray, | 4240 ACCESSORS(BytecodeArray, source_position_table, ByteArray, |
4231 kSourcePositionTableOffset) | 4241 kSourcePositionTableOffset) |
4232 | 4242 |
4233 Address BytecodeArray::GetFirstBytecodeAddress() { | 4243 Address BytecodeArray::GetFirstBytecodeAddress() { |
4234 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; | 4244 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; |
4235 } | 4245 } |
4236 | 4246 |
4237 | 4247 |
(...skipping 4197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8435 #undef WRITE_INT64_FIELD | 8445 #undef WRITE_INT64_FIELD |
8436 #undef READ_BYTE_FIELD | 8446 #undef READ_BYTE_FIELD |
8437 #undef WRITE_BYTE_FIELD | 8447 #undef WRITE_BYTE_FIELD |
8438 #undef NOBARRIER_READ_BYTE_FIELD | 8448 #undef NOBARRIER_READ_BYTE_FIELD |
8439 #undef NOBARRIER_WRITE_BYTE_FIELD | 8449 #undef NOBARRIER_WRITE_BYTE_FIELD |
8440 | 8450 |
8441 } // namespace internal | 8451 } // namespace internal |
8442 } // namespace v8 | 8452 } // namespace v8 |
8443 | 8453 |
8444 #endif // V8_OBJECTS_INL_H_ | 8454 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |