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 4584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4595 DCHECK_EQ(FUNCTION, kind()); | 4595 DCHECK_EQ(FUNCTION, kind()); |
4596 DCHECK(level >= 0 && level <= kMaxLoopNestingMarker); | 4596 DCHECK(level >= 0 && level <= kMaxLoopNestingMarker); |
4597 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); | 4597 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); |
4598 int updated = AllowOSRAtLoopNestingLevelField::update(previous, level); | 4598 int updated = AllowOSRAtLoopNestingLevelField::update(previous, level); |
4599 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); | 4599 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); |
4600 } | 4600 } |
4601 | 4601 |
4602 | 4602 |
4603 int Code::profiler_ticks() { | 4603 int Code::profiler_ticks() { |
4604 DCHECK_EQ(FUNCTION, kind()); | 4604 DCHECK_EQ(FUNCTION, kind()); |
4605 return READ_BYTE_FIELD(this, kProfilerTicksOffset); | 4605 return ProfilerTicksField::decode( |
| 4606 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); |
4606 } | 4607 } |
4607 | 4608 |
4608 | 4609 |
4609 void Code::set_profiler_ticks(int ticks) { | 4610 void Code::set_profiler_ticks(int ticks) { |
4610 DCHECK(ticks < 256); | |
4611 if (kind() == FUNCTION) { | 4611 if (kind() == FUNCTION) { |
4612 WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks); | 4612 unsigned previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); |
| 4613 unsigned updated = ProfilerTicksField::update(previous, ticks); |
| 4614 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); |
4613 } | 4615 } |
4614 } | 4616 } |
4615 | 4617 |
4616 | 4618 |
4617 int Code::builtin_index() { | 4619 int Code::builtin_index() { |
4618 return READ_INT32_FIELD(this, kKindSpecificFlags1Offset); | 4620 return READ_INT32_FIELD(this, kKindSpecificFlags1Offset); |
4619 } | 4621 } |
4620 | 4622 |
4621 | 4623 |
4622 void Code::set_builtin_index(int index) { | 4624 void Code::set_builtin_index(int index) { |
(...skipping 2691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7314 #undef READ_SHORT_FIELD | 7316 #undef READ_SHORT_FIELD |
7315 #undef WRITE_SHORT_FIELD | 7317 #undef WRITE_SHORT_FIELD |
7316 #undef READ_BYTE_FIELD | 7318 #undef READ_BYTE_FIELD |
7317 #undef WRITE_BYTE_FIELD | 7319 #undef WRITE_BYTE_FIELD |
7318 #undef NOBARRIER_READ_BYTE_FIELD | 7320 #undef NOBARRIER_READ_BYTE_FIELD |
7319 #undef NOBARRIER_WRITE_BYTE_FIELD | 7321 #undef NOBARRIER_WRITE_BYTE_FIELD |
7320 | 7322 |
7321 } } // namespace v8::internal | 7323 } } // namespace v8::internal |
7322 | 7324 |
7323 #endif // V8_OBJECTS_INL_H_ | 7325 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |