Rename runtime.itfmethod -> runtime.interfaceMethod
Этот коммит содержится в:
родитель
64e478ef36
коммит
0c71ed81a4
2 изменённых файлов: 7 добавлений и 7 удалений
|
@ -1343,7 +1343,7 @@ func (c *Compiler) parseCall(frame *Frame, instr *ssa.CallCommon, parentHandle l
|
|||
itf,
|
||||
llvm.ConstInt(llvm.Int16Type(), uint64(c.ir.MethodNum(instr.Method)), false),
|
||||
}
|
||||
fn := c.builder.CreateCall(c.mod.NamedFunction("runtime.itfmethod"), values, "invoke.func")
|
||||
fn := c.builder.CreateCall(c.mod.NamedFunction("runtime.interfaceMethod"), values, "invoke.func")
|
||||
fnCast := c.builder.CreateBitCast(fn, llvmFnType, "invoke.func.cast")
|
||||
receiverValue := c.builder.CreateExtractValue(itf, 1, "invoke.func.receiver")
|
||||
args := []llvm.Value{receiverValue}
|
||||
|
@ -1510,7 +1510,7 @@ func (c *Compiler) parseExpr(frame *Frame, expr ssa.Value) (llvm.Value, error) {
|
|||
// TODO: runtime.lookupBoundsCheck is undefined in packages imported by
|
||||
// package runtime, so we have to remove it. This should be fixed.
|
||||
lookupBoundsCheck := c.mod.NamedFunction("runtime.lookupBoundsCheck")
|
||||
if !lookupBoundsCheck.IsNil() && frame.fn.llvmFn.Name() != "runtime.itfmethod" {
|
||||
if !lookupBoundsCheck.IsNil() && frame.fn.llvmFn.Name() != "runtime.interfaceMethod" {
|
||||
c.builder.CreateCall(lookupBoundsCheck, []llvm.Value{buflen, index}, "")
|
||||
}
|
||||
|
||||
|
|
|
@ -36,19 +36,19 @@ type methodSetRange struct {
|
|||
// which is a dummy value, but will be bigger after the compiler has filled them
|
||||
// in.
|
||||
var (
|
||||
firstInterfaceNum uint16 // the lowest typecode that has at least one method
|
||||
methodSetRanges [0]methodSetRange // indexes into methodSetSignatures and methodSetFunctions
|
||||
methodSetSignatures [0]uint16 // uniqued method ID
|
||||
methodSetFunctions [0]*uint8 // function pointer of method
|
||||
firstInterfaceNum uint16 // the lowest typecode that has at least one method
|
||||
)
|
||||
|
||||
// Get the function pointer for the method on the interface.
|
||||
// This is a compiler intrinsic.
|
||||
func itfmethod(itf _interface, method uint16) *uint8 {
|
||||
func interfaceMethod(itf _interface, method uint16) *uint8 {
|
||||
// This function doesn't do bounds checking as the supplied method must be
|
||||
// in the list of signatures. The compiler will only emit runtime.itfmethod
|
||||
// calls when the method actually exists on this interface (proven by the
|
||||
// typechecker).
|
||||
// in the list of signatures. The compiler will only emit
|
||||
// runtime.interfaceMethod calls when the method actually exists on this
|
||||
// interface (proven by the typechecker).
|
||||
i := methodSetRanges[itf.typecode-firstInterfaceNum].index
|
||||
for {
|
||||
if methodSetSignatures[i] == method {
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче