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 4209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4220 STATIC_ASSERT(AbstractCode::kMaxLoopNestingMarker < kMaxInt8); | 4220 STATIC_ASSERT(AbstractCode::kMaxLoopNestingMarker < kMaxInt8); |
4221 WRITE_INT8_FIELD(this, kOSRNestingLevelOffset, depth); | 4221 WRITE_INT8_FIELD(this, kOSRNestingLevelOffset, depth); |
4222 } | 4222 } |
4223 | 4223 |
4224 int BytecodeArray::parameter_count() const { | 4224 int BytecodeArray::parameter_count() const { |
4225 // Parameter count is stored as the size on stack of the parameters to allow | 4225 // Parameter count is stored as the size on stack of the parameters to allow |
4226 // it to be used directly by generated code. | 4226 // it to be used directly by generated code. |
4227 return READ_INT_FIELD(this, kParameterSizeOffset) >> kPointerSizeLog2; | 4227 return READ_INT_FIELD(this, kParameterSizeOffset) >> kPointerSizeLog2; |
4228 } | 4228 } |
4229 | 4229 |
4230 | |
4231 ACCESSORS(BytecodeArray, constant_pool, FixedArray, kConstantPoolOffset) | 4230 ACCESSORS(BytecodeArray, constant_pool, FixedArray, kConstantPoolOffset) |
4232 ACCESSORS(BytecodeArray, handler_table, FixedArray, kHandlerTableOffset) | 4231 ACCESSORS(BytecodeArray, handler_table, FixedArray, kHandlerTableOffset) |
4233 ACCESSORS(BytecodeArray, source_position_table, ByteArray, | 4232 ACCESSORS(BytecodeArray, source_position_table, ByteArray, |
4234 kSourcePositionTableOffset) | 4233 kSourcePositionTableOffset) |
4235 | 4234 |
4236 Address BytecodeArray::GetFirstBytecodeAddress() { | 4235 Address BytecodeArray::GetFirstBytecodeAddress() { |
4237 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; | 4236 return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize; |
4238 } | 4237 } |
4239 | 4238 |
4240 | 4239 |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5118 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); | 5117 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); |
5119 } | 5118 } |
5120 | 5119 |
5121 inline void Code::set_is_construct_stub(bool value) { | 5120 inline void Code::set_is_construct_stub(bool value) { |
5122 DCHECK(kind() == BUILTIN); | 5121 DCHECK(kind() == BUILTIN); |
5123 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | 5122 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); |
5124 int updated = IsConstructStubField::update(previous, value); | 5123 int updated = IsConstructStubField::update(previous, value); |
5125 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | 5124 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); |
5126 } | 5125 } |
5127 | 5126 |
| 5127 inline bool Code::is_promise_rejection() { |
| 5128 DCHECK(kind() == BUILTIN); |
| 5129 return IsPromiseRejectionField::decode( |
| 5130 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); |
| 5131 } |
| 5132 |
| 5133 inline void Code::set_is_promise_rejection(bool value) { |
| 5134 DCHECK(kind() == BUILTIN); |
| 5135 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); |
| 5136 int updated = IsPromiseRejectionField::update(previous, value); |
| 5137 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); |
| 5138 } |
| 5139 |
5128 bool Code::has_deoptimization_support() { | 5140 bool Code::has_deoptimization_support() { |
5129 DCHECK_EQ(FUNCTION, kind()); | 5141 DCHECK_EQ(FUNCTION, kind()); |
5130 unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags); | 5142 unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags); |
5131 return FullCodeFlagsHasDeoptimizationSupportField::decode(flags); | 5143 return FullCodeFlagsHasDeoptimizationSupportField::decode(flags); |
5132 } | 5144 } |
5133 | 5145 |
5134 | 5146 |
5135 void Code::set_has_deoptimization_support(bool value) { | 5147 void Code::set_has_deoptimization_support(bool value) { |
5136 DCHECK_EQ(FUNCTION, kind()); | 5148 DCHECK_EQ(FUNCTION, kind()); |
5137 unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags); | 5149 unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags); |
(...skipping 3306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8444 #undef WRITE_INT64_FIELD | 8456 #undef WRITE_INT64_FIELD |
8445 #undef READ_BYTE_FIELD | 8457 #undef READ_BYTE_FIELD |
8446 #undef WRITE_BYTE_FIELD | 8458 #undef WRITE_BYTE_FIELD |
8447 #undef NOBARRIER_READ_BYTE_FIELD | 8459 #undef NOBARRIER_READ_BYTE_FIELD |
8448 #undef NOBARRIER_WRITE_BYTE_FIELD | 8460 #undef NOBARRIER_WRITE_BYTE_FIELD |
8449 | 8461 |
8450 } // namespace internal | 8462 } // namespace internal |
8451 } // namespace v8 | 8463 } // namespace v8 |
8452 | 8464 |
8453 #endif // V8_OBJECTS_INL_H_ | 8465 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |