diff options
Diffstat (limited to 'deps/v8/src/objects/code-inl.h')
-rw-r--r-- | deps/v8/src/objects/code-inl.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/deps/v8/src/objects/code-inl.h b/deps/v8/src/objects/code-inl.h index 81db1745c4a..1af186f3e7e 100644 --- a/deps/v8/src/objects/code-inl.h +++ b/deps/v8/src/objects/code-inl.h @@ -454,6 +454,17 @@ void Code::set_builtin_index(int index) { bool Code::is_builtin() const { return builtin_index() != -1; } +unsigned Code::inlined_bytecode_size() const { + DCHECK(kind() == OPTIMIZED_FUNCTION || + ReadField<unsigned>(kInlinedBytecodeSizeOffset) == 0); + return ReadField<unsigned>(kInlinedBytecodeSizeOffset); +} + +void Code::set_inlined_bytecode_size(unsigned size) { + DCHECK(kind() == OPTIMIZED_FUNCTION || size == 0); + WriteField<unsigned>(kInlinedBytecodeSizeOffset, size); +} + bool Code::has_safepoint_info() const { return is_turbofanned() || is_wasm_code(); } @@ -477,6 +488,24 @@ void Code::set_marked_for_deoptimization(bool flag) { code_data_container().set_kind_specific_flags(updated); } +int Code::deoptimization_count() const { + DCHECK(kind() == OPTIMIZED_FUNCTION); + int32_t flags = code_data_container().kind_specific_flags(); + int count = DeoptCountField::decode(flags); + DCHECK_GE(count, 0); + return count; +} + +void Code::increment_deoptimization_count() { + DCHECK(kind() == OPTIMIZED_FUNCTION); + int32_t flags = code_data_container().kind_specific_flags(); + int32_t count = DeoptCountField::decode(flags); + DCHECK_GE(count, 0); + CHECK_LE(count + 1, DeoptCountField::kMax); + int32_t updated = DeoptCountField::update(flags, count + 1); + code_data_container().set_kind_specific_flags(updated); +} + bool Code::embedded_objects_cleared() const { DCHECK(kind() == OPTIMIZED_FUNCTION); int32_t flags = code_data_container().kind_specific_flags(); |