diff -c --recursive mozilla-origin-1.5.0.7/js/src/Makefile.in mozilla-dtrace-1.5.0.7/js/src/Makefile.in
*** mozilla-origin-1.5.0.7/js/src/Makefile.in	Mon Jun 12 14:36:07 2006
--- mozilla-dtrace-1.5.0.7/js/src/Makefile.in	Mon Apr 16 22:02:54 2007
***************
*** 36,41 ****
--- 36,43 ----
  # the terms of any one of the MPL, the GPL or the LGPL.
  #
  # ***** END LICENSE BLOCK *****
+ #
+ # Add DTrace support for Solaris 10 family
  
  DEPTH		= ../..
  topsrcdir	= @top_srcdir@
***************
*** 97,102 ****
--- 99,105 ----
  		jsxdrapi.c \
  		jsxml.c \
  		prmjtime.c \
+ 		jsdtracef.c \
  		$(NULL)
  
  EXPORTS		= \
***************
*** 143,150 ****
--- 146,157 ----
  		jsutil.h \
  		jsxdrapi.h \
  		jsxml.h \
+ 		jsdtracef.h \
+ 		jsdtrace.h \
  		$(NULL)
  
+ 		
+ 
  ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
  EXPORTS		+= jscpucfg.h
  endif
***************
*** 408,410 ****
--- 415,430 ----
  endif
  endif
  
+ 
+ # 04-16-2007 BDG  DTrace provider support
+ ifeq ($(OS_ARCH),SunOS)
+ _ORIGIN_OBJS	= $(CSRCS:.c=.$(OBJ_SUFFIX))
+ OBJS		+= jsdtrace.o
+ ORIGIN_OBJS	= $(strip $(_ORIGIN_OBJS))
+ DEFINES += -DSOLARIS
+ 
+ # 04-16-2007 BDG: Add dependency of jbdtrace.o
+ jsdtrace.o: jsdtrace.d $(ORIGIN_OBJS)
+ 	dtrace -G -32 -s jsdtrace.d $(_ORIGIN_OBJS)
+ endif
+ 
diff -c --recursive mozilla-origin-1.5.0.7/js/src/jsinterp.c mozilla-dtrace-1.5.0.7/js/src/jsinterp.c
*** mozilla-origin-1.5.0.7/js/src/jsinterp.c	Thu Aug 31 17:43:09 2006
--- mozilla-dtrace-1.5.0.7/js/src/jsinterp.c	Sun Mar 25 18:11:24 2007
***************
*** 67,72 ****
--- 67,78 ----
  #include "jsscript.h"
  #include "jsstr.h"
  
+ /* 04-11-2007 Dtrace support */
+ #ifdef SOLARIS
+ #include "jsdtrace.h"
+ #include "jsdtracef.h"
+ #endif /* SOLARIS */
+ 
  #if JS_HAS_JIT
  #include "jsjit.h"
  #endif
***************
*** 1353,1358 ****
--- 1359,1370 ----
      JSObject *obj, *tmp;
      JSBool ok;
  
+ /* 04-11-2007 Dtrace support */
+ #ifdef SOLARIS
+     if (JAVASCRIPT_EXECUTE_START_ENABLED())
+         jsdtrace_execute_start(script);
+ #endif /* SOLARIS */
+ 
      hook = cx->runtime->executeHook;
      hookData = mark = NULL;
      oldfp = cx->fp;
***************
*** 1383,1390 ****
          frame.nvars = script->numGlobalVars;
          if (frame.nvars) {
              frame.vars = js_AllocRawStack(cx, frame.nvars, &mark);
!             if (!frame.vars)
!                 return JS_FALSE;
              memset(frame.vars, 0, frame.nvars * sizeof(jsval));
          } else {
              frame.vars = NULL;
--- 1395,1405 ----
          frame.nvars = script->numGlobalVars;
          if (frame.nvars) {
              frame.vars = js_AllocRawStack(cx, frame.nvars, &mark);
!             /* 14-Sep-2006      BDG     Changed return to goto for tracing */
!             if (!frame.vars) {
!                 ok = JS_FALSE;
!                 goto out;
!             }
              memset(frame.vars, 0, frame.nvars * sizeof(jsval));
          } else {
              frame.vars = NULL;
***************
*** 1448,1453 ****
--- 1463,1475 ----
          oldfp->dormantNext = NULL;
      }
  
+     /* 14-Sep-2006      BDG     DTrace script execute, return */
+ out:
+ #ifdef SOLARIS
+     if (JAVASCRIPT_EXECUTE_DONE_ENABLED())
+         jsdtrace_execute_done(script);
+ #endif /* SOLARIS */
+ 
      return ok;
  }
  
***************
*** 2009,2014 ****
--- 2031,2042 ----
                      ok &= js_PutArgsObject(cx, fp);
  #endif
  
+                 /* 11-Sep-2006      BDG     DTrace function return, inlines */
+ #ifdef SOLARIS
+                 if (JAVASCRIPT_FUNCTION_RETURN_ENABLED())
+                     jsdtrace_function_return(fp, fp->fun);
+ #endif /* SOLARIS */
+ 
                  /* Restore context version only if callee hasn't set version. */
                  if (cx->version == currentVersion) {
                      currentVersion = ifp->callerVersion;
***************
*** 3572,3577 ****
--- 3600,3612 ----
                  endpc = pc + script->length;
                  inlineCallCount++;
                  JS_RUNTIME_METER(rt, inlineCalls);
+ 
+                 /* 10-Sep-2006      BDG     DTrace function entry, inlines */
+ #ifdef SOLARIS
+                 if (JAVASCRIPT_FUNCTION_ENTRY_ENABLED())
+                     jsdtrace_function_entry(fp, fun);
+ #endif /* SOLARIS */
+ 
                  continue;
  
                bad_inline_call:
***************
*** 3580,3586 ****
--- 3615,3635 ----
                  goto out;
              }
  
+             /* 10-Sep-2006      BDG     DTrace function entry, non-inlines */
+ #ifdef SOLARIS
+             if (JAVASCRIPT_FUNCTION_ENTRY_ENABLED() && 
+                 JSVAL_IS_FUNCTION(cx, lval))
+                 jsdtrace_function_entry(fp, fun);
+ #endif /* SOLARIS */
+ 
              ok = js_Invoke(cx, argc, 0);
+             /* 11-Sep-2006      BDG     DTrace function return, non-inlines */
+ #ifdef SOLARIS
+             if (JAVASCRIPT_FUNCTION_RETURN_ENABLED() && 
+                 JSVAL_IS_FUNCTION(cx, lval))
+                 jsdtrace_function_return(fp, fun);
+ #endif /* SOLARIS */
+ 
              RESTORE_SP(fp);
              LOAD_BRANCH_CALLBACK(cx);
              LOAD_INTERRUPT_HANDLER(rt);
diff -c --recursive mozilla-origin-1.5.0.7/js/src/jsobj.c mozilla-dtrace-1.5.0.7/js/src/jsobj.c
*** mozilla-origin-1.5.0.7/js/src/jsobj.c	Thu Aug 10 11:54:10 2006
--- mozilla-dtrace-1.5.0.7/js/src/jsobj.c	Mon Apr 16 14:00:06 2007
***************
*** 73,78 ****
--- 73,84 ----
  #include "jsxml.h"
  #endif
  
+ /* 12-Sep-2006  BDG     Added these for DTrace */
+ #ifdef SOLARIS
+ #include "jsdtrace.h"
+ #include "jsdtracef.h"
+ #endif /* SOLARIS */
+ 
  #ifdef JS_THREADSAFE
  #define NATIVE_DROP_PROPERTY js_DropProperty
  
***************
*** 2061,2072 ****
      jsval *newslots;
      JSTempValueRooter tvr;
  
      /* Bootstrap the ur-object, and make it the default prototype object. */
      if (!proto) {
          if (!GetClassPrototype(cx, parent, clasp->name, &proto))
!             return NULL;
          if (!proto && !GetClassPrototype(cx, parent, js_Object_str, &proto))
!             return NULL;
      }
  
      /* Always call the class's getObjectOps hook if it has one. */
--- 2067,2086 ----
      jsval *newslots;
      JSTempValueRooter tvr;
  
+     /* 13-Sep-2006      BDG     DTrace new object entry */
+ #ifdef SOLARIS
+     if (JAVASCRIPT_OBJECT_CREATE_START_ENABLED())
+         jsdtrace_object_create_start(cx->fp, clasp);
+ #endif /* SOLARIS */
+ 
      /* Bootstrap the ur-object, and make it the default prototype object. */
      if (!proto) {
+         /* 13-Sep-2006  BDG     Changed return NULL's to goto tracereturns */
          if (!GetClassPrototype(cx, parent, clasp->name, &proto))
!             goto tracereturn;
!         /* 13-Sep-2006  BDG     Changed return NULL's to goto tracereturns */
          if (!proto && !GetClassPrototype(cx, parent, js_Object_str, &proto))
!             goto tracereturn;
      }
  
      /* Always call the class's getObjectOps hook if it has one. */
***************
*** 2081,2087 ****
       */
      obj = (JSObject *) js_NewGCThing(cx, GCX_OBJECT, sizeof(JSObject));
      if (!obj)
!         return NULL;
  
      /*
       * Root obj to prevent it from being killed.
--- 2095,2101 ----
       */
      obj = (JSObject *) js_NewGCThing(cx, GCX_OBJECT, sizeof(JSObject));
      if (!obj)
!         goto tracereturn;
  
      /*
       * Root obj to prevent it from being killed.
***************
*** 2159,2169 ****
--- 2173,2203 ----
  out:
      JS_POP_TEMP_ROOT(cx, &tvr);
      cx->newborn[GCX_OBJECT] = (JSGCThing *) obj;
+ 
+     /* 13-Sep-2006      BDG     DTrace new object return, success */
+ #ifdef SOLARIS
+     if (JAVASCRIPT_OBJECT_CREATE_ENABLED())
+         jsdtrace_object_create(cx, clasp, obj);
+     if (JAVASCRIPT_OBJECT_CREATE_DONE_ENABLED())
+         jsdtrace_object_create_done(cx->fp, clasp);
+ #endif /* SOLARIS */
+ 
      return obj;
  
  bad:
      obj = NULL;
      goto out;
+ 
+ tracereturn:
+     /* 13-Sep-2006      BDG     DTrace new object return, fail */
+ #ifdef SOLARIS
+     if (JAVASCRIPT_OBJECT_CREATE_ENABLED())
+         jsdtrace_object_create(cx, clasp, NULL);
+     if (JAVASCRIPT_OBJECT_CREATE_DONE_ENABLED())
+         jsdtrace_object_create_done(cx->fp, clasp);
+     return NULL;
+ #endif /* SOLARIS */
+ 
  }
  
  JSBool
***************
*** 2318,2323 ****
--- 2352,2364 ----
       * while the GC is running.
       */
      LOCKED_OBJ_GET_CLASS(obj)->finalize(cx, obj);
+     /* 13-Sep-2006      BDG     DTrace finilize objects */
+ 
+ #ifdef SOLARIS
+     if (JAVASCRIPT_OBJECT_FINALIZE_ENABLED())
+         jsdtrace_object_finalize(obj);
+ #endif /* SOLARIS */
+ 
  
      /* Drop map and free slots. */
      js_DropObjectMap(cx, map, obj);
