From 7fb355850fad69072465b7c13cbbf7dce27c4fb3 Mon Sep 17 00:00:00 2001
From: wlott <wlott>
Date: Thu, 31 Oct 1991 16:19:55 +0000
Subject: [PATCH] Optimized CHECK-STRUCTURE to use the conditional trap
 sequence a la CHECK-LIST instead of branching off to elsewhere code that does
 an unconditional break.  This should help reduce the size of SPARC cores.

---
 compiler/sparc/type-vops.lisp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/compiler/sparc/type-vops.lisp b/compiler/sparc/type-vops.lisp
index 7c26dae6c..8f4e5313b 100644
--- a/compiler/sparc/type-vops.lisp
+++ b/compiler/sparc/type-vops.lisp
@@ -7,7 +7,7 @@
 ;;; Scott Fahlman (FAHLMAN@CMUC). 
 ;;; **********************************************************************
 ;;;
-;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/sparc/type-vops.lisp,v 1.6 1991/08/04 11:38:08 wlott Exp $
+;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/sparc/type-vops.lisp,v 1.7 1991/10/31 16:19:55 wlott Exp $
 ;;; 
 ;;; This file contains the VM definition of type testing and checking VOPs
 ;;; for the SPARC.
@@ -84,8 +84,14 @@
     (move result value)))
 (primitive-type-vop check-list (:check) list)
 
-(def-type-vops structurep check-structure structure
-  object-not-structure-error vm:structure-pointer-type)
+(def-type-vops structurep nil nil nil vm:structure-pointer-type)
+(define-vop (check-structure check-type)
+  (:generator 3
+    (inst and temp value lowtag-mask)
+    (inst cmp temp structure-pointer-type)
+    (inst t :ne (logior (ash (tn-offset value) 8) object-not-structure-trap))
+    (move result value)))
+(primitive-type-vop check-structure (:check) structure)
 
 (def-type-vops bignump check-bigunm bignum
   object-not-bignum-error vm:bignum-type)
-- 
GitLab