Author: pfg
Date: Wed Apr 17 02:20:17 2013
New Revision: 249573
URL: http://svnweb.freebsd.org/changeset/base/249573

Log:
  DTrace: Revert r249367
  
  The following change from illumos brought caused DTrace to
  pause in an interactive environment:
  
  3026 libdtrace should set LD_NOLAZYLOAD=1 to help the pid provider
  
  This was not detected during testing because it doesn't
  affect scripts.
  
  We shouldn't be changing the environment, especially since the
  LD_NOLAZYLOAD option doesn't apply to our (GNU) ld.
  Unfortunately the change from upstream was made in such a way
  that it is very difficult to separate this change from the
  others so, at least for now, it's better to just revert
  everything.
  
  Reference:
  https://www.illumos.org/issues/3026
  
  Reported by:  Navdeep Parhar and Mark Johnston

Added:
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d
     - copied unchanged from r249366, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh
     - copied unchanged from r249366, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d
     - copied unchanged from r249366, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d
     - copied unchanged from r249366, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d
Deleted:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.assigncast1.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.assigncast2.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pq.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pq.h
Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
  head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c
  head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c
  head/cddl/lib/libdtrace/Makefile
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c   Wed Apr 17 02:03:12 
2013        (r249572)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c   Wed Apr 17 02:20:17 
2013        (r249573)
@@ -23,9 +23,8 @@
  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
-/*
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
+
+#pragma ident  "%Z%%M% %I%     %E% SMI"
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -1410,7 +1409,6 @@ main(int argc, char *argv[])
        (void) dtrace_setopt(g_dtp, "bufsize", "4m");
        (void) dtrace_setopt(g_dtp, "aggsize", "4m");
 #endif
-       (void) dtrace_setopt(g_dtp, "temporal", "yes");
 
        /*
         * If -G is specified, enable -xlink=dynamic and -xunodefs to permit

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl  Wed Apr 
17 02:03:12 2013        (r249572)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl  Wed Apr 
17 02:20:17 2013        (r249573)
@@ -583,8 +583,6 @@ if ($opt_x) {
 die "$PNAME: failed to open $PNAME.$$.log: $!\n"
     unless (!$opt_l || open(LOG, ">$PNAME.$$.log"));
 
-$ENV{'DTRACE_DEBUG_REGSET'} = 'true';
-
 if ($opt_g) {
        $ENV{'UMEM_DEBUG'} = 'default,verbose';
        $ENV{'UMEM_LOGGING'} = 'fail,contents';

Copied: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d
 (from r249366, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d
   Wed Apr 17 02:20:17 2013        (r249573, copy of r249366, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d)
@@ -0,0 +1,57 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma        ident   "%Z%%M% %I%     %E% SMI"
+
+/*
+ * ASSERTION:
+ *     Complex expressions.
+ *     Call complex expressions and make sure test succeeds.
+ *     Match expected output in tst.complex.d.out
+ *
+ * SECTION: Types, Operators, and Expressions/Arithmetic Operators
+ *
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+       i = 0;
+       i = i++ + ++i;
+       printf("The value of i is %d\n", i);
+       i = i-- - --i;
+       printf("The value of i is %d\n", i);
+       i = i-- + ++i;
+       printf("The value of i is %d\n", i);
+       i += i++ + -- i + ++i - ++i * i ;
+       printf("The value of i is %d\n", i);
+       i -= i++ * 3;
+       printf("The value of i is %d\n", i);
+       i = i++/i--+i++-++i-++i;
+       printf("The value of i is %d\n", i);
+       exit (0);
+}

Modified: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d
==============================================================================
--- 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d  
    Wed Apr 17 02:03:12 2013        (r249572)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d  
    Wed Apr 17 02:20:17 2013        (r249573)
@@ -23,29 +23,26 @@
  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
-/*
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
+
+#pragma ident  "%Z%%M% %I%     %E% SMI"
 
 /*
  * ASSERTION:
  *   Positive test for fill buffer policy.
  *
  * SECTION: Buffers and Buffering/fill Policy;
- *     Buffers and Buffering/Buffer Sizes;
+ *     Buffers and Buffering/Buffer Sizes;
  *     Options and Tunables/bufsize;
  *     Options and Tunables/bufpolicy;
  *     Options and Tunables/statusrate
  */
 /*
- * This is a brute-force way of testing fill buffers.  We assume that
- * each printf() stores 16 bytes (4x 32-bit words for EPID, timestamp
- * lo, timestamp hi, and the variable i).  Because each fill buffer is
- * per-CPU, we must fill up our buffer in one series of enablings on a
- * single CPU.
+ * This is a brute-force way of testing fill buffers.  We assume that each
+ * printf() stores 8 bytes.  Because each fill buffer is per-CPU, we must
+ * fill up our buffer in one series of enablings on a single CPU.
  */
 #pragma D option bufpolicy=fill
