Check-in [bcc7273e40]
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Finish up return from an invoked function. Still need to do invoked commands and invokeExpanded in the NRE case.
Timelines: family | ancestors | mistake | notworking
Files: files | file ages | folders
SHA3-256: bcc7273e40708a7cbed7544a17e45cdf4ee805555622c3a82af4b34c950564cb
User & Date: kbk 2018-04-14 22:19:51
Context
2018-04-14
22:19
Finish up return from an invoked function. Still need to do invoked commands and invokeExpanded in the NRE case. Closed-Leaf check-in: bcc7273e40 user: kbk tags: mistake, notworking
22:10
Finish up return from an invoked function. Still need to do invoked commands and invokeExpanded in the NRE case. check-in: 2b2ba21e34 user: kbk tags: notworking, kbk-nre
Changes

Changes to codegen/compile.tcl.

2565
2566
2567
2568
2569
2570
2571
2572

2573
2574
2575
2576
2577
2578
2579
    method generateThunk {thunkBuilder} {
	if {[dict exists $bytecode procmeta]} {
	    $thunkBuilder buildProcedureMetadata $cmd $bytecode \
		[dict get $bytecode procmeta]
	    dict unset bytecode procmeta
	}
	$thunkBuilder thunk $cmd $bytecode $func

    }

    # TclInterproceduralCompiler:printTypedQuads --
    #
    #	Print the sequence of typed quadcodes that the type inference engine
    #	has transformed the procedure into.
    #






|
>







2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
    method generateThunk {thunkBuilder} {
	if {[dict exists $bytecode procmeta]} {
	    $thunkBuilder buildProcedureMetadata $cmd $bytecode \
		[dict get $bytecode procmeta]
	    dict unset bytecode procmeta
	}
	$thunkBuilder thunk $cmd $bytecode $func \
	    [expr {[lindex $quads 0 0] eq "NRE.entry"}]
    }

    # TclInterproceduralCompiler:printTypedQuads --
    #
    #	Print the sequence of typed quadcodes that the type inference engine
    #	has transformed the procedure into.
    #

Changes to codegen/thunk.tcl.

72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
...
285
286
287
288
289
290
291

292
293
294
295
296




297
298
299
300
301
302
303
		}
	    }
	}
    }

    method buildInSection {id script} {
	set line [dict get {
	    preface 1
	    API 2 APIvar 3
	    initConstant 4 commands 5
	    packageProvide 6
	} $id]
	$m debug scope "" {
	    $metathunk setAsCurrentDebuggingScope
	    $b @location $line
................................................................................
    # Parameters:
    #	name -	The (fully-qualified) name of the Tcl command to generate.
    #	bytecode -
    #		The bytecode description dictionary that describes the
    #		original command. This is an augmented output of the
    #		[tcl::unsupported::getbytecode] command.
    #	func -	The TclOO handle to the function we are binding to.

    #
    # Results:
    #	The function object for the wrapping function.

    method thunk {name bytecode func} {




	set thunk [$m function.create cmd.thunk$name $Tcl_ObjCmdType]
	$thunk private
	$thunk setAsCurrentDebuggingScope
	set idx -1
	set block [$thunk block]

	$block build-in $b






|







 







>




|
>
>
>
>







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
...
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
		}
	    }
	}
    }

    method buildInSection {id script} {
	set line [dict get {
 	    preface 1
	    API 2 APIvar 3
	    initConstant 4 commands 5
	    packageProvide 6
	} $id]
	$m debug scope "" {
	    $metathunk setAsCurrentDebuggingScope
	    $b @location $line
................................................................................
    # Parameters:
    #	name -	The (fully-qualified) name of the Tcl command to generate.
    #	bytecode -
    #		The bytecode description dictionary that describes the
    #		original command. This is an augmented output of the
    #		[tcl::unsupported::getbytecode] command.
    #	func -	The TclOO handle to the function we are binding to.
    #	nre -   Flag that is true iff the function requires NRE
    #
    # Results:
    #	The function object for the wrapping function.

    method thunk {name bytecode func nre} {

	if {$nre} {
	    error "Kevin is here, trying to thunk NRE proc $name"
	}
	set thunk [$m function.create cmd.thunk$name $Tcl_ObjCmdType]
	$thunk private
	$thunk setAsCurrentDebuggingScope
	set idx -1
	set block [$thunk block]

	$block build-in $b