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 4489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4500 inline void Code::set_can_have_weak_objects(bool value) { | 4500 inline void Code::set_can_have_weak_objects(bool value) { |
4501 DCHECK(kind() == OPTIMIZED_FUNCTION); | 4501 DCHECK(kind() == OPTIMIZED_FUNCTION); |
4502 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | 4502 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); |
4503 int updated = CanHaveWeakObjectsField::update(previous, value); | 4503 int updated = CanHaveWeakObjectsField::update(previous, value); |
4504 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | 4504 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); |
4505 } | 4505 } |
4506 | 4506 |
4507 | 4507 |
4508 bool Code::has_deoptimization_support() { | 4508 bool Code::has_deoptimization_support() { |
4509 DCHECK_EQ(FUNCTION, kind()); | 4509 DCHECK_EQ(FUNCTION, kind()); |
4510 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags); | 4510 unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags); |
4511 return FullCodeFlagsHasDeoptimizationSupportField::decode(flags); | 4511 return FullCodeFlagsHasDeoptimizationSupportField::decode(flags); |
4512 } | 4512 } |
4513 | 4513 |
4514 | 4514 |
4515 void Code::set_has_deoptimization_support(bool value) { | 4515 void Code::set_has_deoptimization_support(bool value) { |
4516 DCHECK_EQ(FUNCTION, kind()); | 4516 DCHECK_EQ(FUNCTION, kind()); |
4517 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags); | 4517 unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags); |
4518 flags = FullCodeFlagsHasDeoptimizationSupportField::update(flags, value); | 4518 flags = FullCodeFlagsHasDeoptimizationSupportField::update(flags, value); |
4519 WRITE_BYTE_FIELD(this, kFullCodeFlags, flags); | 4519 WRITE_UINT32_FIELD(this, kFullCodeFlags, flags); |
4520 } | 4520 } |
4521 | 4521 |
4522 | 4522 |
4523 bool Code::has_debug_break_slots() { | 4523 bool Code::has_debug_break_slots() { |
4524 DCHECK_EQ(FUNCTION, kind()); | 4524 DCHECK_EQ(FUNCTION, kind()); |
4525 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags); | 4525 unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags); |
4526 return FullCodeFlagsHasDebugBreakSlotsField::decode(flags); | 4526 return FullCodeFlagsHasDebugBreakSlotsField::decode(flags); |
4527 } | 4527 } |
4528 | 4528 |
4529 | 4529 |
4530 void Code::set_has_debug_break_slots(bool value) { | 4530 void Code::set_has_debug_break_slots(bool value) { |
4531 DCHECK_EQ(FUNCTION, kind()); | 4531 DCHECK_EQ(FUNCTION, kind()); |
4532 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags); | 4532 unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags); |
4533 flags = FullCodeFlagsHasDebugBreakSlotsField::update(flags, value); | 4533 flags = FullCodeFlagsHasDebugBreakSlotsField::update(flags, value); |
4534 WRITE_BYTE_FIELD(this, kFullCodeFlags, flags); | 4534 WRITE_UINT32_FIELD(this, kFullCodeFlags, flags); |
4535 } | 4535 } |
4536 | 4536 |
4537 | 4537 |
4538 bool Code::is_compiled_optimizable() { | 4538 bool Code::is_compiled_optimizable() { |
4539 DCHECK_EQ(FUNCTION, kind()); | 4539 DCHECK_EQ(FUNCTION, kind()); |
4540 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags); | 4540 unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags); |
4541 return FullCodeFlagsIsCompiledOptimizable::decode(flags); | 4541 return FullCodeFlagsIsCompiledOptimizable::decode(flags); |
4542 } | 4542 } |
4543 | 4543 |
4544 | 4544 |
4545 void Code::set_compiled_optimizable(bool value) { | 4545 void Code::set_compiled_optimizable(bool value) { |
4546 DCHECK_EQ(FUNCTION, kind()); | 4546 DCHECK_EQ(FUNCTION, kind()); |
4547 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags); | 4547 unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags); |
4548 flags = FullCodeFlagsIsCompiledOptimizable::update(flags, value); | 4548 flags = FullCodeFlagsIsCompiledOptimizable::update(flags, value); |
4549 WRITE_BYTE_FIELD(this, kFullCodeFlags, flags); | 4549 WRITE_UINT32_FIELD(this, kFullCodeFlags, flags); |
4550 } | 4550 } |
4551 | 4551 |
4552 | 4552 |
4553 bool Code::has_reloc_info_for_serialization() { | 4553 bool Code::has_reloc_info_for_serialization() { |
4554 DCHECK_EQ(FUNCTION, kind()); | 4554 DCHECK_EQ(FUNCTION, kind()); |
4555 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags); | 4555 unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags); |
4556 return FullCodeFlagsHasRelocInfoForSerialization::decode(flags); | 4556 return FullCodeFlagsHasRelocInfoForSerialization::decode(flags); |
4557 } | 4557 } |
4558 | 4558 |
4559 | 4559 |
4560 void Code::set_has_reloc_info_for_serialization(bool value) { | 4560 void Code::set_has_reloc_info_for_serialization(bool value) { |
4561 DCHECK_EQ(FUNCTION, kind()); | 4561 DCHECK_EQ(FUNCTION, kind()); |
4562 byte flags = READ_BYTE_FIELD(this, kFullCodeFlags); | 4562 unsigned flags = READ_UINT32_FIELD(this, kFullCodeFlags); |
4563 flags = FullCodeFlagsHasRelocInfoForSerialization::update(flags, value); | 4563 flags = FullCodeFlagsHasRelocInfoForSerialization::update(flags, value); |
4564 WRITE_BYTE_FIELD(this, kFullCodeFlags, flags); | 4564 WRITE_UINT32_FIELD(this, kFullCodeFlags, flags); |
4565 } | 4565 } |
4566 | 4566 |
4567 | 4567 |
4568 int Code::allow_osr_at_loop_nesting_level() { | 4568 int Code::allow_osr_at_loop_nesting_level() { |
4569 DCHECK_EQ(FUNCTION, kind()); | 4569 DCHECK_EQ(FUNCTION, kind()); |
4570 int fields = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); | 4570 int fields = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); |
4571 return AllowOSRAtLoopNestingLevelField::decode(fields); | 4571 return AllowOSRAtLoopNestingLevelField::decode(fields); |
4572 } | 4572 } |
4573 | 4573 |
4574 | 4574 |
(...skipping 2722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7297 #undef READ_SHORT_FIELD | 7297 #undef READ_SHORT_FIELD |
7298 #undef WRITE_SHORT_FIELD | 7298 #undef WRITE_SHORT_FIELD |
7299 #undef READ_BYTE_FIELD | 7299 #undef READ_BYTE_FIELD |
7300 #undef WRITE_BYTE_FIELD | 7300 #undef WRITE_BYTE_FIELD |
7301 #undef NOBARRIER_READ_BYTE_FIELD | 7301 #undef NOBARRIER_READ_BYTE_FIELD |
7302 #undef NOBARRIER_WRITE_BYTE_FIELD | 7302 #undef NOBARRIER_WRITE_BYTE_FIELD |
7303 | 7303 |
7304 } } // namespace v8::internal | 7304 } } // namespace v8::internal |
7305 | 7305 |
7306 #endif // V8_OBJECTS_INL_H_ | 7306 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |