diff --git a/src/core/symbol.cc b/src/core/symbol.cc index a3c17cb0bc..8b27ab3560 100644 --- a/src/core/symbol.cc +++ b/src/core/symbol.cc @@ -278,6 +278,11 @@ CL_DEFUN VariableCell_sp core__ensure_variable_cell(Symbol_sp name) { return name->ensureVariableCell(); } +CL_LISPIFY_NAME(variable-cell/name); +CL_DEFUN T_sp core__variable_cell_name(VariableCell_sp vcell) { + return vcell->name(); +} + bool Symbol_O::boundP() const { VariableCell_sp vcell = variableCell(); if (vcell.unboundp()) return false; diff --git a/src/lisp/kernel/cleavir/compile-bytecode.lisp b/src/lisp/kernel/cleavir/compile-bytecode.lisp index 3829c0a874..347e2169e7 100644 --- a/src/lisp/kernel/cleavir/compile-bytecode.lisp +++ b/src/lisp/kernel/cleavir/compile-bytecode.lisp @@ -1090,10 +1090,10 @@ (defmethod compile-instruction ((mnemonic (eql :special-bind)) inserter annot context &rest args) (declare (ignore annot)) - (destructuring-bind (symbol) args + (destructuring-bind (vcell) args (let* ((next (mapcar #'bt:block-entry-extra (context-successors context))) - (const (inserter-vcell symbol inserter)) + (const (inserter-vcell (core:variable-cell/name vcell) inserter)) (value (stack-pop context)) (bind (ast-to-bir:terminate inserter 'bir:constant-bind :inputs (list const value) @@ -1103,9 +1103,10 @@ (defmethod compile-instruction ((mnemonic (eql :symbol-value)) inserter annot context &rest args) (declare (ignore annot)) - (destructuring-bind (symbol) args - (let ((const (inserter-vcell symbol inserter)) - (out (make-instance 'bir:output :name symbol))) + (destructuring-bind (vcell) args + (let* ((symbol (core:variable-cell/name vcell)) + (const (inserter-vcell symbol inserter)) + (out (make-instance 'bir:output :name symbol))) (ast-to-bir:insert inserter 'bir:constant-symbol-value :inputs (list const) :outputs (list out)) (stack-push out context)))) @@ -1113,8 +1114,8 @@ (defmethod compile-instruction ((mnemonic (eql :symbol-value-set)) inserter annot context &rest args) (declare (ignore annot)) - (destructuring-bind (symbol) args - (let ((const (inserter-vcell symbol inserter)) + (destructuring-bind (vcell) args + (let ((const (inserter-vcell (core:variable-cell/name vcell) inserter)) (in (stack-pop context))) (ast-to-bir:insert inserter 'bir:set-constant-symbol-value :inputs (list const in)))))