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 4759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4770 } | 4770 } |
4771 | 4771 |
4772 | 4772 |
4773 int Code::profiler_ticks() { | 4773 int Code::profiler_ticks() { |
4774 DCHECK_EQ(FUNCTION, kind()); | 4774 DCHECK_EQ(FUNCTION, kind()); |
4775 return READ_BYTE_FIELD(this, kProfilerTicksOffset); | 4775 return READ_BYTE_FIELD(this, kProfilerTicksOffset); |
4776 } | 4776 } |
4777 | 4777 |
4778 | 4778 |
4779 void Code::set_profiler_ticks(int ticks) { | 4779 void Code::set_profiler_ticks(int ticks) { |
4780 DCHECK_EQ(FUNCTION, kind()); | |
4781 DCHECK(ticks < 256); | 4780 DCHECK(ticks < 256); |
4782 WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks); | 4781 if (kind() == FUNCTION) { |
| 4782 WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks); |
| 4783 } |
4783 } | 4784 } |
4784 | 4785 |
4785 | 4786 |
4786 int Code::builtin_index() { | 4787 int Code::builtin_index() { |
4787 DCHECK_EQ(BUILTIN, kind()); | 4788 DCHECK_EQ(BUILTIN, kind()); |
4788 return READ_INT32_FIELD(this, kKindSpecificFlags1Offset); | 4789 return READ_INT32_FIELD(this, kKindSpecificFlags1Offset); |
4789 } | 4790 } |
4790 | 4791 |
4791 | 4792 |
4792 void Code::set_builtin_index(int index) { | 4793 void Code::set_builtin_index(int index) { |
(...skipping 2456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7249 #undef READ_SHORT_FIELD | 7250 #undef READ_SHORT_FIELD |
7250 #undef WRITE_SHORT_FIELD | 7251 #undef WRITE_SHORT_FIELD |
7251 #undef READ_BYTE_FIELD | 7252 #undef READ_BYTE_FIELD |
7252 #undef WRITE_BYTE_FIELD | 7253 #undef WRITE_BYTE_FIELD |
7253 #undef NOBARRIER_READ_BYTE_FIELD | 7254 #undef NOBARRIER_READ_BYTE_FIELD |
7254 #undef NOBARRIER_WRITE_BYTE_FIELD | 7255 #undef NOBARRIER_WRITE_BYTE_FIELD |
7255 | 7256 |
7256 } } // namespace v8::internal | 7257 } } // namespace v8::internal |
7257 | 7258 |
7258 #endif // V8_OBJECTS_INL_H_ | 7259 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |