classObjectAccess
final class ObjectAccess
Restricted visibility: declared "@visibility Deriver\Deriver\Evaluator" and "@visibility Deriver\Deriver\Evaluator\Execution". Code outside that scope must not name this declaration.
Resolves property storage using object identity and lexical declaration scope.
Properties§
public Context $contextMethods§
public function address(Instruction $instruction, State $state): LocationLocates a property without merging unrelated allocations.
Parameters
$instruction | Instruction | Property-address instruction |
$state | State | Path memory |
Returns
Location Property addressCalled from 1
Calls 13
- method-call State::value() line 39
- method-call ObjectAccess::receiverClass() line 42
- class-const TermKind::Constant() line 43
- function-call
is_stringline 43 - method-call PropertyLookup::find() line 43
- new PropertyLookup line 43
- class-const TermKind::Enum() line 46
- static-call Term::array() line 47
- static-call Term::opaque() line 50
- new Location line 53
- new PropertySlot line 55
- method-call ObjectAccess::slot() line 56
- method-call ObjectAccess::prepare() line 57
public function slot(string $class, string $scope, string $property): stringKeeps private properties with the same spelling in separate slots.
Parameters
$class | string | Runtime class |
$scope | string | Lexical access scope |
$property | string | Property name |
Returns
string Declared storage slotTest cases 1
Called from 2
- method-call Deriver\Deriver\Evaluator\Execution\Call\Preparation\EntryProperties::apply() packages/deriver/src/Deriver/Evaluator/Execution/Call/Preparation/EntryProperties.php:64
- method-call Deriver\Deriver\Evaluator\Execution\Transfer\ObjectAccess::address() packages/deriver/src/Deriver/Evaluator/Execution/Transfer/ObjectAccess.php:56
Calls 3
- method-call PropertyLookup::find() line 70
- new PropertyLookup line 70
- class-const Visibility::Private() line 71
public function prepare(
State $state,
string $root,
string $slot,
Term $receiver,
PropertyDeclaration|null $property,
): voidRegisters live declaration constraints and an external receiver's initial field value.
Parameters
$state | State | Current path |
$root | string | Storage root |
$slot | string | Declared storage key |
$receiver | Term | Evaluated receiver |
$property | PropertyDeclaration|null | Captured declaration |
Test cases 3
Called from 1
Calls 7
- method-call TypeBinding::scope() line 85
- new TypeBinding line 85
- class-const TermKind::Array() line 88
- method-call ObjectAccess::symbolic() line 88
- new Location line 90
- new Term line 90
- class-const TermKind::External() line 90
Recognizes an object supplied from outside the analysis whose identity stays stable along the path.
Returns
bool Whether unread fields hold the object's initial, declared-type stateTest cases 1
Called from 1
Calls 7
- function-call
is_stringline 102 - class-const TermKind::Parameter() line 106
- class-const TermKind::External() line 107
- method-call TypePredicates::bound() line 107
- new TypePredicates line 107
- class-const TermKind::Opaque() line 108
- class-const TermKind::Object() line 109
public function receiverClass(Instruction $instruction, Term $receiver, State $state): stringSeparates lexical static names, runtime class strings, and object classes.
Parameters
$instruction | Instruction | Access syntax and lexical scope |
$receiver | Term | Evaluated class or object operand |
$state | State | Runtime called class |
Returns
string Lookup class or an unresolved empty nameCalled from 1
Calls 5
- class-const TermKind::Constant() line 124
- function-call
is_stringline 124 - method-call Dispatch::className() line 126
- new Dispatch line 126
- function-call
ltrimline 126
Test cases 43§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
ObjectAccessTest::testPrepareCapturesAnExternalReceiverFieldAndItsTypecallsObjectAccessTest::testPrepareCapturesFieldsOnlyOfReceiversThatMayBeObjectscallsObjectAccessTest::testPrepareSeedsOnlyUnreadFieldsOfOpenRecordscallsObjectAccessTest::testReceiverClassKeepsObjectIdentitySeparateFromStaticNamescallsObjectAccessTest::testSlotKeepsPrivateDeclarationsDistinctcallsObjectAccessTest::testSymbolicRecognizesOnlyStableExternalIdentitiescalls
Other tests reaching this symbol 37
FrontierTestcallsAllocationTestcallsCallExecutorTestcallsBindingTestcallsMethodInvocationTestcallsInvocationTestcallsParameterBindingTestcallsArgumentsTestcallsEntryPropertiesTestcallsUnpackTestcallsUnknownCallTestcallsAlternativeTestcallsCollectionCallsTestcallsHavocTestcallsInstructionTransferTestcallsProtocolTestcallsTransferTestcallsConversionsTestcallsCountableCallsTestcallsStateTestcallsInvocationTestcallsConstantTransferTestcallsPropertyAccessCheckTestcallsPropertyMagicTestcallsPropertyReferenceTestcallsPropertyTransferTestcallsReferenceAssignmentTestcallsQueryExecutionTestcallsResultAssessmentTestcallsAssignmentLoweringTestcallsConditionalLoweringTestcallsDestructuringLoweringTestcallsIndexerTestcallsClassDeclarationTestcallsPropertyDeclarationTestcallsDispatchTestcallsLowererTestcalls
Relations§
Instantiated in 2
- new Deriver\Deriver\Evaluator\Execution\Call\Preparation\EntryProperties::apply() packages/deriver/src/Deriver/Evaluator/Execution/Call/Preparation/EntryProperties.php:64
- new Deriver\Deriver\Evaluator\Execution\Transfer\MemoryStep::address() packages/deriver/src/Deriver/Evaluator/Execution/Transfer/MemoryStep.php:200
Method calls 2
- method-call Deriver\Deriver\Evaluator\Execution\Call\Preparation\EntryProperties::apply() packages/deriver/src/Deriver/Evaluator/Execution/Call/Preparation/EntryProperties.php:64
- method-call Deriver\Deriver\Evaluator\Execution\Transfer\MemoryStep::address() packages/deriver/src/Deriver/Evaluator/Execution/Transfer/MemoryStep.php:200