Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for Byval (0.15 sec)

  1. src/cmd/compile/internal/walk/closure.go

    // This avoids allocation of a closure object.
    //
    // For illustration, the following call:
    //
    //	func(a int) {
    //		println(byval)
    //		byref++
    //	}(42)
    //
    // becomes:
    //
    //	func(byval int, &byref *int, a int) {
    //		println(byval)
    //		(*&byref)++
    //	}(byval, &byref, 42)
    func directClosureCall(n *ir.CallExpr) {
    	clo := n.Fun.(*ir.ClosureExpr)
    	clofn := clo.Func
    
    	if ir.IsTrivialClosure(clo) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 20 15:56:08 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/ir/func.go

    	// function. The variables in this slice are the closure function's
    	// own copy of the variables, which are used within its function
    	// body. They will also each have IsClosureVar set, and will have
    	// Byval set if they're captured by value.
    	ClosureVars []*Name
    
    	// Enclosed functions that need to be compiled.
    	// Populated during walk.
    	Closures []*Func
    
    	// Parents records the parent scope of each scope within a
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:05:44 UTC 2024
    - 21.1K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/typecheck/func.go

    func (iter *ClosureStructIter) Next() (n *ir.Name, typ *types.Type, offset int64) {
    	if iter.next >= len(iter.closureVars) {
    		return nil, nil, 0
    	}
    	n = iter.closureVars[iter.next]
    	typ = n.Type()
    	if !n.Byval() {
    		typ = types.NewPtr(typ)
    	}
    	iter.next++
    	offset = types.RoundUp(iter.offset, typ.Alignment())
    	iter.offset = offset + typ.Size()
    	return n, typ, offset
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 06 15:23:18 UTC 2024
    - 21.1K bytes
    - Viewed (0)
  4. utils/utils.go

    	if reflect.DeepEqual(x, y) {
    		return true
    	}
    	if x == nil || y == nil {
    		return false
    	}
    
    	xval := reflect.ValueOf(x)
    	yval := reflect.ValueOf(y)
    	if xval.Kind() == reflect.Ptr && xval.IsNil() ||
    		yval.Kind() == reflect.Ptr && yval.IsNil() {
    		return false
    	}
    
    	if valuer, ok := x.(driver.Valuer); ok {
    		x, _ = valuer.Value()
    	}
    	if valuer, ok := y.(driver.Valuer); ok {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Apr 22 06:43:02 UTC 2024
    - 3.8K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/ssagen/ssa.go

    			// convert Addrtaken variables to SSA anyway, no point
    			// in promoting them either.
    			if n.Byval() && !n.Addrtaken() && ssa.CanSSA(n.Type()) {
    				n.Class = ir.PAUTO
    				fn.Dcl = append(fn.Dcl, n)
    				s.assign(n, s.load(n.Type(), ptr), false, 0)
    				continue
    			}
    
    			if !n.Byval() {
    				ptr = s.load(typ, ptr)
    			}
    			s.setHeapaddr(fn.Pos(), n, ptr)
    		}
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 19:44:43 UTC 2024
    - 284.9K bytes
    - Viewed (0)
  6. src/go/types/expr.go

    	// Check that constants are representable by uint, but do not convert them
    	// (see also go.dev/issue/47243).
    	var yval constant.Value
    	if y.mode == constant_ {
    		// Provide a good error message for negative shift counts.
    		yval = constant.ToInt(y.val) // consider -1, 1.0, but not -1.1
    		if yval.Kind() == constant.Int && constant.Sign(yval) < 0 {
    			check.errorf(y, InvalidShiftCount, invalidOp+"negative shift count %s", y)
    			x.mode = invalid
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 49.7K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/expr.go

    	// Check that constants are representable by uint, but do not convert them
    	// (see also go.dev/issue/47243).
    	var yval constant.Value
    	if y.mode == constant_ {
    		// Provide a good error message for negative shift counts.
    		yval = constant.ToInt(y.val) // consider -1, 1.0, but not -1.1
    		if yval.Kind() == constant.Int && constant.Sign(yval) < 0 {
    			check.errorf(y, InvalidShiftCount, invalidOp+"negative shift count %s", y)
    			x.mode = invalid
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 51.7K bytes
    - Viewed (0)
  8. doc/go1.17_spec.html

    </pre>
    
    <p>
    Although the examples above use non-interface types, it is also legal to create a method value
    from a value of interface type.
    </p>
    
    <pre>
    var i interface { M(int) } = myVal
    f := i.M; f(7)  // like i.M(7)
    </pre>
    
    
    <h3 id="Index_expressions">Index expressions</h3>
    
    <p>
    A primary expression of the form
    </p>
    
    <pre>
    a[x]
    </pre>
    
    <p>
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 11 20:22:45 UTC 2024
    - 211.6K bytes
    - Viewed (0)
  9. doc/go_spec.html

    </pre>
    
    <p>
    Although the examples above use non-interface types, it is also legal to create a method value
    from a value of interface type.
    </p>
    
    <pre>
    var i interface { M(int) } = myVal
    f := i.M; f(7)  // like i.M(7)
    </pre>
    
    
    <h3 id="Index_expressions">Index expressions</h3>
    
    <p>
    A primary expression of the form
    </p>
    
    <pre>
    a[x]
    </pre>
    
    <p>
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 21:07:21 UTC 2024
    - 281.5K bytes
    - Viewed (0)
Back to top