-#pragma D option bufsize=128
+#pragma D option bufsize=64
 #pragma D option statusrate=10ms
 #pragma D option quiet
 

Modified: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d
==============================================================================
--- 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d  
    Wed Apr 17 02:03:12 2013        (r249572)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d  
    Wed Apr 17 02:20:17 2013        (r249573)
@@ -23,9 +23,8 @@
  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
-/*
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
+
+#pragma ident  "%Z%%M% %I%     %E% SMI"
 
 /*
  * ASSERTION:
@@ -38,20 +37,19 @@
  */
 
 /*
- * We make some regrettable assumptions about the implementation in this
- * test.  First, we assume that each entry for the printf() of an int
- * takes _exactly_ 16 bytes (4 bytes for the EPID, 8 bytes for the
- * timestamp, 4 bytes for the payload).  Second, we assume that by
- * allocating storage for n + 1 records, we will get exactly n.  Here is
- * why:  the final predicate that evaluates to false will reserve space
- * that it won't use.  This act of reservation will advance the wrapped
- * offset.  That record won't be subsequently used, but the wrapped
- * offset has advanced.  (And in this case, that old record is clobbered
- * by the exit() anyway.)  Thirdly:  we rely on t_cpu/cpu_id.  Finally:
- * we rely on being able to run on the CPU that we first ran on.
+ * We make some regrettable assumptions about the implementation in this test.
+ * First, we assume that each entry for the printf() of an int takes _exactly_
+ * eight bytes (four bytes for the EPID, four bytes for the payload).  Second,
+ * we assume that by allocating storage for n + 1 records, we will get exactly
+ * n.  Here is why:  the final predicate that evaluates to false will reserve
+ * space that it won't use.  This act of reservation will advance the wrapped
+ * offset.  That record won't be subsequently used, but the wrapped offset has
+ * advanced.  (And in this case, that old record is clobbered by the exit()
+ * anyway.)  Thirdly:  we rely on t_cpu/cpu_id.  Finally:  we rely on being
+ * able to run on the CPU that we first ran on.
  */
 #pragma D option bufpolicy=ring
-#pragma D option bufsize=80
+#pragma D option bufsize=40
 #pragma D option quiet
 
 int n;

Modified: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh
==============================================================================
--- 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh  
    Wed Apr 17 02:03:12 2013        (r249572)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh  
    Wed Apr 17 02:20:17 2013        (r249573)
