const ScorePhi … const ScoreArg … const ScoreInitMem … const ScoreReadTuple … const ScoreNilCheck … const ScoreMemory … const ScoreReadFlags … const ScoreDefault … const ScoreFlags … const ScoreControl … type ValHeap … func (h ValHeap) Len() int { … } func (h ValHeap) Swap(i, j int) { … } func (h *ValHeap) Push(x interface{ … } func (h *ValHeap) Pop() interface{ … } func (h ValHeap) Less(i, j int) bool { … } func (op Op) isLoweredGetClosurePtr() bool { … } // Schedule the Values in each Block. After this phase returns, the // order of b.Values matters and is the order in which those values // will appear in the assembly output. For now it generates a // reasonable valid schedule using a priority queue. TODO(khr): // schedule smarter. func schedule(f *Func) { … } // storeOrder orders values with respect to stores. That is, // if v transitively depends on store s, v is ordered after s, // otherwise v is ordered before s. // Specifically, values are ordered like // // store1 // NilCheck that depends on store1 // other values that depends on store1 // store2 // NilCheck that depends on store2 // other values that depends on store2 // ... // // The order of non-store and non-NilCheck values are undefined // (not necessarily dependency order). This should be cheaper // than a full scheduling as done above. // Note that simple dependency order won't work: there is no // dependency between NilChecks and values like IsNonNil. // Auxiliary data structures are passed in as arguments, so // that they can be allocated in the caller and be reused. // This function takes care of reset them. func storeOrder(values []*Value, sset *sparseSet, storeNumber []int32) []*Value { … } // isFlagOp reports if v is an OP with the flag type. func (v *Value) isFlagOp() bool { … } // hasFlagInput reports whether v has a flag value as any of its inputs. func (v *Value) hasFlagInput() bool { … } func valuePosCmp(a, b *Value) int { … }