| 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 4077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4088 | 4088 |
| 4089 int BytecodeArray::interrupt_budget() const { | 4089 int BytecodeArray::interrupt_budget() const { |
| 4090 return READ_INT_FIELD(this, kInterruptBudgetOffset); | 4090 return READ_INT_FIELD(this, kInterruptBudgetOffset); |
| 4091 } | 4091 } |
| 4092 | 4092 |
| 4093 void BytecodeArray::set_interrupt_budget(int interrupt_budget) { | 4093 void BytecodeArray::set_interrupt_budget(int interrupt_budget) { |
| 4094 DCHECK_GE(interrupt_budget, 0); | 4094 DCHECK_GE(interrupt_budget, 0); |
| 4095 WRITE_INT_FIELD(this, kInterruptBudgetOffset, interrupt_budget); | 4095 WRITE_INT_FIELD(this, kInterruptBudgetOffset, interrupt_budget); |
| 4096 } | 4096 } |
| 4097 | 4097 |
| 4098 int BytecodeArray::osr_loop_nesting_level() const { |
| 4099 return READ_INT_FIELD(this, kOSRNestingLevelOffset); |
| 4100 } |
| 4101 |
| 4102 void BytecodeArray::set_osr_loop_nesting_level(int depth) { |
| 4103 DCHECK(0 <= depth && depth <= AbstractCode::kMaxLoopNestingMarker); |
| 4104 WRITE_INT_FIELD(this, kOSRNestingLevelOffset, depth); |
| 4105 } |
| 4106 |
| 4098 int BytecodeArray::parameter_count() const { | 4107 int BytecodeArray::parameter_count() const { |
| 4099 // Parameter count is stored as the size on stack of the parameters to allow | 4108 // Parameter count is stored as the size on stack of the parameters to allow |
| 4100 // it to be used directly by generated code. | 4109 // it to be used directly by generated code. |
| 4101 return READ_INT_FIELD(this, kParameterSizeOffset) >> kPointerSizeLog2; | 4110 return READ_INT_FIELD(this, kParameterSizeOffset) >> kPointerSizeLog2; |
| 4102 } | 4111 } |
| 4103 | 4112 |
| 4104 | 4113 |
| 4105 ACCESSORS(BytecodeArray, constant_pool, FixedArray, kConstantPoolOffset) | 4114 ACCESSORS(BytecodeArray, constant_pool, FixedArray, kConstantPoolOffset) |
| 4106 ACCESSORS(BytecodeArray, handler_table, FixedArray, kHandlerTableOffset) | 4115 ACCESSORS(BytecodeArray, handler_table, FixedArray, kHandlerTableOffset) |
| 4107 ACCESSORS(BytecodeArray, source_position_table, ByteArray, | 4116 ACCESSORS(BytecodeArray, source_position_table, ByteArray, |
| (...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5046 | 5055 |
| 5047 int Code::allow_osr_at_loop_nesting_level() { | 5056 int Code::allow_osr_at_loop_nesting_level() { |
| 5048 DCHECK_EQ(FUNCTION, kind()); | 5057 DCHECK_EQ(FUNCTION, kind()); |
| 5049 int fields = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); | 5058 int fields = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); |
| 5050 return AllowOSRAtLoopNestingLevelField::decode(fields); | 5059 return AllowOSRAtLoopNestingLevelField::decode(fields); |
| 5051 } | 5060 } |
| 5052 | 5061 |
| 5053 | 5062 |
| 5054 void Code::set_allow_osr_at_loop_nesting_level(int level) { | 5063 void Code::set_allow_osr_at_loop_nesting_level(int level) { |
| 5055 DCHECK_EQ(FUNCTION, kind()); | 5064 DCHECK_EQ(FUNCTION, kind()); |
| 5056 DCHECK(level >= 0 && level <= kMaxLoopNestingMarker); | 5065 DCHECK(level >= 0 && level <= AbstractCode::kMaxLoopNestingMarker); |
| 5057 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); | 5066 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); |
| 5058 int updated = AllowOSRAtLoopNestingLevelField::update(previous, level); | 5067 int updated = AllowOSRAtLoopNestingLevelField::update(previous, level); |
| 5059 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); | 5068 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); |
| 5060 } | 5069 } |
| 5061 | 5070 |
| 5062 | 5071 |
| 5063 int Code::profiler_ticks() { | 5072 int Code::profiler_ticks() { |
| 5064 DCHECK_EQ(FUNCTION, kind()); | 5073 DCHECK_EQ(FUNCTION, kind()); |
| 5065 return ProfilerTicksField::decode( | 5074 return ProfilerTicksField::decode( |
| 5066 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); | 5075 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); |
| (...skipping 3047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8114 #undef WRITE_INT64_FIELD | 8123 #undef WRITE_INT64_FIELD |
| 8115 #undef READ_BYTE_FIELD | 8124 #undef READ_BYTE_FIELD |
| 8116 #undef WRITE_BYTE_FIELD | 8125 #undef WRITE_BYTE_FIELD |
| 8117 #undef NOBARRIER_READ_BYTE_FIELD | 8126 #undef NOBARRIER_READ_BYTE_FIELD |
| 8118 #undef NOBARRIER_WRITE_BYTE_FIELD | 8127 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 8119 | 8128 |
| 8120 } // namespace internal | 8129 } // namespace internal |
| 8121 } // namespace v8 | 8130 } // namespace v8 |
| 8122 | 8131 |
| 8123 #endif // V8_OBJECTS_INL_H_ | 8132 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |