Chromium Code Reviews| Index: src/objects-inl.h |
| diff --git a/src/objects-inl.h b/src/objects-inl.h |
| index fac56495a0048ab66f4678fad43bce600df9050f..8e522a4363547ec2897d70fd038eb438a25b422d 100644 |
| --- a/src/objects-inl.h |
| +++ b/src/objects-inl.h |
| @@ -4887,6 +4887,16 @@ inline bool Code::is_interpreter_trampoline_builtin() { |
| this == *builtins->InterpreterMarkBaselineOnReturn(); |
| } |
| +inline bool Code::has_unwinding_info() const { |
| + return HasUnwindingInfoField::decode(READ_UINT32_FIELD(this, kFlagsOffset)); |
| +} |
| + |
| +inline void Code::set_has_unwinding_info(bool state) { |
| + uint32_t previous = READ_UINT32_FIELD(this, kFlagsOffset); |
| + uint32_t updated_value = HasUnwindingInfoField::update(previous, state); |
| + WRITE_UINT32_FIELD(this, kFlagsOffset, updated_value); |
| +} |
| + |
| inline void Code::set_is_crankshafted(bool value) { |
| int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); |
| int updated = IsCrankshaftedField::update(previous, value); |
| @@ -6409,6 +6419,17 @@ ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset) |
| ACCESSORS(Code, raw_type_feedback_info, Object, kTypeFeedbackInfoOffset) |
| ACCESSORS(Code, next_code_link, Object, kNextCodeLinkOffset) |
| +int Code::unwinding_info_size() const { |
| + DCHECK(has_unwinding_info()); |
| + int field_offset = RoundUp(kHeaderSize + instruction_size(), kInt64Size); |
| + return static_cast<int>(READ_UINT64_FIELD(this, field_offset)); |
| +} |
| + |
| +void Code::set_unwinding_info_size(int value) { |
| + DCHECK(has_unwinding_info()); |
| + int field_offset = RoundUp(kHeaderSize + instruction_size(), kInt64Size); |
|
rmcilroy
2016/06/21 13:47:43
Factor out the code to get the offset of the unwin
Stefano Sanfilippo
2016/06/23 15:23:43
Done.
|
| + WRITE_UINT64_FIELD(this, field_offset, value); |
| +} |
| void Code::WipeOutHeader() { |
| WRITE_FIELD(this, kRelocationInfoOffset, NULL); |
| @@ -6463,9 +6484,22 @@ byte* Code::instruction_end() { |
| return instruction_start() + instruction_size(); |
| } |
| +byte* Code::unwinding_info_start() { |
| + DCHECK(has_unwinding_info()); |
| + return RoundUp(instruction_end(), kInt64Size) + kInt64Size; |
| +} |
| + |
| +byte* Code::unwinding_info_end() { |
| + DCHECK(has_unwinding_info()); |
| + return unwinding_info_start() + unwinding_info_size(); |
| +} |
| int Code::body_size() { |
| - return RoundUp(instruction_size(), kObjectAlignment); |
| + int unpadded_body_size = |
| + has_unwinding_info() |
| + ? static_cast<int>(unwinding_info_end() - instruction_start()) |
| + : instruction_size(); |
| + return RoundUp(unpadded_body_size, kObjectAlignment); |
| } |
| int Code::SizeIncludingMetadata() { |