@@ -24,9 +24,7 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-
-#
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# ident        "%Z%%M% %I%     %E% SMI"
 #
 
 if [ $# != 1 ]; then
@@ -51,13 +49,13 @@ tick-1s
 tick-1s
 /(i % 2) == 0/
 {
-       system("dtrace -c date -n 'pid\$target::main:entry' >/dev/null");
+       system("dtrace -c date -ln 'pid\$target::main:entry' >/dev/null");
 }
 
 tick-1s
 /(i % 2) == 1/
 {
-       system("dtrace -c date -n 'pid\$target::main:return' >/dev/null");
+       system("dtrace -c date -ln 'pid\$target::main:return' >/dev/null");
 }
 EOF
 

Copied: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh
 (from r249366, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh
       Wed Apr 17 02:20:17 2013        (r249573, copy of r249366, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh)
@@ -0,0 +1,197 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+# ident        "%Z%%M% %I%     %E% SMI"
+
+unload()
+{
+       #
+       # Get the list of services whose processes have USDT probes.  Ideally
+       # it would be possible to unload the fasttrap provider while USDT
+       # probes exist -- once that fix is integrated, this hack can go away
+       # We create two lists -- one of regular SMF services and one of legacy
+       # services -- since each must be enabled and disabled using a specific
+       # mechanism.
+       #
+       pids=$(dtrace -l | \
+           perl -ne 'print "$1\n" if (/^\s*\S+\s+\S*\D(\d+)\s+/);' | \
+           sort | uniq | tr '\n' ',')
+
+       ctids=$(ps -p $pids -o ctid | tail +2 | sort | uniq)
+       svcs=
+       lrcs=
+
+       for ct in $ctids
+       do
+               line=$(svcs -o fmri,ctid | grep " $ct\$")
+               svc=$(echo $line | cut -d' ' -f1)
+
+               if [[ $(svcs -Ho STA $svc) == "LRC" ]]; then
+                       lrc=$(svcs -Ho SVC $svc | tr _ '?')
+                       lrcs="$lrcs $lrc"
+               else
+                       svcs="$svcs $svc"
+       fi
+       done
+
+       for svc in $svcs
+       do
+               svcadm disable -ts $svc
+       done
+
+       for lrc in $lrcs
+       do
+               #
+               # Does it seem a little paternalistic that lsvcrun requires
+               # this environment variable to be set? I'd say so...
+               #
+               SMF_RESTARTER=svc:/system/svc/restarter:default \
+                   /lib/svc/bin/lsvcrun $lrc stop
+       done
+
+       modunload -i 0
+       modunload -i 0
+       modunload -i 0
+       modinfo | grep dtrace
+       success=$?
+
+       for svc in $svcs
+       do
+               svcadm enable -ts $svc
+       done
+
+       for lrc in $lrcs
+       do
+               SMF_RESTARTER=svc:/system/svc/restarter:default \
+                   /lib/svc/bin/lsvcrun $lrc start
+       done
+
+       if [ ! $success ]; then
+               echo $tst: could not unload dtrace
+               exit 1
+       fi
+}
+
+script1()
+{
+       $dtrace -s /dev/stdin <<EOF
+       syscall:::entry
+       /pid != $ppid/
+       {
+               @a[probefunc] = count();
+       }
+
+       tick-1sec
+       /i++ == 5/
+       {
+               exit(0);
+       }
+EOF
+}
+
+script2()
+{
+       $dtrace -s /dev/stdin <<EOF
+
+       #pragma D option statusrate=1ms
+
+       syscall:::entry
+       /pid == $ppid/
+       {
+               ttl++;
+       }
+
+       tick-1sec
+       /i++ == 5/
+       {
+               exit(2);
+       }
+
+       END
+       /ttl/
+       {
+               printf("success; ttl is %d", ttl);
+               exit(0);
+       }
+
+       END
+       /ttl == 0/
+       {
+               printf("error -- total should be non-zero");
+               exit(1);
+       }
+EOF
+}
+
+if [ $# != 1 ]; then
+       echo expected one argument: '<'dtrace-path'>'
+       exit 2
+fi
+
+ppid=$$
+dtrace=$1
+
+unload
+script1 &
+child=$!
+
+let waited=0
+
+while [ "$waited" -lt 5 ]; do
+       seconds=`date +%S`
+
+       if [ "$seconds" -ne "$last" ]; then
+               last=$seconds
+               let waited=waited+1
+       fi
+done
+
+wait $child
+status=$?
+
+if [ "$status" -ne 0 ]; then
+       echo $tst: first dtrace failed
+       exit $status
+fi
+
+unload
+script2 &
+child=$!
+
+let waited=0
+
+while [ "$waited" -lt 10 ]; do
+       seconds=`date +%S`
+
+       if [ "$seconds" -ne "$last" ]; then
+               last=$seconds
+               let waited=waited+1
+       fi
+done
+
+wait $child
+status=$?
+
+exit $status

Copied: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d
 (from r249366, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d
        Wed Apr 17 02:20:17 2013        (r249573, copy of r249366, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d)
@@ -0,0 +1,29 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2011 by Delphix. All rights reserved.
+ */
+
+BEGIN
+{
+       print(*curpsinfo);
+}

Modified: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out
==============================================================================
--- 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out  
    Wed Apr 17 02:03:12 2013        (r249572)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out  
    Wed Apr 17 02:20:17 2013        (r249573)
@@ -1,6 +1,6 @@
 
--17
--12817
+239
+52719
 -1867788817
 1311768467294899695
 

Modified: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d
==============================================================================
--- 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d
       Wed Apr 17 02:03:12 2013        (r249572)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d
       Wed Apr 17 02:20:17 2013        (r249573)
@@ -24,10 +24,7 @@
  * Use is subject to license terms.
  */
 
-/*
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
-
+#pragma ident  "%Z%%M% %I%     %E% SMI"
 
 /*
  * ASSERTION:
@@ -38,10 +35,17 @@
  *
  * NOTES: This test behaves differently depending on the values
  * assigned to bufsize.
+ * 1. 0 > bufsize.
+ * 2. 0 == bufsize.
+ * 3. 0 < bufsize <= 7
+ * 4. 8 <= bufsize <= 31
+ * 5. 32 <= bufsize <= 47
+ * 6. 48 <= bufsize <= 71
+ * 7. 72 <= bufsize
  */
 
 #pragma D option quiet
-#pragma D option bufsize=49
+#pragma D option bufsize=41
 
 BEGIN
 {

Modified: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d
==============================================================================
--- 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d
      Wed Apr 17 02:03:12 2013        (r249572)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d
      Wed Apr 17 02:20:17 2013        (r249573)
@@ -24,10 +24,7 @@
  * Use is subject to license terms.
  */
 
-/*
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
-
+#pragma ident  "%Z%%M% %I%     %E% SMI"
 /*
  * ASSERTION:
  * Verify the behavior of speculations with changes in specsize.
@@ -38,7 +35,7 @@
  */
 
 #pragma D option quiet
-#pragma D option specsize=48
+#pragma D option specsize=40
 
 BEGIN
 {

Copied: 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d
 (from r249366, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d)
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d
       Wed Apr 17 02:20:17 2013        (r249573, copy of r249366, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d)
@@ -0,0 +1,61 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident  "%Z%%M% %I%     %E% SMI"
+
+/*
+ * ASSERTION:
+ * The D inline translation mechanism can be used to facilitate stable
+ * translations.
+ *
+ * SECTION: Translators/ Translator Declarations
+ * SECTION: Translators/ Translate Operator
+ * SECTION: Translators/Stable Translations
+ *
+ * NOTES: Uncomment the pragma that explicitly resets the attributes of
+ * myinfo identifier to Stable/Stable/Common from Private/Private/Unknown.
+ * Run the program with and without the comments as:
+ * /usr/sbin/dtrace -vs man.TestTransStability.d
+ */
+
+#pragma D option quiet
+
+inline lwpsinfo_t *myinfo = xlate < lwpsinfo_t *> (curthread);
+
+/*
+#pragma D attributes Stable/Stable/Common myinfo
+*/
+
+BEGIN
+{
+       trace(myinfo->pr_flag);
+       exit(0);
+}
+
+ERROR
+{
+       exit(1);
+}

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c   Wed Apr 
17 02:03:12 2013        (r249572)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c   Wed Apr 
17 02:20:17 2013        (r249573)
@@ -26,7 +26,6 @@
 
 /*
  * Copyright (c) 2011, Joyent, Inc. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
  */
 
 #include <stdlib.h>
@@ -895,14 +894,33 @@ dt_aggregate_valcmp(const void *lhs, con
        caddr_t rdata = rh->dtahe_data.dtada_data;
        dtrace_recdesc_t *lrec, *rrec;
        int64_t *laddr, *raddr;
-       int rval;
+       int rval, i;
+
+       if ((rval = dt_aggregate_hashcmp(lhs, rhs)) != 0)
+               return (rval);
+
+       if (lagg->dtagd_nrecs > ragg->dtagd_nrecs)
+               return (DT_GREATERTHAN);
+
+       if (lagg->dtagd_nrecs < ragg->dtagd_nrecs)
+               return (DT_LESSTHAN);
 
-       assert(lagg->dtagd_nrecs == ragg->dtagd_nrecs);
+       for (i = 0; i < lagg->dtagd_nrecs; i++) {
+               lrec = &lagg->dtagd_rec[i];
+               rrec = &ragg->dtagd_rec[i];
 
-       lrec = &lagg->dtagd_rec[lagg->dtagd_nrecs - 1];
-       rrec = &ragg->dtagd_rec[ragg->dtagd_nrecs - 1];
+               if (lrec->dtrd_offset < rrec->dtrd_offset)
+                       return (DT_LESSTHAN);
+
+               if (lrec->dtrd_offset > rrec->dtrd_offset)
+                       return (DT_GREATERTHAN);
 
-       assert(lrec->dtrd_action == rrec->dtrd_action);
+               if (lrec->dtrd_action < rrec->dtrd_action)
+                       return (DT_LESSTHAN);
+
+               if (lrec->dtrd_action > rrec->dtrd_action)
+                       return (DT_GREATERTHAN);
+       }
 
        laddr = (int64_t *)(uintptr_t)(ldata + lrec->dtrd_offset);
        raddr = (int64_t *)(uintptr_t)(rdata + rrec->dtrd_offset);

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c  Wed Apr 17 
02:03:12 2013        (r249572)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c  Wed Apr 17 
02:20:17 2013        (r249573)
@@ -22,7 +22,7 @@
 /*
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2011, Joyent Inc. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2011 by Delphix. All rights reserved.
  */
 
 /*
@@ -664,17 +664,15 @@ static void
 dt_action_trace(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
 {
        dtrace_actdesc_t *ap = dt_stmt_action(dtp, sdp);
-       boolean_t istrace = (dnp->dn_ident->di_id == DT_ACT_TRACE);
-       const char *act = istrace ?  "trace" : "print";
 
        if (dt_node_is_void(dnp->dn_args)) {
-               dnerror(dnp->dn_args, istrace ? D_TRACE_VOID : D_PRINT_VOID,
-                   "%s( ) may not be applied to a void expression\n", act);
+               dnerror(dnp->dn_args, D_TRACE_VOID,
+                   "trace( ) may not be applied to a void expression\n");
        }
 
-       if (dt_node_resolve(dnp->dn_args, DT_IDENT_XLPTR) != NULL) {
-               dnerror(dnp->dn_args, istrace ? D_TRACE_DYN : D_PRINT_DYN,
-                   "%s( ) may not be applied to a translated pointer\n", act);
+       if (dt_node_is_dynamic(dnp->dn_args)) {
+               dnerror(dnp->dn_args, D_TRACE_DYN,
+                   "trace( ) may not be applied to a dynamic expression\n");
        }
 
        if (dnp->dn_args->dn_kind == DT_NODE_AGG) {
@@ -684,34 +682,51 @@ dt_action_trace(dtrace_hdl_t *dtp, dt_no
        }
 
        dt_cg(yypcb, dnp->dn_args);
+       ap->dtad_difo = dt_as(yypcb);
+       ap->dtad_kind = DTRACEACT_DIFEXPR;
+}
 
-       /*
-        * The print() action behaves identically to trace(), except that it
-        * stores the CTF type of the argument (if present) within the DOF for
-        * the DIFEXPR action.  To do this, we set the 'dtsd_strdata' to point
-        * to the fully-qualified CTF type ID for the result of the DIF
-        * action.  We use the ID instead of the name to handles complex types
-        * like arrays and function pointers that can't be resolved by
-        * ctf_type_lookup().  This is later processed by dtrace_dof_create()
-        * and turned into a reference into the string table so that we can
-        * get the type information when we process the data after the fact.
-        */
-       if (dnp->dn_ident->di_id == DT_ACT_PRINT) {
-               dt_node_t *dret;
-               size_t n;
-               dt_module_t *dmp;
-
-               dret = yypcb->pcb_dret;
-               dmp = dt_module_lookup_by_ctf(dtp, dret->dn_ctfp);
-
-               n = snprintf(NULL, 0, "%s`%ld", dmp->dm_name, dret->dn_type) + 
1;
-               sdp->dtsd_strdata = dt_alloc(dtp, n);
-               if (sdp->dtsd_strdata == NULL)
-                       longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM);
-               (void) snprintf(sdp->dtsd_strdata, n, "%s`%ld", dmp->dm_name,
-                   dret->dn_type);
+/*
+ * The print() action behaves identically to trace(), except that it stores the
+ * CTF type of the argument (if present) within the DOF for the DIFEXPR action.
+ * To do this, we set the 'dtsd_strdata' to point to the fully-qualified CTF
+ * type ID for the result of the DIF action.  We use the ID instead of the name
+ * to handles complex types like arrays and function pointers that can't be
+ * resolved by ctf_type_lookup().  This is later processed by
+ * dtrace_dof_create() and turned into a reference into the string table so
+ * that we can get the type information when we process the data after the
+ * fact.
+ */
+static void
+dt_action_print(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
+{
+       dtrace_actdesc_t *ap = dt_stmt_action(dtp, sdp);
+       dt_node_t *dret;
+       size_t len;
+       dt_module_t *dmp;
+
+       if (dt_node_is_void(dnp->dn_args)) {
+               dnerror(dnp->dn_args, D_PRINT_VOID,
+                   "print( ) may not be applied to a void expression\n");
        }
 
+       if (dt_node_is_dynamic(dnp->dn_args)) {
+               dnerror(dnp->dn_args, D_PRINT_DYN,
+                   "print( ) may not be applied to a dynamic expression\n");
+       }
+
+       dt_cg(yypcb, dnp->dn_args);
+
+       dret = yypcb->pcb_dret;
+       dmp = dt_module_lookup_by_ctf(dtp, dret->dn_ctfp);
+
+       len = snprintf(NULL, 0, "%s`%ld", dmp->dm_name, dret->dn_type) + 1;
+       sdp->dtsd_strdata = dt_alloc(dtp, len);
+       if (sdp->dtsd_strdata == NULL)
+               longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM);
+       (void) snprintf(sdp->dtsd_strdata, len, "%s`%ld", dmp->dm_name,
+           dret->dn_type);
+
        ap->dtad_difo = dt_as(yypcb);
        ap->dtad_kind = DTRACEACT_DIFEXPR;
 }
@@ -1136,9 +1151,6 @@ dt_compile_fun(dtrace_hdl_t *dtp, dt_nod
        case DT_ACT_PANIC:
                dt_action_panic(dtp, dnp->dn_expr, sdp);
                break;
-       case DT_ACT_PRINT:
-               dt_action_trace(dtp, dnp->dn_expr, sdp);
-               break;
        case DT_ACT_PRINTA:
                dt_action_printa(dtp, dnp->dn_expr, sdp);
                break;
@@ -1175,6 +1187,9 @@ dt_compile_fun(dtrace_hdl_t *dtp, dt_nod
        case DT_ACT_TRACE:
                dt_action_trace(dtp, dnp->dn_expr, sdp);
                break;
+       case DT_ACT_PRINT:
+               dt_action_print(dtp, dnp->dn_expr, sdp);
+               break;
        case DT_ACT_TRACEMEM:
                dt_action_tracemem(dtp, dnp->dn_expr, sdp);
                break;
@@ -2550,8 +2565,7 @@ dt_compile(dtrace_hdl_t *dtp, int contex
        }
 
 out:
-       if (context != DT_CTX_DTYPE && yypcb->pcb_root != NULL &&
-           DT_TREEDUMP_PASS(dtp, 3))
+       if (context != DT_CTX_DTYPE && DT_TREEDUMP_PASS(dtp, 3))
                dt_node_printr(yypcb->pcb_root, stderr, 0);
 
        if (dtp->dt_cdefs_fd != -1 && (ftruncate64(dtp->dt_cdefs_fd, 0) == -1 ||

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c  Wed Apr 17 
02:03:12 2013        (r249572)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c  Wed Apr 17 
02:20:17 2013        (r249573)
@@ -19,15 +19,12 @@
  *
  * CDDL HEADER END
  */
-
 /*
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-/*
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
+#pragma ident  "%Z%%M% %I%     %E% SMI"
 
 #include <sys/types.h>
 #include <sys/sysmacros.h>
@@ -196,6 +193,9 @@ dt_cg_ptrsize(dt_node_t *dnp, dt_irlist_
        ssize_t size;
        int sreg;
 
+       if ((sreg = dt_regset_alloc(drp)) == -1)
+               longjmp(yypcb->pcb_jmpbuf, EDT_NOREG);
+
        type = ctf_type_resolve(ctfp, dnp->dn_type);
        kind = ctf_type_kind(ctfp, type);
        assert(kind == CTF_K_POINTER || kind == CTF_K_ARRAY);
@@ -212,7 +212,6 @@ dt_cg_ptrsize(dt_node_t *dnp, dt_irlist_
        if ((size = ctf_type_size(ctfp, type)) == 1)
                return; /* multiply or divide by one can be omitted */
 
-       sreg = dt_regset_alloc(drp);
        dt_cg_setx(dlp, sreg, size);
        instr = DIF_INSTR_FMT(op, dreg, sreg, dreg);
        dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
@@ -252,7 +251,9 @@ dt_cg_field_get(dt_node_t *dnp, dt_irlis
 
        assert(dnp->dn_op == DT_TOK_PTR || dnp->dn_op == DT_TOK_DOT);
        r1 = dnp->dn_left->dn_reg;
-       r2 = dt_regset_alloc(drp);
+
+       if ((r2 = dt_regset_alloc(drp)) == -1)
+               longjmp(yypcb->pcb_jmpbuf, EDT_NOREG);
 
        /*
         * On little-endian architectures, ctm_offset counts from the right so
@@ -355,9 +356,10 @@ dt_cg_field_set(dt_node_t *src, dt_irlis
                    "bits %u\n", m.ctm_offset, m.ctm_type, e.cte_bits);
        }
 
-       r1 = dt_regset_alloc(drp);
-       r2 = dt_regset_alloc(drp);
-       r3 = dt_regset_alloc(drp);
+       if ((r1 = dt_regset_alloc(drp)) == -1 ||
+           (r2 = dt_regset_alloc(drp)) == -1 ||
+           (r3 = dt_regset_alloc(drp)) == -1)
+               longjmp(yypcb->pcb_jmpbuf, EDT_NOREG);
 
        /*
         * Compute shifts and masks.  We need to compute "shift" as the amount
@@ -421,7 +423,8 @@ dt_cg_store(dt_node_t *src, dt_irlist_t 
                size = dt_node_type_size(src);
 
        if (src->dn_flags & DT_NF_REF) {
-               reg = dt_regset_alloc(drp);
+               if ((reg = dt_regset_alloc(drp)) == -1)
+                       longjmp(yypcb->pcb_jmpbuf, EDT_NOREG);
                dt_cg_setx(dlp, reg, size);
                instr = DIF_INSTR_COPYS(src->dn_reg, reg, dst->dn_reg);
                dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
@@ -471,58 +474,30 @@ dt_cg_typecast(const dt_node_t *src, con
        size_t dstsize = dt_node_type_size(dst);
 
        dif_instr_t instr;
-       int rg;
-
-       if (!dt_node_is_scalar(dst))
-               return; /* not a scalar */
-       if (dstsize == srcsize &&
-           ((src->dn_flags ^ dst->dn_flags) & DT_NF_SIGNED) != 0)
-               return; /* not narrowing or changing signed-ness */
-       if (dstsize > srcsize && (src->dn_flags & DT_NF_SIGNED) == 0)
-               return; /* nothing to do in this case */
-
-       rg = dt_regset_alloc(drp);
-
-       if (dstsize > srcsize) {
-               int n = sizeof (uint64_t) * NBBY - srcsize * NBBY;
-               int s = (dstsize - srcsize) * NBBY;
-
-               dt_cg_setx(dlp, rg, n);
+       int reg, n;
 
-               instr = DIF_INSTR_FMT(DIF_OP_SLL, src->dn_reg, rg, dst->dn_reg);
-               dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
+       if (dt_node_is_scalar(dst) && (dstsize < srcsize ||
+           (src->dn_flags & DT_NF_SIGNED) ^ (dst->dn_flags & DT_NF_SIGNED))) {
+               if ((reg = dt_regset_alloc(drp)) == -1)
+                       longjmp(yypcb->pcb_jmpbuf, EDT_NOREG);
 
-               if ((dst->dn_flags & DT_NF_SIGNED) || n == s) {
-                       instr = DIF_INSTR_FMT(DIF_OP_SRA,
-                           dst->dn_reg, rg, dst->dn_reg);
-                       dt_irlist_append(dlp,
-                           dt_cg_node_alloc(DT_LBL_NONE, instr));
-               } else {
-                       dt_cg_setx(dlp, rg, s);
-                       instr = DIF_INSTR_FMT(DIF_OP_SRA,
-                           dst->dn_reg, rg, dst->dn_reg);
-                       dt_irlist_append(dlp,
-                           dt_cg_node_alloc(DT_LBL_NONE, instr));
-                       dt_cg_setx(dlp, rg, n - s);
-                       instr = DIF_INSTR_FMT(DIF_OP_SRL,
-                           dst->dn_reg, rg, dst->dn_reg);
-                       dt_irlist_append(dlp,
-                           dt_cg_node_alloc(DT_LBL_NONE, instr));
-               }
-       } else if (dstsize != sizeof (uint64_t)) {
-               int n = sizeof (uint64_t) * NBBY - dstsize * NBBY;
+               if (dstsize < srcsize)
+                       n = sizeof (uint64_t) * NBBY - dstsize * NBBY;
+               else
+                       n = sizeof (uint64_t) * NBBY - srcsize * NBBY;
 
-               dt_cg_setx(dlp, rg, n);
+               dt_cg_setx(dlp, reg, n);
 
-               instr = DIF_INSTR_FMT(DIF_OP_SLL, src->dn_reg, rg, dst->dn_reg);
+               instr = DIF_INSTR_FMT(DIF_OP_SLL,
+                   src->dn_reg, reg, dst->dn_reg);
                dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
 
                instr = DIF_INSTR_FMT((dst->dn_flags & DT_NF_SIGNED) ?
-                   DIF_OP_SRA : DIF_OP_SRL, dst->dn_reg, rg, dst->dn_reg);
+                   DIF_OP_SRA : DIF_OP_SRL, dst->dn_reg, reg, dst->dn_reg);
+
                dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
+               dt_regset_free(drp, reg);
        }
-
-       dt_regset_free(drp, rg);
 }
 
 /*
@@ -548,7 +523,8 @@ dt_cg_arglist(dt_ident_t *idp, dt_node_t
        for (dnp = args; dnp != NULL; dnp = dnp->dn_list)
                dt_cg_node(dnp, dlp, drp);
 
-       dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, DIF_INSTR_FLUSHTS));
+       dt_irlist_append(dlp,
+           dt_cg_node_alloc(DT_LBL_NONE, DIF_INSTR_FLUSHTS));
 
        for (dnp = args; dnp != NULL; dnp = dnp->dn_list, i++) {
                dtrace_diftype_t t;
@@ -562,18 +538,17 @@ dt_cg_arglist(dt_ident_t *idp, dt_node_t
                dt_cg_typecast(dnp, &isp->dis_args[i], dlp, drp);
                isp->dis_args[i].dn_reg = -1;
 
-               if (t.dtdt_flags & DIF_TF_BYREF) {
+               if (t.dtdt_flags & DIF_TF_BYREF)
                        op = DIF_OP_PUSHTR;
-                       if (t.dtdt_size != 0) {
-                               reg = dt_regset_alloc(drp);
-                               dt_cg_setx(dlp, reg, t.dtdt_size);
-                       } else {
-                               reg = DIF_REG_R0;
-                       }
-               } else {
+               else
                        op = DIF_OP_PUSHTV;
+
+               if (t.dtdt_size != 0) {
+                       if ((reg = dt_regset_alloc(drp)) == -1)
+                               longjmp(yypcb->pcb_jmpbuf, EDT_NOREG);
+                       dt_cg_setx(dlp, reg, t.dtdt_size);
+               } else
                        reg = DIF_REG_R0;
-               }
 
                instr = DIF_INSTR_PUSHTS(op, t.dtdt_kind, reg, dnp->dn_reg);
                dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
@@ -654,7 +629,9 @@ dt_cg_prearith_op(dt_node_t *dnp, dt_irl
        dt_cg_node(dnp->dn_child, dlp, drp);
        dnp->dn_reg = dnp->dn_child->dn_reg;
 
-       reg = dt_regset_alloc(drp);
+       if ((reg = dt_regset_alloc(drp)) == -1)
+               longjmp(yypcb->pcb_jmpbuf, EDT_NOREG);
+
        dt_cg_setx(dlp, reg, size);
 
        instr = DIF_INSTR_FMT(op, dnp->dn_reg, reg, dnp->dn_reg);
@@ -711,7 +688,9 @@ dt_cg_postarith_op(dt_node_t *dnp, dt_ir
        dt_cg_node(dnp->dn_child, dlp, drp);
        dnp->dn_reg = dnp->dn_child->dn_reg;
 
-       nreg = dt_regset_alloc(drp);
+       if ((nreg = dt_regset_alloc(drp)) == -1)
+               longjmp(yypcb->pcb_jmpbuf, EDT_NOREG);
+
        dt_cg_setx(dlp, nreg, size);
        instr = DIF_INSTR_FMT(op, dnp->dn_reg, nreg, nreg);
        dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
@@ -1029,7 +1008,9 @@ dt_cg_asgn_op(dt_node_t *dnp, dt_irlist_
                 * set it to the size of our data structure, and then replace
                 * it with the result of an allocs of the specified size.
                 */
-               r1 = dt_regset_alloc(drp);
+               if ((r1 = dt_regset_alloc(drp)) == -1)
+                       longjmp(yypcb->pcb_jmpbuf, EDT_NOREG);
+
                dt_cg_setx(dlp, r1,
                    ctf_type_size(dxp->dx_dst_ctfp, dxp->dx_dst_base));
 
@@ -1073,7 +1054,8 @@ dt_cg_asgn_op(dt_node_t *dnp, dt_irlist_
                         * and add r1 to it before storing the result.
                         */
                        if (ctm.ctm_offset != 0) {
-                               r2 = dt_regset_alloc(drp);
+                               if ((r2 = dt_regset_alloc(drp)) == -1)
+                                       longjmp(yypcb->pcb_jmpbuf, EDT_NOREG);
 
                                /*
                                 * Add the member offset rounded down to the
@@ -1160,7 +1142,8 @@ dt_cg_assoc_op(dt_node_t *dnp, dt_irlist
 
        dt_cg_arglist(dnp->dn_ident, dnp->dn_args, dlp, drp);
 
-       dnp->dn_reg = dt_regset_alloc(drp);
+       if ((dnp->dn_reg = dt_regset_alloc(drp)) == -1)
+               longjmp(yypcb->pcb_jmpbuf, EDT_NOREG);
 
        if (dnp->dn_ident->di_flags & DT_IDFLG_TLS)
                op = DIF_OP_LDTAA;
@@ -1290,7 +1273,9 @@ dt_cg_array_op(dt_node_t *dnp, dt_irlist
        if ((size = dt_node_type_size(dnp)) == sizeof (uint64_t))
                return;
 

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to