예제 #1
0
        public static Instruction GetClosure(int index) {
            if (_getClosure == null) {
                _getClosure = new Instruction[LocalInstrCacheSize];
            }

            if (index < _getClosure.Length) {
                return _getClosure[index] ?? (_getClosure[index] = new GetClosureInstruction(index));
            }

            return new GetClosureInstruction(index);
        }
예제 #2
0
        public void EmitLoadLocalFromClosure(int index) {
            if (_loadLocalFromClosure == null) {
                _loadLocalFromClosure = new Instruction[LocalInstrCacheSize];
            }

            if (index < _loadLocalFromClosure.Length) {
                Emit(_loadLocalFromClosure[index] ?? (_loadLocalFromClosure[index] = new GetClosureInstruction(index)));
            } else {
                Emit(new GetClosureInstruction(index));
            }
        }