Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for isDirectIface (0.23 sec)

  1. src/runtime/typekind.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package runtime
    
    import "internal/abi"
    
    // isDirectIface reports whether t is stored directly in an interface value.
    func isDirectIface(t *_type) bool {
    	return t.Kind_&abi.KindDirectIface != 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 15:10:48 UTC 2024
    - 356 bytes
    - Viewed (0)
  2. src/runtime/alg.go

    		// the error text (e.g. in a struct with a field of slice type
    		// we want to report the struct, not the slice).
    		panic(errorString("hash of unhashable type " + toRType(t).string()))
    	}
    	if isDirectIface(t) {
    		return c1 * typehash(t, unsafe.Pointer(&a.data), h^c0)
    	} else {
    		return c1 * typehash(t, a.data, h^c0)
    	}
    }
    
    // nilinterhash should be an internal detail,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 13.6K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/walk/walk.go

    // The concrete type must be known to have type t.
    // It follows the pointer if !IsDirectIface(t).
    func ifaceData(pos src.XPos, n ir.Node, t *types.Type) ir.Node {
    	if t.IsInterface() {
    		base.Fatalf("ifaceData interface: %v", t)
    	}
    	ptr := ir.NewUnaryExpr(pos, ir.OIDATA, n)
    	if types.IsDirectIface(t) {
    		ptr.SetType(t)
    		ptr.SetTypecheck(1)
    		return ptr
    	}
    	ptr.SetType(types.NewPtr(t))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 20:56:00 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/test/inl_test.go

    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 09 04:07:57 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  5. src/internal/abi/type.go

    // IfaceIndir reports whether t is stored indirectly in an interface value.
    func (t *Type) IfaceIndir() bool {
    	return t.Kind_&KindDirectIface == 0
    }
    
    // isDirectIface reports whether t is stored directly in an interface value.
    func (t *Type) IsDirectIface() bool {
    	return t.Kind_&KindDirectIface != 0
    }
    
    func (t *Type) GcSlice(begin, end uintptr) []byte {
    	return unsafe.Slice(t.GCData, int(end))[begin:]
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 17 21:09:59 UTC 2024
    - 21.8K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types/type.go

    		return true
    
    	case TARRAY:
    		// Array of 1 direct iface type can be direct.
    		return t.NumElem() == 1 && IsDirectIface(t.Elem())
    
    	case TSTRUCT:
    		// Struct with 1 field of direct iface type can be direct.
    		return t.NumFields() == 1 && IsDirectIface(t.Field(0).Type)
    	}
    
    	return false
    }
    
    // IsInterfaceMethod reports whether (field) m is
    // an interface method. Such methods have the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 49.5K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/walk/complit.go

    		n := n.(*ir.ConvExpr)
    		val := ir.Node(n)
    		for val.Op() == ir.OCONVIFACE {
    			val = val.(*ir.ConvExpr).X
    		}
    		if val.Type().IsInterface() {
    			return val.Op() == ir.ONIL
    		}
    		if types.IsDirectIface(val.Type()) && val.Op() == ir.ONIL {
    			return true
    		}
    		return isStaticCompositeLiteral(val)
    	}
    	return false
    }
    
    // initKind is a kind of static initialization: static, dynamic, or local.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:03:54 UTC 2023
    - 19.5K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/walk/convert.go

    // an interface.
    func dataWord(conv *ir.ConvExpr, init *ir.Nodes) ir.Node {
    	pos, n := conv.Pos(), conv.X
    	fromType := n.Type()
    
    	// If it's a pointer, it is its own representation.
    	if types.IsDirectIface(fromType) {
    		return n
    	}
    
    	isInteger := fromType.IsInteger()
    	isBool := fromType.IsBoolean()
    	if sc := fromType.SoleComponent(); sc != nil {
    		isInteger = sc.IsInteger()
    		isBool = sc.IsBoolean()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 09 17:28:22 UTC 2023
    - 18.2K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/staticinit/sched.go

    		}
    
    		// Create a copy of l to modify while we emit data.
    
    		// Emit itab, advance offset.
    		staticdata.InitAddr(l, loff, itab.X.(*ir.LinksymOffsetExpr).Linksym)
    
    		// Emit data.
    		if types.IsDirectIface(val.Type()) {
    			if val.Op() == ir.ONIL {
    				// Nil is zero, nothing to do.
    				return true
    			}
    			// Copy val directly into n.
    			ir.SetPos(val)
    			assign(base.Pos, l, loff+int64(types.PtrSize), val)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 17:16:14 UTC 2024
    - 30.7K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/walk/order.go

    			n.Prealloc = o.newTemp(t, false)
    		}
    		return n
    
    	case ir.ODOTTYPE, ir.ODOTTYPE2:
    		n := n.(*ir.TypeAssertExpr)
    		n.X = o.expr(n.X, nil)
    		if !types.IsDirectIface(n.Type()) || base.Flag.Cfg.Instrumenting {
    			return o.copyExprClear(n)
    		}
    		return n
    
    	case ir.ORECV:
    		n := n.(*ir.UnaryExpr)
    		n.X = o.expr(n.X, nil)
    		return o.copyExprClear(n)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 02:00:33 UTC 2024
    - 42.7K bytes
    - Viewed (0)
Back to top