Skip to content

ZJIT: Optimize GuardNotFrozen #869

@eregon

Description

@eregon

Currently it's a call to rb_obj_frozen_p() but that's pretty slow, e.g. on benchmarks/structaset.rb it's 6ms per iter without GuardNotFrozen and 18ms with.

Given most frozen checks are going to be on non-immediates (immediates are frozen and would raise FrozenError), it seems good to check the frozen state via the Shape, which also knows whether an object is frozen (IIRC).
Or via the RBasic flags but directly in generated code and not through a C call.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions