Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7cbf430

Browse files
committed
makereflection test pass
1 parentdb4f073 commit7cbf430

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

‎base/compiler/typeinfer.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,9 @@ end
847847

848848
# compute an inferred AST and return type
849849
functiontypeinf_code(interp::AbstractInterpreter, method::Method,@nospecialize(atypes), sparams::SimpleVector, run_optimizer::Bool)
850-
mi=specialize_method(method, atypes, sparams)::MethodInstance
850+
returntypeinf_code(interp,specialize_method(method, atypes, sparams)::MethodInstance, run_optimizer)
851+
end
852+
functiontypeinf_code(interp::AbstractInterpreter, mi::MethodInstance, run_optimizer::Bool)
851853
ccall(:jl_typeinf_begin, Cvoid, ())
852854
result=InferenceResult(mi)
853855
frame=InferenceState(result, run_optimizer?:global::no, interp)

‎base/compiler/typelattice.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# structs/constants #
55
#####################
66

7-
# NOTE `_TOP_CAUSES` is defined in inferencestate.jlwhere `InferenceState` is defined
7+
# NOTE `_TOP_CAUSES` is defined in inferencestate.jljust after `InferenceState` is defined
88

99
struct Constant
1010
val

‎base/reflection.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,11 +1276,14 @@ function print_statement_costs(io::IO, @nospecialize(tt::Type);
12761276
for matchin matches::Vector
12771277
match= match::Core.MethodMatch
12781278
meth=func_for_method_checked(match.method, tt, match.sparams)
1279-
(code, ty)= Core.Compiler.typeinf_code(interp, meth, match.spec_types, match.sparams,true)
1279+
mi= Core.Compiler.specialize_method(meth, match.spec_types, match.sparams)::MethodInstance
1280+
(code, ty)= Core.Compiler.typeinf_code(interp, mi,true)
12801281
code===nothing&&error("inference not successful")# inference disabled?
12811282
empty!(cst)
12821283
resize!(cst,length(code.code))
1283-
maxcost= Core.Compiler.statement_costs!(cst, code.code, code, Any[match.sparams...],false, params)
1284+
sptypes= Core.Compiler.sptypes_from_meth_instance(mi)
1285+
code.ssavaluetypes= Core.Compiler.SSAValueTypes([Core.Compiler.NativeType(typ)for typin code.ssavaluetypes])
1286+
maxcost= Core.Compiler.statement_costs!(cst, code.code, code, sptypes,false, params)
12841287
nd=ndigits(maxcost)
12851288
println(io, meth)
12861289
irshow_config= IRShow.IRShowConfig()do io, linestart, idx

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp