Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate #newMethod:header: with rewritting to #basicNew:header: #16375

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions src/Kernel-CodeModel/CompiledCode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,12 @@ CompiledCode class >> newFrom: aCompiledMethod [

{ #category : 'instance creation' }
CompiledCode class >> newMethod: numberOfBytes header: headerWord [
"Primitive. Answer an instance of me. The number of literals (and other
information) is specified by the headerWord (see my class comment).
The first argument specifies the number of fields for bytecodes in the
method. Fail if either argument is not a SmallInteger, or if numberOfBytes
is negative, or if memory is low. Once the header of a method is set by
this primitive, it cannot be changed to change the number of literals.
Essential. See Object documentation whatIsAPrimitive."

<primitive: 79 error: ec>
ec == #'insufficient object memory' ifTrue:
[^self handleFailingNew: numberOfBytes header: headerWord].
^self primitiveFailed
self
deprecated: 'Use #basicNew:header: instead.'
transformWith: '`@rcv newMethod: `@numberOfBytes header: `@headerWord' -> '`@rcv basicNew: `@numberOfBytes header: `@headerWord'.

^ self basicNew: numberOfBytes header: headerWord
]

{ #category : 'comparing' }
Expand Down