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 4907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4918 | 4918 |
4919 | 4919 |
4920 void Code::set_profiler_ticks(int ticks) { | 4920 void Code::set_profiler_ticks(int ticks) { |
4921 if (kind() == FUNCTION) { | 4921 if (kind() == FUNCTION) { |
4922 unsigned previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | 4922 unsigned previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); |
4923 unsigned updated = ProfilerTicksField::update(previous, ticks); | 4923 unsigned updated = ProfilerTicksField::update(previous, ticks); |
4924 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | 4924 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); |
4925 } | 4925 } |
4926 } | 4926 } |
4927 | 4927 |
| 4928 int Code::builtin_index() { return READ_INT_FIELD(this, kBuiltinIndexOffset); } |
4928 | 4929 |
4929 int Code::builtin_index() { | 4930 void Code::set_builtin_index(int index) { |
4930 return READ_INT32_FIELD(this, kKindSpecificFlags1Offset); | 4931 WRITE_INT_FIELD(this, kBuiltinIndexOffset, index); |
4931 } | 4932 } |
4932 | 4933 |
4933 | 4934 |
4934 void Code::set_builtin_index(int index) { | |
4935 WRITE_INT32_FIELD(this, kKindSpecificFlags1Offset, index); | |
4936 } | |
4937 | |
4938 | |
4939 unsigned Code::stack_slots() { | 4935 unsigned Code::stack_slots() { |
4940 DCHECK(is_crankshafted()); | 4936 DCHECK(is_crankshafted()); |
4941 return StackSlotsField::decode( | 4937 return StackSlotsField::decode( |
4942 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); | 4938 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); |
4943 } | 4939 } |
4944 | 4940 |
4945 | 4941 |
4946 void Code::set_stack_slots(unsigned slots) { | 4942 void Code::set_stack_slots(unsigned slots) { |
4947 CHECK(slots <= (1 << kStackSlotsBitCount)); | 4943 CHECK(slots <= (1 << kStackSlotsBitCount)); |
4948 DCHECK(is_crankshafted()); | 4944 DCHECK(is_crankshafted()); |
(...skipping 2856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7805 #undef WRITE_INT64_FIELD | 7801 #undef WRITE_INT64_FIELD |
7806 #undef READ_BYTE_FIELD | 7802 #undef READ_BYTE_FIELD |
7807 #undef WRITE_BYTE_FIELD | 7803 #undef WRITE_BYTE_FIELD |
7808 #undef NOBARRIER_READ_BYTE_FIELD | 7804 #undef NOBARRIER_READ_BYTE_FIELD |
7809 #undef NOBARRIER_WRITE_BYTE_FIELD | 7805 #undef NOBARRIER_WRITE_BYTE_FIELD |
7810 | 7806 |
7811 } // namespace internal | 7807 } // namespace internal |
7812 } // namespace v8 | 7808 } // namespace v8 |
7813 | 7809 |
7814 #endif // V8_OBJECTS_INL_H_ | 7810 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |